org.vizzini.game
Class AbstractComputerAgent

java.lang.Object
  extended by org.vizzini.game.AbstractAgent
      extended by org.vizzini.game.AbstractComputerAgent
All Implemented Interfaces:
Serializable, IAgent, IComputerAgent
Direct Known Subclasses:
AbstractChessComputerAgent, AbstractSimpleAgent, ComputerAgent, EvaluatedPlacementAgent, SearchAgent, SimpleComputerAgent

public abstract class AbstractComputerAgent
extends AbstractAgent
implements IComputerAgent

Provides base functionality for computer agents in the game framework. A computer agent instance encapsulates the logic a computer agent uses to create actions. Examples of this logic are simple coding, a minimax algorithm, or neural network based.

Since:
v0.1
Version:
v0.3
Author:
Jeffrey M. Thompson
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.vizzini.game.IAgent
NAME_PROPERTY, TEAM_PROPERTY
 
Constructor Summary
AbstractComputerAgent()
           
 
Method Summary
 void addBusyListener(IBusyListener listener)
          Add the given listener.
 void configure(Properties properties, int index)
          Configure this agent.
 int evaluate(IEnvironment environment, IAdjudicator adjudicator)
          Evaluate the given environment for fitness from the perspective of this agent.
 IActionGenerator getActionGenerator()
          Return the action generator.
protected  BusyManager getBusyManager()
          Return the busy manager.
 IEvaluator getEvaluator()
          Return the evaluator.
 boolean isBusy()
          Return true if this is busy.
 void removeBusyListener(IBusyListener listener)
          Remove the given listener.
protected  void setActionGenerator(IActionGenerator actionGenerator)
          Set the action generator.
protected  void setBusy(boolean isBusy)
          Set the busy flag with the given value.
protected  void setEvaluator(IEvaluator evaluator)
          Set the evaluator.
 
Methods inherited from class org.vizzini.game.AbstractAgent
addConcedeListener, addPropertyChangeListener, addScoreListener, addToScore, concede, equals, getConcedeManager, getIndex, getName, getProperties, getPropertyChangeManager, getScore, getScoreManager, getTeam, getTokenCollection, getTokenCollectionClass, hashCode, incrementScore, removeConcedeListener, removePropertyChangeListener, removeScoreListener, reset, setName, setScore, setTeam, setTokenCollectionClass, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.vizzini.game.IAgent
addConcedeListener, addPropertyChangeListener, addScoreListener, addToScore, concede, getAction, getName, getScore, getTeam, getTokenCollection, incrementScore, removeConcedeListener, removePropertyChangeListener, removeScoreListener, reset, setName, setScore, setTeam
 

Constructor Detail

AbstractComputerAgent

public AbstractComputerAgent()
Method Detail

addBusyListener

public void addBusyListener(IBusyListener listener)
Add the given listener.

Specified by:
addBusyListener in interface IComputerAgent
Since:
v0.1

configure

public void configure(Properties properties,
                      int index)
               throws InstantiationException,
                      IllegalAccessException
Configure this agent.

Specified by:
configure in interface IAgent
Overrides:
configure in class AbstractAgent
Throws:
InstantiationException
IllegalAccessException
Since:
v0.2

evaluate

public int evaluate(IEnvironment environment,
                    IAdjudicator adjudicator)
Evaluate the given environment for fitness from the perspective of this agent.

Specified by:
evaluate in interface IComputerAgent
Parameters:
environment - Environment to evaluate.
adjudicator - Adjudicator.
Since:
v0.1

getActionGenerator

public IActionGenerator getActionGenerator()
Return the action generator.

Specified by:
getActionGenerator in interface IComputerAgent
Since:
v0.2

getEvaluator

public IEvaluator getEvaluator()
Return the evaluator.

Specified by:
getEvaluator in interface IComputerAgent
Since:
v0.1

isBusy

public boolean isBusy()
Return true if this is busy.

Specified by:
isBusy in interface IComputerAgent
Since:
v0.1

removeBusyListener

public void removeBusyListener(IBusyListener listener)
Remove the given listener.

Specified by:
removeBusyListener in interface IComputerAgent
Since:
v0.1

getBusyManager

protected BusyManager getBusyManager()
Return the busy manager.

Since:
v0.1

setActionGenerator

protected void setActionGenerator(IActionGenerator actionGenerator)
Set the action generator.

Since:
v0.2

setBusy

protected void setBusy(boolean isBusy)
Set the busy flag with the given value. Fires a busy change.

Since:
v0.1

setEvaluator

protected void setEvaluator(IEvaluator evaluator)
Set the evaluator.

Since:
v0.1


Copyright 2007 Vizzini.org. All Rights Reserved. 2007.12.25.03.00.02