aima.search.eightpuzzle
Class EightPuzzleBoard
java.lang.Object
aima.search.eightpuzzle.EightPuzzleBoard
public class EightPuzzleBoard
- extends java.lang.Object
Field Summary |
static java.lang.String |
DOWN
|
static java.lang.String |
LEFT
|
static java.lang.String |
RIGHT
|
static java.lang.String |
UP
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
LEFT
public static java.lang.String LEFT
RIGHT
public static java.lang.String RIGHT
UP
public static java.lang.String UP
DOWN
public static java.lang.String DOWN
EightPuzzleBoard
public EightPuzzleBoard()
EightPuzzleBoard
public EightPuzzleBoard(int[] aBoard)
getBoard
public int[] getBoard()
getLocationOf
public XYLocation getLocationOf(int val)
getValueAt
public int getValueAt(XYLocation loc)
moveGapRight
public void moveGapRight()
moveGapLeft
public void moveGapLeft()
moveGapDown
public void moveGapDown()
moveGapUp
public void moveGapUp()
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in class java.lang.Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class java.lang.Object
getPositions
public java.util.List<XYLocation> getPositions()
setBoard
public void setBoard(java.util.List<XYLocation> locs)
canMoveGap
public boolean canMoveGap(java.lang.String where)
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object