org.vizzini.game
Interface IAgent

All Superinterfaces:
Serializable
All Known Subinterfaces:
IChessAgent, IComputerAgent, IHumanAgent, ISearchAgent
All Known Implementing Classes:
AbstractAgent, AbstractChessComputerAgent, AbstractComputerAgent, AbstractHumanAgent, AbstractSimpleAgent, ComputerAgent, DefaultAgent, EvaluatedPlacementAgent, MouseAgent, MouseHumanAgent, MouseHumanAgent, MovementMouseAgent, MovementTextAgent, PlacementMouseAgent, PlacementTextAgent, SearchAgent, SearchChessAgent, SimpleChessAgent, SimpleComputerAgent, SimplePlacementAgent, TextAgent, TextAgent, TextHumanAgent

public interface IAgent
extends Serializable

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.

Since:
v0.1
Version:
v0.2
Author:
Jeffrey M. Thompson

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

NAME_PROPERTY

static final String NAME_PROPERTY
Name property name.

See Also:
Constant Field Values

TEAM_PROPERTY

static final String TEAM_PROPERTY
Team property name.

See Also:
Constant Field Values
Method Detail

getAction

IAction getAction(IEnvironment environment,
                  IAdjudicator adjudicator)
Return the action determined through consideration of the given environment using the given adjudicator.

Parameters:
environment - The current environment.
adjudicator - Adjudicator for determining legal actions.
Since:
v0.1

setName

void setName(String name)
Set the name to the given name.

Parameters:
name - The new name.
Since:
v0.1

getName

String getName()
Return this agent's name.

Since:
v0.1

setScore

void setScore(long score)
Set the score to the given value.

Parameters:
score - The new score.
Since:
v0.1

getScore

long getScore()
Return the current score.

Since:
v0.1

setTeam

void setTeam(ITeam team)
Set the associated team.

Parameters:
team - The associated team.
Since:
v0.1

getTeam

ITeam getTeam()
Return this agent's team.

Since:
v0.1

getTokenCollection

ITokenCollection getTokenCollection()
Return the token collection.

Since:
v0.1

addConcedeListener

void addConcedeListener(IConcedeListener listener)
Add the given listener.

Since:
v0.1

addPropertyChangeListener

void addPropertyChangeListener(String propertyName,
                               PropertyChangeListener listener)
Add a PropertyChangeListener for a specific property. The listener will be invoked only when a call on firePropertyChange names that specific property.

Parameters:
propertyName - The name of the property to listen on.
listener - The PropertyChangeListener to be added.
Since:
v0.2

addScoreListener

void addScoreListener(IScoreListener listener)
Add the given listener.

Since:
v0.1

addToScore

void addToScore(long value)
Add the given value to the score.

Parameters:
value - The value to add.
Since:
v0.1

concede

void concede()
Concede the game.

Since:
v0.1

configure

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

Throws:
InstantiationException
IllegalAccessException
Since:
v0.1

incrementScore

void incrementScore()
Increment the score.

Since:
v0.1

removeConcedeListener

void removeConcedeListener(IConcedeListener listener)
Remove the given listener.

Since:
v0.1

removePropertyChangeListener

void removePropertyChangeListener(String propertyName,
                                  PropertyChangeListener listener)
Remove a PropertyChangeListener for a specific property.

Parameters:
propertyName - The name of the property that was listened on.
listener - The PropertyChangeListener to be removed.
Since:
v0.2

removeScoreListener

void removeScoreListener(IScoreListener listener)
Remove the given listener.

Since:
v0.1

reset

void reset()
Reset to the initial state.

Since:
v0.1


Copyright © 2007 Vizzini.org. All Rights Reserved. 2007.12.25.03.00.02