org.vizzini.game.search
Class SearchAgent

java.lang.Object
  extended by org.vizzini.game.AbstractAgent
      extended by org.vizzini.game.AbstractComputerAgent
          extended by org.vizzini.game.search.SearchAgent
All Implemented Interfaces:
Serializable, IAgent, IComputerAgent, ISearchAgent
Direct Known Subclasses:
SearchChessAgent

public class SearchAgent
extends AbstractComputerAgent
implements ISearchAgent

Provides a computer agent which uses an AI search algorithm to determine the best action.

Since:
v0.2
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
SearchAgent()
           
 
Method Summary
 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.
 int getDepth()
          Return the search depth.
 int getNodesVisitedCount()
          Return the nodes visited count.
protected  ISearch getSearch()
          Return the search algorithm.
 void setDepth(int depth)
          Set the search depth.
protected  void setSearch(ISearch search)
          Set the search algorithm.
 
Methods inherited from class org.vizzini.game.AbstractComputerAgent
addBusyListener, 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 class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.vizzini.game.IComputerAgent
addBusyListener, evaluate, getActionGenerator, getEvaluator, isBusy, removeBusyListener
 
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
 

Constructor Detail

SearchAgent

public SearchAgent()
Method Detail

configure

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

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

getAction

public IAction getAction(IEnvironment environment,
                         IAdjudicator adjudicator)
Return the action determined through consideration of the given environment using the given adjudicator. This agent examines each legal position, and returns the highest evaluated action.

Specified by:
getAction in interface IAgent
Parameters:
environment - The current environment.
adjudicator - Adjudicator for determining legal actions.
Since:
v0.2

getDepth

public int getDepth()
Return the search depth.

Specified by:
getDepth in interface ISearchAgent
Since:
v0.2

getNodesVisitedCount

public int getNodesVisitedCount()
Return the nodes visited count.

Specified by:
getNodesVisitedCount in interface ISearchAgent
Since:
v0.3

setDepth

public void setDepth(int depth)
Set the search depth.

Specified by:
setDepth in interface ISearchAgent
Since:
v0.2

getSearch

protected ISearch getSearch()
Return the search algorithm.

Since:
v0.2

setSearch

protected void setSearch(ISearch search)
Set the search algorithm.

Since:
v0.2


Copyright 2007 Vizzini.org. All Rights Reserved. 2007.12.25.03.00.02