diff --git a/Source/functions/AbstractionLayers/Layer1/AbstractionLayer_1.cpp b/Source/functions/AbstractionLayers/Layer1/AbstractionLayer_1.cpp index d5cf7ba..aa6aaaf 100644 --- a/Source/functions/AbstractionLayers/Layer1/AbstractionLayer_1.cpp +++ b/Source/functions/AbstractionLayers/Layer1/AbstractionLayer_1.cpp @@ -11,49 +11,52 @@ void AbstractionLayer_1::PreProcessing(const vector* partArray) setEdgeZero(); } +//it through qualityVector and removes all that do not trigger PlaceOfPartGood bool AbstractionLayer_1::EvalueteQuality (const coor constraintCoordinate, qualityVector& qVector) { - for(int i=0;ifirst->m_test1.m_connections)) + continue; + qualityVector.erase(it++); } } bool AbstractionLayer_1::SetConstraintOnPosition(const coor constraintCoordinate, const AbstractionLayer_1_Properties constraint) { - m_constraintMatrix[constraintCoordinate.col][constraintCoordinate.row]= + 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 #include #include +#include class AbstractionLayer_1 : public AbstraktionLayer_Base { public: - void PreProcessing(const vector* partArray); + void PreProcessing(const vector* partArray);//override bool EvalueteQuality (const coor constraintCoordinate, qualityVector& qVector); bool SetConstraintOnPosition(const coor constraintCoordinate, const AbstractionLayer_1_Properties constraint); bool RemoveConstraintOnPosition(const coor constraintCoordinate); @@ -24,6 +25,7 @@ public: bool CreateRandomPuzzle(); + qualityVector returnInBox(vector& PuzzleBox); private: };