|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.cilib.games.game.Game<ListGameState> net.sourceforge.cilib.games.game.predatorprey.PredatorPreyGame
public class PredatorPreyGame
Field Summary |
---|
Fields inherited from class net.sourceforge.cilib.games.game.Game |
---|
agentMeasurement, currentPlayer, players |
Constructor Summary | |
---|---|
PredatorPreyGame()
|
|
PredatorPreyGame(PredatorPreyGame other)
|
|
PredatorPreyGame(PredatorPreyGame other,
ListGameState newState)
|
Method Summary | |
---|---|
void |
display()
Print the game to the console, is useful during testing. |
boolean |
gameOver()
check if the game should terminate |
int |
getBoardHeight()
|
int |
getBoardWidth()
|
PredatorPreyGame |
getClone()
Create a cloned copy of the current object and return it. |
PredatorPreyGame |
getClone(ListGameState newState)
Get a clone with the given GameState This method should typically be used by the StateTraversalStrategy and Agent with regards to decision making when playing the game. |
AbstractGameResult |
getGameResult()
Get the result of the game (Win/Lose/Draw) |
PredPreyPositionInitializationStrategy |
getInitializationStrategy()
|
int |
getMaxIterations()
|
void |
initializeGame()
perform any game specific initialization |
void |
movePlayer(int playerID,
int x,
int y)
Move a specified player |
void |
setBoardHeight(int boardHeight)
|
void |
setBoardWidth(int boardWidth)
|
void |
setInitializationStrategy(PredPreyPositionInitializationStrategy initializationStrategy)
|
void |
setMaxIterations(int maxIterations)
|
Methods inherited from class net.sourceforge.cilib.games.game.Game |
---|
addMeasurement, assignPlayerScore, clearMeasurementData, clearMeasurements, getAgentMeasurements, getCurrentIteration, getCurrentPlayer, getCurrentState, getDecisionState, getDomainForPlayer, getNextPlayerID, getPlayer, getPlayerCount, getPlayerIDList, getPlayerScore, getScoringStrategy, initializeAgent, playGame, playGame, setAgent, setAgent, setCurrentGameState, setCurrentPlayer, setEntityScore, setScoringStrategy, setSeedingStrategy, setStartPlayer |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PredatorPreyGame()
public PredatorPreyGame(PredatorPreyGame other)
public PredatorPreyGame(PredatorPreyGame other, ListGameState newState)
Method Detail |
---|
public void movePlayer(int playerID, int x, int y)
playerID
- the player to movex
- the amount to move on the X axesy
- the amount to move on the Y axespublic boolean gameOver()
gameOver
in class Game<ListGameState>
public PredatorPreyGame getClone()
getClone
in interface Cloneable
getClone
in class Game<ListGameState>
Object.clone()
public PredatorPreyGame getClone(ListGameState newState)
getClone
in class Game<ListGameState>
newState
- the new sate to use
public AbstractGameResult getGameResult()
getGameResult
in class Game<ListGameState>
public void initializeGame()
initializeGame
in class Game<ListGameState>
public void display()
display
in class Game<ListGameState>
public int getBoardHeight()
public void setBoardHeight(int boardHeight)
public int getBoardWidth()
public void setBoardWidth(int boardWidth)
public int getMaxIterations()
public void setMaxIterations(int maxIterations)
public void setInitializationStrategy(PredPreyPositionInitializationStrategy initializationStrategy)
public PredPreyPositionInitializationStrategy getInitializationStrategy()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |