|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.vizzini.game.AbstractAgent
public abstract class AbstractAgent
Provides base functionality for 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 |
|---|
| Fields inherited from interface org.vizzini.game.IAgent |
|---|
NAME_PROPERTY, TEAM_PROPERTY |
| Constructor Summary | |
|---|---|
AbstractAgent()
|
|
| 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. |
boolean |
equals(Object object)
Return true if the given object is equal to this. |
protected ConcedeManager |
getConcedeManager()
Return the concede manager. |
protected int |
getIndex()
|
String |
getName()
Return this agent's name. |
protected Properties |
getProperties()
|
protected PropertyChangeManager |
getPropertyChangeManager()
Return the property change manager. |
long |
getScore()
Return the current score. |
protected ScoreManager |
getScoreManager()
Return the score manager. |
ITeam |
getTeam()
Return this agent's team. |
ITokenCollection |
getTokenCollection()
Return the token collection. |
protected Class |
getTokenCollectionClass()
|
int |
hashCode()
Returns a hash code value for the object. |
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. |
protected void |
setTokenCollectionClass(Class tokenCollectionClass)
|
String |
toString()
Return a string representation of this object. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.vizzini.game.IAgent |
|---|
getAction |
| Constructor Detail |
|---|
public AbstractAgent()
| Method Detail |
|---|
public void addConcedeListener(IConcedeListener listener)
addConcedeListener in interface IAgent
public 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.
addPropertyChangeListener in interface IAgentpropertyName - The name of the property to listen on.listener - The PropertyChangeListener to be
added.public void addScoreListener(IScoreListener listener)
addScoreListener in interface IAgentpublic void addToScore(long value)
addToScore in interface IAgentvalue - The value to add.public void concede()
concede in interface IAgent
public void configure(Properties properties,
int index)
throws InstantiationException,
IllegalAccessException
configure in interface IAgentInstantiationException
IllegalAccessExceptionpublic boolean equals(Object object)
equals in class Objectobject - The object to compare.public String getName()
getName in interface IAgentpublic long getScore()
getScore in interface IAgentpublic ITeam getTeam()
getTeam in interface IAgentpublic ITokenCollection getTokenCollection()
getTokenCollection in interface IAgentpublic int hashCode()
hashCode in class Objectpublic void incrementScore()
incrementScore in interface IAgentpublic void removeConcedeListener(IConcedeListener listener)
removeConcedeListener in interface IAgent
public void removePropertyChangeListener(String propertyName,
PropertyChangeListener listener)
PropertyChangeListener for a specific property.
removePropertyChangeListener in interface IAgentpropertyName - The name of the property that was listened on.listener - The PropertyChangeListener to be
removed.public void removeScoreListener(IScoreListener listener)
removeScoreListener in interface IAgentpublic void reset()
reset in interface IAgentpublic void setName(String name)
setName in interface IAgentname - The new name.public void setScore(long score)
setScore in interface IAgentscore - The new score.public void setTeam(ITeam team)
setTeam in interface IAgentteam - The associated team.public String toString()
toString in class Objectprotected ConcedeManager getConcedeManager()
protected int getIndex()
protected Properties getProperties()
protected PropertyChangeManager getPropertyChangeManager()
protected ScoreManager getScoreManager()
protected Class getTokenCollectionClass()
protected void setTokenCollectionClass(Class tokenCollectionClass)
tokenCollectionClass - The tokenCollectionClass to set.
|
||||||||||
| 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 |