|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IAgent
Defines methods required by agents in the game framework. An agent instance encapsulates the logic an agent uses to create actions. Examples of this logic are simple coding, a minimax algorithm, or neural network based.
Field Summary | |
---|---|
static String |
NAME_PROPERTY
Name property name. |
static String |
TEAM_PROPERTY
Team property name. |
Method Summary | |
---|---|
void |
addConcedeListener(IConcedeListener listener)
Add the given listener. |
void |
addPropertyChangeListener(String propertyName,
PropertyChangeListener listener)
Add a PropertyChangeListener for a specific property. |
void |
addScoreListener(IScoreListener listener)
Add the given listener. |
void |
addToScore(long value)
Add the given value to the score. |
void |
concede()
Concede the game. |
void |
configure(Properties properties,
int index)
Configure this agent. |
IAction |
getAction(IEnvironment environment,
IAdjudicator adjudicator)
Return the action determined through consideration of the given environment using the given adjudicator. |
String |
getName()
Return this agent's name. |
long |
getScore()
Return the current score. |
ITeam |
getTeam()
Return this agent's team. |
ITokenCollection |
getTokenCollection()
Return the token collection. |
void |
incrementScore()
Increment the score. |
void |
removeConcedeListener(IConcedeListener listener)
Remove the given listener. |
void |
removePropertyChangeListener(String propertyName,
PropertyChangeListener listener)
Remove a PropertyChangeListener for a specific property. |
void |
removeScoreListener(IScoreListener listener)
Remove the given listener. |
void |
reset()
Reset to the initial state. |
void |
setName(String name)
Set the name to the given name. |
void |
setScore(long score)
Set the score to the given value. |
void |
setTeam(ITeam team)
Set the associated team. |
Field Detail |
---|
static final String NAME_PROPERTY
static final String TEAM_PROPERTY
Method Detail |
---|
IAction getAction(IEnvironment environment, IAdjudicator adjudicator)
environment
- The current environment.adjudicator
- Adjudicator for determining legal actions.void setName(String name)
name
- The new name.String getName()
void setScore(long score)
score
- The new score.long getScore()
void setTeam(ITeam team)
team
- The associated team.ITeam getTeam()
ITokenCollection getTokenCollection()
void addConcedeListener(IConcedeListener listener)
void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)
PropertyChangeListener
for a specific property. The
listener will be invoked only when a call on
firePropertyChange
names that specific property.
propertyName
- The name of the property to listen on.listener
- The PropertyChangeListener
to be added.void addScoreListener(IScoreListener listener)
void addToScore(long value)
value
- The value to add.void concede()
void configure(Properties properties, int index) throws InstantiationException, IllegalAccessException
InstantiationException
IllegalAccessException
void incrementScore()
void removeConcedeListener(IConcedeListener listener)
void removePropertyChangeListener(String propertyName, PropertyChangeListener listener)
PropertyChangeListener
for a specific property.
propertyName
- The name of the property that was listened on.listener
- The PropertyChangeListener
to be removed.void removeScoreListener(IScoreListener listener)
void reset()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2007 Vizzini.org. All Rights Reserved. | 2007.12.25.03.00.02 |