added dp to puzzle

This commit is contained in:
Raphael Maenle 2017-12-22 23:09:23 +01:00
parent 6f57b382cb
commit ae9e4633d6
4 changed files with 5 additions and 6 deletions

View File

@ -21,7 +21,7 @@ bool DestructionPower::EvaluateQuality (const coor constraintCoordinate, quality
{ {
} }
bool DestructionPower::SetConstraintOnPosition(const coor constraintCoordinate, const AbstractionLayer_1_Properties constraint) bool DestructionPower::SetConstraintOnPosition(const coor constraintCoordinate, const DestructionPower_Properties constraint)
{ {
} }

View File

@ -19,12 +19,11 @@ class DestructionPower : public AbstractionLayer_Base<DestructionPower_Propertie
public: public:
void PreProcessing(coor mySize,const vector<Part*>* partArray)override; void PreProcessing(coor mySize,const vector<Part*>* partArray)override;
bool EvaluateQuality (coor constraintCoordinate, qualityVector& qVector) override; bool EvaluateQuality (coor constraintCoordinate, qualityVector& qVector) override;
bool SetConstraintOnPosition(coor constraintCoordinate, AbstractionLayer_1_Properties constraint); bool SetConstraintOnPosition(coor constraintCoordinate, DestructionPower_Properties constraint);
bool RemoveConstraintOnPosition(coor constraintCoordinate)override; bool RemoveConstraintOnPosition(coor constraintCoordinate)override;
void DestructionOfSurrounding(coor constraintCoordinate); void DestructionOfSurrounding(coor constraintCoordinate);
int getNextAbstractionLayer(coor newCoordinate, int currentAbstractionLayer); int getNextAbstractionLayer(coor newCoordinate, int currentAbstractionLayer);
private: private:
}; };

View File

@ -44,7 +44,7 @@ void createNextLogElement(vector<LogEntry>& log, vector<Part*>& p_Box, Puzzle& p
{ {
log.emplace_back(LogEntry(coor(0, 0))); log.emplace_back(LogEntry(coor(0, 0)));
log.back().myCoor = calculateNextCoor(log, p_Box,puzzleMat); log.back().myCoor = calculateNextCoor(log, p_Box,puzzleMat);
puzzleMat.dp->DestructionOfSurrounding(log.back().myCoor);//calculate dp from surrounding puzzleMat.dp.DestructionOfSurrounding(log.back().myCoor);//calculate dp from surrounding
solve(log, p_Box,puzzleMat); solve(log, p_Box,puzzleMat);
} }
@ -69,7 +69,7 @@ coor calculateNextCoor(vector<LogEntry>& log, vector<Part*>& p_Box, Puzzle& puzz
void solve(vector<LogEntry>& log, vector<Part*>& p_Box, Puzzle& puzzleMat) void solve(vector<LogEntry>& log, vector<Part*>& p_Box, Puzzle& puzzleMat)
{ {
puzzleMat.dp->getNextAbstractionLayer(log.back().myCoor,log.back().abstractionLevel); //sets in abstractionLevel puzzleMat.dp.getNextAbstractionLayer(log.back().myCoor,log.back().abstractionLevel); //sets in abstractionLevel
//status(log,p_Box,puzzleMat); //status(log,p_Box,puzzleMat);
switch(log.back().abstractionLevel) switch(log.back().abstractionLevel)
{ {

View File

@ -50,7 +50,7 @@ public:
coor getSizeAsCoor() coor getSizeAsCoor()
{return {cols,rows};} {return {cols,rows};}
DestructionPower* dp; DestructionPower dp;
AbstractionLayer_1 a1; AbstractionLayer_1 a1;
void removeConstrains(coor removeCoordinates); void removeConstrains(coor removeCoordinates);