Changed dp calculation
This commit is contained in:
@ -46,6 +46,8 @@ bool AbstractionLayer_1::PreProcessing(coor mySize, const vector<Part*>* partAr
|
||||
//it through qualityVector and removes all that do not trigger PlaceOfPartGood
|
||||
bool AbstractionLayer_1::EvaluateQuality (const coor constraintCoordinate, qualityVector& qVector)
|
||||
{
|
||||
if(constraintCoordinate.row==23 && constraintCoordinate.col==35)
|
||||
cout << "in" << endl;
|
||||
//evaluateQuality = evaluateProbabilaty
|
||||
for(int i = 0;i<qVector.size();i++)
|
||||
{
|
||||
@ -69,6 +71,20 @@ bool AbstractionLayer_1::RemoveConstraintOnPosition(const coor constraintCoordin
|
||||
m_constraintMatrix[constraintCoordinate.col+1][constraintCoordinate.row+1].m_connections=0b11111111;
|
||||
}
|
||||
|
||||
int AbstractionLayer_1::RemoveSimilar(qualityVector& qVector,uint8_t& constraints)
|
||||
{
|
||||
//
|
||||
for(int i=0;i<qVector.size();)
|
||||
{
|
||||
if(qVector[i].second->m_a1.m_connections==constraints)
|
||||
qVector.erase(qVector.begin()+i);
|
||||
else
|
||||
i++;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void AbstractionLayer_1::CreateRandomPuzzle()
|
||||
{
|
||||
std::minstd_rand simple_rand;
|
||||
@ -182,7 +198,11 @@ bool AbstractionLayer_1::PlaceOfPartGood(coor myCoor, uint8_t& myPart)
|
||||
|| ((((negativePart & 0b00000011) == 0b00000011) || ((myPart & 0b00000011) == 0b00000011)) && (((myPart & 0b00000011) != 0b00000000) && (negativePart & 0b00000011) != 0b00000000))
|
||||
|| (((negativePart & 0b00000011) == 0b00000000) && ((myPart & 0b00000011) == 0b00000000)) )
|
||||
)
|
||||
{
|
||||
if(myCoor.row==18 && myCoor.col==35)
|
||||
cout << "gud: " << std::bitset<8>(myPart) << endl;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
}
|
||||
|
@ -49,6 +49,8 @@ public:
|
||||
bool EvaluateQuality ( coor constraintCoordinate, qualityVector& qVector)override;
|
||||
bool SetConstraintOnPosition( coor constraintCoordinate, AbstractionLayer_1_Properties constraint)override;
|
||||
bool RemoveConstraintOnPosition( coor constraintCoordinate)override;
|
||||
int RemoveSimilar(qualityVector&,uint8_t&);
|
||||
|
||||
bool PlaceOfPartGood(coor myCoor, uint8_t& myPart);
|
||||
void shift(uint8_t& Part, int shifts);
|
||||
void setEdgeZero();
|
||||
|
Reference in New Issue
Block a user