aima.core.environment.eightpuzzle.EightPuzzleGoalTest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aima-core Show documentation
Show all versions of aima-core Show documentation
AIMA-Java Core Algorithms from the book Artificial Intelligence a Modern Approach 3rd Ed.
The newest version!
package aima.core.environment.eightpuzzle;
import aima.core.search.framework.problem.GoalTest;
/**
* @author Ravi Mohan
*
*/
public class EightPuzzleGoalTest implements GoalTest {
EightPuzzleBoard goal = new EightPuzzleBoard(new int[] { 0, 1, 2, 3, 4, 5,
6, 7, 8 });
public boolean isGoalState(Object state) {
EightPuzzleBoard board = (EightPuzzleBoard) state;
return board.equals(goal);
}
}