RM: aging, minor edits
aging erhöht, damit histo aufgerufen wird. histo layer matrix position verändert, damit die stimmt histo.image daten sind momentan immer NULL -> error bei Aufruf
This commit is contained in:
@ -40,6 +40,7 @@ bool DestructionPower::RemoveConstraintOnPosition(const coor constraintCoordinat
|
||||
void DestructionPower::DestructionOfSurrounding(const coor constraintCoordinate) {
|
||||
|
||||
for (int i = 0; i < DESTRUCTION_COUNT; ++i) {
|
||||
|
||||
m_constraintMatrix[constraintCoordinate.col][constraintCoordinate.row].DestructionArray.push_back(0);
|
||||
int divisor=0;
|
||||
if(constraintCoordinate.row > 0)
|
||||
@ -57,6 +58,9 @@ void DestructionPower::DestructionOfSurrounding(const coor constraintCoordinate)
|
||||
else
|
||||
//create default destructionPower //TODO find some better solution for default
|
||||
m_constraintMatrix[constraintCoordinate.col][constraintCoordinate.row].DestructionArray[i] = m_constraintMatrix[constraintCoordinate.col][constraintCoordinate.row].SpeedTable[i];
|
||||
//aging
|
||||
if(m_constraintMatrix[constraintCoordinate.col][constraintCoordinate.row].DestructionArray[i]<0.9)
|
||||
m_constraintMatrix[constraintCoordinate.col][constraintCoordinate.row].DestructionArray[i]=m_constraintMatrix[constraintCoordinate.col][constraintCoordinate.row].DestructionArray[i]*(float)1.001+(float)0.01;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -105,23 +105,21 @@ bool AbstractionLayer_Histogram::PlaceOfPartGood(coor myCoor, Mat& myPart)
|
||||
|
||||
HistogramComparer localComparer;
|
||||
//sets coordinates to correct position for layer
|
||||
myCoor.row++;
|
||||
myCoor.col++;
|
||||
|
||||
if( myCoor.row == 1 && myCoor.col == 1){return true;}
|
||||
else if(myCoor.col == 1 && myCoor.row >1){
|
||||
if( myCoor.row == 0 && myCoor.col == 0){return true;}
|
||||
else if(myCoor.col == 0 && myCoor.row >0){
|
||||
if(localComparer.CompareHistogram(m_constraintMatrix[myCoor.col][myCoor.row-1].image, myPart)){
|
||||
return true;
|
||||
}
|
||||
else return false;
|
||||
}
|
||||
else if( myCoor.row == 1 && myCoor.col >1){
|
||||
else if( myCoor.row == 0 && myCoor.col >0){
|
||||
if(localComparer.CompareHistogram(m_constraintMatrix[myCoor.col-1][myCoor.row].image, myPart)){
|
||||
return true;
|
||||
}
|
||||
else return false;
|
||||
}
|
||||
else if (myCoor.col > 1 && myCoor.row >1){
|
||||
else if (myCoor.col > 0 && myCoor.row >0){
|
||||
if( localComparer.CompareHistogram(m_constraintMatrix[myCoor.col][myCoor.row-1].image, myPart) &&
|
||||
localComparer.CompareHistogram(m_constraintMatrix[myCoor.col-1][myCoor.row].image, myPart)){
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user