|
Algorithm Development Kit 1.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IGameState
A valid representation of the state of a particular game with two players.
A game state is either in progress, has been won by a player, or is a draw.
For ease of debugging, each state has a reference counter that is incremented when a new state is computed via a move and never decremented. It can thus be used as a unique id when referencing states in the game tree later.
To support graphical drawing of state searches, this interface extends IGraphEntity.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface algs.debug.IGraphEntity |
---|
IGraphEntity.Formatter |
Method Summary | |
---|---|
IGameState |
copy()
Enable one to grab a copy of this game state. |
int |
counter()
Debugging interface for retrieving counter. |
boolean |
equivalent(IGameState state)
Determine if this game state is equivalent to the given state. |
void |
incrementCounter()
Debugging interface for incrementing count of games. |
boolean |
isDraw()
Determine if this game state is a draw. |
boolean |
isWin()
Determine if this game state has a winner. |
Methods inherited from interface algs.debug.IGraphEntity |
---|
nodeLabel |
Method Detail |
---|
boolean isDraw()
boolean isWin()
IGameState copy()
boolean equivalent(IGameState state)
The notion of equivalence is based upon the actual game. For games that exhibit symmetries in game state (such as board games), you can get great savings simply by reducing symmetrical positions.
Useful when attempting to reduce the search space. This method is
defined separately from Object.equals(Object)
to make sure
there is no confusion with using equals by the JDK collection classes.
state
- The game state being compared against.void incrementCounter()
int counter()
|
Algorithm Development Kit 1.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |