Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool GameBoard::CompareHTable(int first, int second)
- {
- bool compare; // state of the predicate
- // if the heuristic values are equivalent
- if( hTable_[first] == hTable_[second] )
- {
- // if the distance is greater than or the same
- if( dTable_[first] >= dTable_[second] )
- compare = true; // then this one comes first
- else // otherwise
- compare = false; // first doesnt belong here
- }
- // otherwise if the heuristic value is lower
- else if( hTable_[first] < hTable_[second] )
- compare = true; // then choose this one
- else // otherwise
- compare = false; // choose second to come first
- return compare; // return the decision of the predicate
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement