org.eclipse.palamedes.gdl.core.simulation.strategies
Class AbstractStrategy

java.lang.Object
  extended by org.eclipse.palamedes.gdl.core.simulation.strategies.AbstractStrategy
All Implemented Interfaces:
IStrategy
Direct Known Subclasses:
SDFS, SMonteCarlo, SMonteCarloUCT, SRandom

public abstract class AbstractStrategy
extends java.lang.Object
implements IStrategy


Field Summary
protected  double expectedGoal
           
protected  IGame game
           
protected  double heuristic
           
protected static java.lang.InterruptedException iException
          General interrupted exception for timing purpose
protected  Match match
           
protected  int maxSteps
           
protected static int maxStepsDefault
          The upper limit of expected steps for a game
protected  int playerNumber
           
protected static java.util.Random random
          A random number generator.
protected  double reliability
           
 
Constructor Summary
AbstractStrategy()
           
 
Method Summary
 void dispose()
          A strategy is responsible to dispose all own references to avoid reference cycles.
 double getExpectedGoalValue()
          Returns a value for the last chosen move that should give an indicator what goal value we think we might get in the end.
 double getHeuristicValue(IGameNode node)
          Returns a value for the game node that can be used by a heuristic to evaluate the game node.
abstract  IMove getMove(IGameNode currentNode)
           
 IMove[] getRandomCombinedMove()
           
 double getReliabilityValue()
          Returns a value for the last chosen move that should give an indicator value for the reliability of it.
 void initMatch(Match initMatch)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

random

protected static final java.util.Random random
A random number generator.


maxStepsDefault

protected static final int maxStepsDefault
The upper limit of expected steps for a game

See Also:
Constant Field Values

iException

protected static final java.lang.InterruptedException iException
General interrupted exception for timing purpose


match

protected Match match

game

protected IGame game

maxSteps

protected int maxSteps

playerNumber

protected int playerNumber

reliability

protected double reliability

heuristic

protected double heuristic

expectedGoal

protected double expectedGoal
Constructor Detail

AbstractStrategy

public AbstractStrategy()
Method Detail

initMatch

public void initMatch(Match initMatch)
Specified by:
initMatch in interface IStrategy

getMove

public abstract IMove getMove(IGameNode currentNode)
Specified by:
getMove in interface IStrategy

dispose

public void dispose()
Description copied from interface: IStrategy
A strategy is responsible to dispose all own references to avoid reference cycles.

Specified by:
dispose in interface IStrategy

getHeuristicValue

public double getHeuristicValue(IGameNode node)
Description copied from interface: IStrategy
Returns a value for the game node that can be used by a heuristic to evaluate the game node. If no such value can be generated then -1 is the default return value.

Specified by:
getHeuristicValue in interface IStrategy

getReliabilityValue

public double getReliabilityValue()
Description copied from interface: IStrategy
Returns a value for the last chosen move that should give an indicator value for the reliability of it.

Specified by:
getReliabilityValue in interface IStrategy

getExpectedGoalValue

public double getExpectedGoalValue()
Description copied from interface: IStrategy
Returns a value for the last chosen move that should give an indicator what goal value we think we might get in the end.

Specified by:
getExpectedGoalValue in interface IStrategy

getRandomCombinedMove

public IMove[] getRandomCombinedMove()
                              throws java.lang.InterruptedException
Throws:
java.lang.InterruptedException