diff --git a/Source/functions/AbstractionLayers/DestructionPower/DestructionPower.cpp b/Source/functions/AbstractionLayers/DestructionPower/DestructionPower.cpp index ab865c1..9fb4998 100644 --- a/Source/functions/AbstractionLayers/DestructionPower/DestructionPower.cpp +++ b/Source/functions/AbstractionLayers/DestructionPower/DestructionPower.cpp @@ -5,9 +5,11 @@ #include "DestructionPower.h" //TODO! Add more layers here! + +//sets relations of speed for the different layers map DestructionPower_Properties::SpeedTable = { - {1,0.001} + {0,0.99} }; @@ -53,7 +55,7 @@ void DestructionPower::DestructionOfSurrounding(const coor constraintCoordinate) m_constraintMatrix[constraintCoordinate.col][constraintCoordinate.row].DestructionArray[i] /=divisor; else //create default destructionPower //TODO find some better solution for default - m_constraintMatrix[constraintCoordinate.col][constraintCoordinate.row].DestructionArray[i] =1-m_constraintMatrix[constraintCoordinate.col][constraintCoordinate.row].SpeedTable[i+1]; + m_constraintMatrix[constraintCoordinate.col][constraintCoordinate.row].DestructionArray[i] =1-m_constraintMatrix[constraintCoordinate.col][constraintCoordinate.row].SpeedTable[i]; } } diff --git a/Source/functions/solve/structure.cpp b/Source/functions/solve/structure.cpp index 8a21627..0562f10 100755 --- a/Source/functions/solve/structure.cpp +++ b/Source/functions/solve/structure.cpp @@ -96,7 +96,7 @@ void setsolution(vector& log, Puzzle& puzzleMat) { //advance number of randomed part count if(log.back().PieceCollector.size()>1) log.back().advanceRandomed(); - + //'set=true' all 4 rotations of pieces in puzzleBox for(int i=0;iGetPartID()==log.back().PieceCollector.begin()->second->GetPartID()) @@ -152,7 +152,7 @@ bool backtrack(vector& log, Puzzle& puzzleMat) void calculateTrueDestructionPower(vector& log, Puzzle& puzzleMat, float Layerworth) { float destructionPower = sqrt( - Layerworth * puzzleMat.dp.m_constraintMatrix[0][0].SpeedTable[log.back().abstractionLevel+1]); + Layerworth * puzzleMat.dp.m_constraintMatrix[0][0].SpeedTable[log.back().abstractionLevel]); //save destructionArray for when coor is done if(puzzleMat.tmp_destructionArray.empty()) @@ -232,13 +232,13 @@ bool SetBestOrMoreLayersArithmetical(vector& log, qualityVector& cqVec } else { - switch(log.back().abstractionLevel+1) + switch(log.back().abstractionLevel) { - case 1: threshold = 0.90; break; - case 2: threshold = 0.80; break; - case 3: threshold = 0.75; break; - case 4: threshold = 0.66; break; - case 5: threshold = 0.60; break; + case 0: threshold = 0.90; break; + case 1: threshold = 0.80; break; + case 2: threshold = 0.75; break; + case 3: threshold = 0.66; break; + case 4: threshold = 0.60; break; default: threshold = 0.5; break; } diff --git a/Source/main.cpp b/Source/main.cpp index 3472ac5..3ef636d 100644 --- a/Source/main.cpp +++ b/Source/main.cpp @@ -5,7 +5,7 @@ int LogEntry::randomed(0); int main() { - unsigned int cols=9,rows=8; + unsigned int cols=4,rows=5; vector log; Puzzle puzzleMat(cols, rows);