org.vizzini.game.search
Class AlphaBetaSearch

java.lang.Object
  extended by org.vizzini.game.search.AbstractSearch
      extended by org.vizzini.game.search.AlphaBetaSearch
All Implemented Interfaces:
ISearch

public class AlphaBetaSearch
extends AbstractSearch

Provides a negamax-based alpha-beta search algorithm.

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

Constructor Summary
AlphaBetaSearch()
           
 
Method Summary
 void configure(Properties properties, int index)
          Configure this search.
protected  ITranspositionKeyCreator getKeyCreator()
           
 boolean isTranspositionTableUsed()
           
protected  IAction performSearch(IAgent agent, IAgent opponent, IEnvironment environment, IAdjudicator adjudicator, IEvaluator evaluator, IActionGenerator actionGenerator, int maxDepth, int depth, int alpha, int beta, IAction parentAction)
          Perform a search using the given parameters.
protected  void setKeyCreator(ITranspositionKeyCreator keyCreator)
           
 void setTranspositionTableUsed(boolean isTranspositionTableUsed)
           
 
Methods inherited from class org.vizzini.game.search.AbstractSearch
evaluate, getNodesVisitedCount, incrementNodesVisited, printActions, releaseActions, reset, search
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AlphaBetaSearch

public AlphaBetaSearch()
Method Detail

configure

public void configure(Properties properties,
                      int index)
               throws InstantiationException,
                      IllegalAccessException
Description copied from interface: ISearch
Configure this search.

Specified by:
configure in interface ISearch
Overrides:
configure in class AbstractSearch
Parameters:
properties - Properties.
index - Index of the agent to which this search belongs.
Throws:
InstantiationException - if the specified ITranspositionKeyCreator cannot be instantiated.
IllegalAccessException - if the specified ITranspositionKeyCreator class or its no-arg constructor cannot be accessed.

isTranspositionTableUsed

public boolean isTranspositionTableUsed()
Returns:
Return isTranspositionTableUsed.

setTranspositionTableUsed

public void setTranspositionTableUsed(boolean isTranspositionTableUsed)
Parameters:
isTranspositionTableUsed - the isTranspositionTableUsed to set

getKeyCreator

protected ITranspositionKeyCreator getKeyCreator()
Returns:
Return keyCreator.

performSearch

protected IAction performSearch(IAgent agent,
                                IAgent opponent,
                                IEnvironment environment,
                                IAdjudicator adjudicator,
                                IEvaluator evaluator,
                                IActionGenerator actionGenerator,
                                int maxDepth,
                                int depth,
                                int alpha,
                                int beta,
                                IAction parentAction)
Perform a search using the given parameters.

Specified by:
performSearch in class AbstractSearch
Since:
v0.2

setKeyCreator

protected void setKeyCreator(ITranspositionKeyCreator keyCreator)
Parameters:
keyCreator - the keyCreator to set


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