// // Created by mpapa on 05.12.2017. // #include "AbstractionLayer_1.h" #include "../../../header.h" #include void AbstractionLayer_1::PreProcessing(coor mySize, const vector* partArray) { InitialiseConstraintMatrixSize(mySize.row+2, mySize.col+2); setEdgeZero(); } //it through qualityVector and removes all that do not trigger PlaceOfPartGood bool AbstractionLayer_1::EvaluateQuality (const coor constraintCoordinate, qualityVector& qVector) { for(auto it = qVector.begin(); it != qVector.end(); it++) { if(PlaceOfPartGood(constraintCoordinate, it->first->m_test1.m_connections)) continue; qVector.erase(it++); } } bool AbstractionLayer_1::SetConstraintOnPosition(const coor constraintCoordinate, const AbstractionLayer_1_Properties constraint) { m_constraintMatrix[constraintCoordinate.col][constraintCoordinate.row].m_connections=constraint.m_connections; } bool AbstractionLayer_1::RemoveConstraintOnPosition(const coor constraintCoordinate) { m_constraintMatrix[constraintCoordinate.col][constraintCoordinate.row].m_connections=0b11111111; } bool AbstractionLayer_1::CreateRandomPuzzle() { std:: minstd_rand simple_rand; simple_rand.seed((unsigned int)"dumbo"); for(int col=1;col& PuzzleBox) { if(!(PuzzleBox.size())) for(int i = 0; i< (m_constraintMatrix.size()-2)*(m_constraintMatrix[0].size()-2);i++) PuzzleBox.emplace_back(Part()); int i=0; for(int col=1;col> (shifts*2) | Part << sizeof(uint8_t)*8 - (shifts*2); }