Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private int manhattanDistancePlusReversalPenalty(PuzzleState goal) {
- int distance = manhattanDistance(goal);
- for (int i = 0; i <= 7; ++i) {
- for (int j = i + 1; j <= 7; ++j) {
- if (board[i] == goal.board[j] && board[j] == goal.board[i]) distance += 2;
- }
- }
- return distance;
- }
Add Comment
Please, Sign In to add comment