net.sourceforge.cilib.games.agent.state.evaluation
Class NeuralStateEvaluator

java.lang.Object
  extended by net.sourceforge.cilib.games.agent.Agent
      extended by net.sourceforge.cilib.games.agent.NeuralAgent
          extended by net.sourceforge.cilib.games.agent.state.evaluation.NeuralStateEvaluator
All Implemented Interfaces:
Serializable, StateEvaluator, Cloneable

public class NeuralStateEvaluator
extends NeuralAgent
implements StateEvaluator

Author:
leo This is a StateEvaluator that uses a Neural Network to evaluate a given game state. This class inherets from the NeuralAgent class becuase it's functionality is very similar.
See Also:
Serialized Form

Field Summary
 
Fields inherited from class net.sourceforge.cilib.games.agent.NeuralAgent
hiddenNodesCount, neuralNetworkTopology, outputInterpretationStrategy, stateInputStrategy
 
Fields inherited from class net.sourceforge.cilib.games.agent.Agent
agentScore, agentToken, playerID
 
Constructor Summary
NeuralStateEvaluator()
           
NeuralStateEvaluator(NeuralStateEvaluator other)
          Copy Constructor
 
Method Summary
 double evaluateState(Game<GameState> state, int decisionPlayerID)
          Evaluate a given GameState for a given player ID.
 NeuralStateEvaluator getClone()
          Create a cloned copy of the current object and return it.
 DomainRegistry getEvaluatorDomain()
          If the evaluator can be optimized then the evaluator data should be in a specific domain, this function should return that domain
 void initializeEvaluator(Type evaluatorData)
          Some state evaluators can be optimised, and therefore the evaluator should be initialized with evaluator specific data.
 void move(Game game)
          Alter the current game by making a decision.
 void setHiddenNodes(int count)
          
 void setOutputInterpretationStrategy(NeuralOutputInterpretationStrategy outputStrategy)
          The NeuralOutputInterpretationStrategy should not be set since this class funtions only as a state evaluator.
 void setStateInputStrategy(NeuralStateInputStrategy inputStrategy)
          
 
Methods inherited from class net.sourceforge.cilib.games.agent.NeuralAgent
getAgentDomain, getHiddenNodesCount, getNeuralNetworkTopology, getOutputInterpretationStrategy, getScaledInput, getStateInputStrategy, initializeAgent, setNeuralNetworkTopology, setWeights
 
Methods inherited from class net.sourceforge.cilib.games.agent.Agent
getAgentScore, getAgentToken, getPlayerID, setAgentScore, setAgentToken, setAgentToken, setPlayerID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NeuralStateEvaluator

public NeuralStateEvaluator()

NeuralStateEvaluator

public NeuralStateEvaluator(NeuralStateEvaluator other)
Copy Constructor

Parameters:
other -
Method Detail

evaluateState

public double evaluateState(Game<GameState> state,
                            int decisionPlayerID)
Evaluate a given GameState for a given player ID.

Specified by:
evaluateState in interface StateEvaluator
Parameters:
state - the Game object that is at a specific state that needs to be evaluated
decisionPlayerID - The player that has to make a decision
Returns:
the rating of the state.

getEvaluatorDomain

public DomainRegistry getEvaluatorDomain()
If the evaluator can be optimized then the evaluator data should be in a specific domain, this function should return that domain

Specified by:
getEvaluatorDomain in interface StateEvaluator
Returns:
The domain of the evaluator

initializeEvaluator

public void initializeEvaluator(Type evaluatorData)
Some state evaluators can be optimised, and therefore the evaluator should be initialized with evaluator specific data.

Specified by:
initializeEvaluator in interface StateEvaluator
Parameters:
evaluatorData - the data that determines how the evaluator should funciton

getClone

public NeuralStateEvaluator getClone()
Create a cloned copy of the current object and return it. In general the created copy will be a deep copy of the provided instance. As a result this operation an be quite expensive if used incorrectly.

Specified by:
getClone in interface Cloneable
Overrides:
getClone in class NeuralAgent
Returns:
An exact clone of the current object instance.
See Also:
Object.clone()

setHiddenNodes

public void setHiddenNodes(int count)

Overrides:
setHiddenNodes in class NeuralAgent

setStateInputStrategy

public void setStateInputStrategy(NeuralStateInputStrategy inputStrategy)

Overrides:
setStateInputStrategy in class NeuralAgent

setOutputInterpretationStrategy

public void setOutputInterpretationStrategy(NeuralOutputInterpretationStrategy outputStrategy)
The NeuralOutputInterpretationStrategy should not be set since this class funtions only as a state evaluator. A single output Neuron is used to rank the given state.

Overrides:
setOutputInterpretationStrategy in class NeuralAgent

move

public void move(Game game)
Alter the current game by making a decision.

Overrides:
move in class NeuralAgent
Parameters:
game - the game state


Copyright © 2009 CIRG. All Rights Reserved.