org.vizzini.example.pong
Class ComputerAgent
java.lang.Object
org.vizzini.game.AbstractAgent
org.vizzini.game.AbstractComputerAgent
org.vizzini.example.pong.ComputerAgent
- All Implemented Interfaces:
- Serializable, IActionReceivedProducer, IStateListener, IAgent, IComputerAgent, IListener
public class ComputerAgent
- extends AbstractComputerAgent
- implements IActionReceivedProducer, IStateListener
Provides a computer agent for Pong. This agent simply tracks the Y position
of the ball.
- Since:
- v0.1
- Version:
- v0.2
- Author:
- Jeffrey M. Thompson
- See Also:
- Serialized Form
Methods inherited from class org.vizzini.game.AbstractComputerAgent |
addBusyListener, configure, evaluate, getActionGenerator, getBusyManager, getEvaluator, isBusy, removeBusyListener, setActionGenerator, setBusy, setEvaluator |
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 interface org.vizzini.game.IAgent |
addConcedeListener, addPropertyChangeListener, addScoreListener, addToScore, concede, getName, getScore, getTeam, getTokenCollection, incrementScore, removeConcedeListener, removePropertyChangeListener, removeScoreListener, reset, setName, setScore, setTeam |
ComputerAgent
public ComputerAgent()
addActionReceivedListener
public void addActionReceivedListener(IActionReceivedListener listener)
- Add the given listener.
- Specified by:
addActionReceivedListener
in interface IActionReceivedProducer
- Since:
- v0.1
getAction
public IAction getAction(IEnvironment environment,
IAdjudicator adjudicator)
- Return the action determined through consideration of the given
environment using the given adjudicator.
- Specified by:
getAction
in interface IAgent
- Parameters:
environment
- The current environment.adjudicator
- Adjudicator for determining legal actions.- Since:
- v0.1
removeActionReceivedListener
public void removeActionReceivedListener(IActionReceivedListener listener)
- Remove the given listener.
- Specified by:
removeActionReceivedListener
in interface IActionReceivedProducer
- Since:
- v0.1
stateChange
public void stateChange(StateEvent event)
- Respond to state change events. This method creates a action to move the
paddle toward the ball.
- Specified by:
stateChange
in interface IStateListener
- Since:
- v0.1
getActionReceivedManager
protected ActionReceivedManager getActionReceivedManager()
- Return the busy manager.
- Since:
- v0.1
Copyright © 2007 Vizzini.org. All Rights Reserved.
|
2007.12.25.03.00.02 |