net.sourceforge.cilib.games.agent
Class Agent

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

public abstract class Agent
extends Object
implements Cloneable

This class represents a game playing agent.

Author:
leo
See Also:
Serialized Form

Field Summary
protected  Fitness agentScore
           
protected  Enum<?> agentToken
           
protected  int playerID
           
 
Constructor Summary
Agent()
           
Agent(Agent other)
           
 
Method Summary
abstract  DomainRegistry getAgentDomain()
          Get the domain the agent's solution is represented by
 Fitness getAgentScore()
           
 Enum<?> getAgentToken()
           
abstract  Agent getClone()
          Create a cloned copy of the current object and return it.
 int getPlayerID()
           
abstract  void initializeAgent(Type agentData)
          Initialize the agent with the contents of an entity.
abstract  void move(Game<GameState> game)
          Alter the current game by making a decision.
 void setAgentScore(Fitness agentScore)
           
 void setAgentToken(Enum<?> agentToken)
           
 void setAgentToken(String agentToken)
          Creates an enum based on the string, enum has to be inside the GameToken enum class, and cannot be another nested enum.
 void setPlayerID(int playerID)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

playerID

protected int playerID

agentScore

protected Fitness agentScore

agentToken

protected Enum<?> agentToken
Constructor Detail

Agent

public Agent()

Agent

public Agent(Agent other)
Method Detail

getPlayerID

public int getPlayerID()

setPlayerID

public void setPlayerID(int playerID)

initializeAgent

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

Parameters:
agentData - the data to initialize the agent with

getClone

public abstract 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
Returns:
An exact clone of the current object instance.
See Also:
Object.clone()

move

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

Parameters:
game - the game state

getAgentDomain

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

Returns:
the relevant DomainRegistry

getAgentScore

public Fitness getAgentScore()

setAgentScore

public void setAgentScore(Fitness agentScore)

getAgentToken

public Enum<?> getAgentToken()

setAgentToken

public void setAgentToken(Enum<?> agentToken)

setAgentToken

public void setAgentToken(String agentToken)
Creates an enum based on the string, enum has to be inside the GameToken enum class, and cannot be another nested enum. NOTE: Could refactor this into the XML creation stuff if neccesary

Parameters:
agentToken - the string representation of the enum


Copyright © 2009 CIRG. All Rights Reserved.