net.sourceforge.cilib.games.agent
Class RandomAgent

java.lang.Object
  extended by net.sourceforge.cilib.games.agent.Agent
      extended by net.sourceforge.cilib.games.agent.RandomAgent
All Implemented Interfaces:
Serializable, Cloneable

public class RandomAgent
extends Agent

This is an agent that chooses a random state as its decision, it will only work on Game's that impliment StateGame

Author:
leo
See Also:
Serialized Form

Field Summary
 
Fields inherited from class net.sourceforge.cilib.games.agent.Agent
agentScore, agentToken, playerID
 
Constructor Summary
RandomAgent()
           
RandomAgent(Agent other)
          Copy constructor
 
Method Summary
 DomainRegistry getAgentDomain()
          Get the domain the agent's solution is represented by
 Agent getClone()
          Create a cloned copy of the current object and return it.
 void initializeAgent(Type agentData)
          Initialize the agent with the contents of an entity.
 void move(Game<GameState> game)
          Alter the current game by making a decision.
 
Methods inherited from class net.sourceforge.cilib.games.agent.Agent
getAgentScore, getAgentToken, getPlayerID, setAgentScore, setAgentToken, setAgentToken, setPlayerID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RandomAgent

public RandomAgent()

RandomAgent

public RandomAgent(Agent other)
Copy constructor

Parameters:
other -
Method Detail

getAgentDomain

public DomainRegistry getAgentDomain()
Get the domain the agent's solution is represented by

Specified by:
getAgentDomain in class Agent
Returns:
the relevant DomainRegistry

getClone

public Agent 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
Specified by:
getClone in class Agent
Returns:
An exact clone of the current object instance.
See Also:
Object.clone()

initializeAgent

public void initializeAgent(Type agentData)
Initialize the agent with the contents of an entity. This data should represent what the

Specified by:
initializeAgent in class Agent
Parameters:
agentData - the data to initialize the agent with

move

public void move(Game<GameState> game)
Alter the current game by making a decision.

Specified by:
move in class Agent
Parameters:
game - the game state


Copyright © 2009 CIRG. All Rights Reserved.