aima.search.nqueens
Class NQueensBoard
java.lang.Object
aima.search.nqueens.NQueensBoard
public class NQueensBoard
- extends java.lang.Object
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
NQueensBoard
public NQueensBoard(int n)
addQueenAt
public void addQueenAt(XYLocation l)
removeQueenFrom
public void removeQueenFrom(XYLocation l)
queenExistsAt
public boolean queenExistsAt(XYLocation l)
moveQueen
public void moveQueen(XYLocation from,
XYLocation to)
clear
public void clear()
setBoard
public void setBoard(java.util.List<XYLocation> al)
getNumberOfQueensOnBoard
public int getNumberOfQueensOnBoard()
getQueenPositions
public java.util.List<XYLocation> getQueenPositions()
isSquareUnderAttack
public boolean isSquareUnderAttack(XYLocation l)
getSize
public int getSize()
print
public void print()
getBoardPic
public java.lang.String getBoardPic()
getNumberOfAttacksOn
public int getNumberOfAttacksOn(XYLocation l)
hashCode
public int hashCode()
- Overrides:
hashCode
in class java.lang.Object
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in class java.lang.Object
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object