net.sourceforge.cilib.games.game.predatorprey
Class RealTimePredatorPreyGame

java.lang.Object
  extended by net.sourceforge.cilib.games.game.Game<ListGameState>
      extended by net.sourceforge.cilib.games.game.predatorprey.PredatorPreyGame
          extended by net.sourceforge.cilib.games.game.predatorprey.RealTimePredatorPreyGame
All Implemented Interfaces:
Serializable, RealTimeGame, Cloneable

public class RealTimePredatorPreyGame
extends PredatorPreyGame
implements RealTimeGame

Author:
leo This is an implimentation of the Predator Prey game where the Predator and PRey agents make their movements simultaneously instead of turn based. Therefore they each make a movement decision on the same state of the game, and they are both moved at the same time.
See Also:
Serialized Form

Field Summary
 
Fields inherited from class net.sourceforge.cilib.games.game.Game
agentMeasurement, currentPlayer, players
 
Constructor Summary
RealTimePredatorPreyGame()
           
RealTimePredatorPreyGame(RealTimePredatorPreyGame other)
           
RealTimePredatorPreyGame(RealTimePredatorPreyGame other, ListGameState newstate)
           
 
Method Summary
 RealTimePredatorPreyGame getClone()
          Create a cloned copy of the current object and return it.
 RealTimePredatorPreyGame 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.
 ListGameState getDecisionState()
          Returns the state of the game that the agent needs to make a decision.
 void recordRoundStartState()
          Record the state of the game at the start of the round
 
Methods inherited from class net.sourceforge.cilib.games.game.predatorprey.PredatorPreyGame
display, gameOver, getBoardHeight, getBoardWidth, getGameResult, getInitializationStrategy, getMaxIterations, initializeGame, movePlayer, setBoardHeight, setBoardWidth, setInitializationStrategy, setMaxIterations
 
Methods inherited from class net.sourceforge.cilib.games.game.Game
addMeasurement, assignPlayerScore, clearMeasurementData, clearMeasurements, getAgentMeasurements, getCurrentIteration, getCurrentPlayer, getCurrentState, 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

RealTimePredatorPreyGame

public RealTimePredatorPreyGame()

RealTimePredatorPreyGame

public RealTimePredatorPreyGame(RealTimePredatorPreyGame other)

RealTimePredatorPreyGame

public RealTimePredatorPreyGame(RealTimePredatorPreyGame other,
                                ListGameState newstate)
Method Detail

recordRoundStartState

public void recordRoundStartState()
Record the state of the game at the start of the round

Specified by:
recordRoundStartState in interface RealTimeGame

getDecisionState

public ListGameState getDecisionState()
Returns the state of the game that the agent needs to make a decision. This implies that the state the agent receives isn't necceseraly the entire game state as it is at that point in time. This method can be overwritten to introduce noise or imperfect player information.

Overrides:
getDecisionState in class Game<ListGameState>
Returns:
default returns the current game state, override to return other state

getClone

public RealTimePredatorPreyGame getClone()
Create a cloned copy of the current object and return it. In general the created copy will be a deep copy of the provided instance. As a result this operation an be quite expensive if used incorrectly.

Specified by:
getClone in interface Cloneable
Overrides:
getClone in class PredatorPreyGame
Returns:
An exact clone of the current object instance.
See Also:
Object.clone()

getClone

public RealTimePredatorPreyGame 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. Since this process includes making alot of copies of the game a seperate, faster, method is neccesary that does not waste time by making unneccesary copies of the game state and player logic.

Overrides:
getClone in class PredatorPreyGame
Parameters:
newState - the new sate to use
Returns:
the copy


Copyright © 2009 CIRG. All Rights Reserved.