net.sourceforge.cilib.games.agent
Class NeuralAgent

java.lang.Object
  extended by net.sourceforge.cilib.games.agent.Agent
      extended by net.sourceforge.cilib.games.agent.NeuralAgent
All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
NeuralStateEvaluator

public class NeuralAgent
extends Agent

Author:
leo An agent that uses a Neural Network to make decisions
See Also:
Serialized Form

Field Summary
protected  int hiddenNodesCount
           
protected  GenericTopology neuralNetworkTopology
           
protected  NeuralOutputInterpretationStrategy outputInterpretationStrategy
           
protected  NeuralStateInputStrategy stateInputStrategy
           
 
Fields inherited from class net.sourceforge.cilib.games.agent.Agent
agentScore, agentToken, playerID
 
Constructor Summary
NeuralAgent()
           
NeuralAgent(NeuralAgent other)
           
 
Method Summary
 DomainRegistry getAgentDomain()
          Get the domain the agent's solution is represented by
 Agent getClone()
          Create a cloned copy of the current object and return it.
 int getHiddenNodesCount()
           
 GenericTopology getNeuralNetworkTopology()
           
 NeuralOutputInterpretationStrategy getOutputInterpretationStrategy()
           
 double getScaledInput(double val, double min, double max)
          Scale the input value from the specified range to the active range of the input nodes for the NN
 NeuralStateInputStrategy getStateInputStrategy()
           
 void initializeAgent(Type agentData)
          Initialize the agent with the contents of an entity.
 void move(Game<GameState> game)
          Alter the current game by making a decision.
 void setHiddenNodes(int count)
           
 void setNeuralNetworkTopology(GenericTopology topology)
           
 void setOutputInterpretationStrategy(NeuralOutputInterpretationStrategy outputInterpretationStrategy)
           
 void setStateInputStrategy(NeuralStateInputStrategy stateInputStrategy)
           
 void setWeights(Vector weights)
           
 
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
 

Field Detail

stateInputStrategy

protected NeuralStateInputStrategy stateInputStrategy

outputInterpretationStrategy

protected NeuralOutputInterpretationStrategy outputInterpretationStrategy

hiddenNodesCount

protected int hiddenNodesCount

neuralNetworkTopology

protected GenericTopology neuralNetworkTopology
Constructor Detail

NeuralAgent

public NeuralAgent()
Parameters:
playerNo -

NeuralAgent

public NeuralAgent(NeuralAgent other)
Parameters:
other -
Method Detail

setHiddenNodes

public void setHiddenNodes(int count)

setStateInputStrategy

public void setStateInputStrategy(NeuralStateInputStrategy stateInputStrategy)

setOutputInterpretationStrategy

public void setOutputInterpretationStrategy(NeuralOutputInterpretationStrategy outputInterpretationStrategy)

setWeights

public void setWeights(Vector weights)

getScaledInput

public double getScaledInput(double val,
                             double min,
                             double max)
Scale the input value from the specified range to the active range of the input nodes for the NN

Parameters:
val - the value to scale
min - the lower bound
max - the upper bound
Returns:

getClone

public Agent 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
Specified by:
getClone in class Agent
Returns:
An exact clone of the current object instance.
See Also:
Object.clone()

move

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

Specified by:
move in class Agent
Parameters:
game - the game state

initializeAgent

public void initializeAgent(Type agentData)
Initialize the agent with the contents of an entity. This data should represent what the

Specified by:
initializeAgent in class Agent
Parameters:
agentData - the data to initialize the agent with

getAgentDomain

public DomainRegistry getAgentDomain()
Get the domain the agent's solution is represented by

Specified by:
getAgentDomain in class Agent
Returns:
the relevant DomainRegistry

setNeuralNetworkTopology

public void setNeuralNetworkTopology(GenericTopology topology)

getHiddenNodesCount

public int getHiddenNodesCount()

getOutputInterpretationStrategy

public NeuralOutputInterpretationStrategy getOutputInterpretationStrategy()

getStateInputStrategy

public NeuralStateInputStrategy getStateInputStrategy()

getNeuralNetworkTopology

public GenericTopology getNeuralNetworkTopology()


Copyright © 2009 CIRG. All Rights Reserved.