net.sourceforge.cilib.games.agent
Class NeuralAgent
java.lang.Object
net.sourceforge.cilib.games.agent.Agent
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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
stateInputStrategy
protected NeuralStateInputStrategy stateInputStrategy
outputInterpretationStrategy
protected NeuralOutputInterpretationStrategy outputInterpretationStrategy
hiddenNodesCount
protected int hiddenNodesCount
neuralNetworkTopology
protected GenericTopology neuralNetworkTopology
NeuralAgent
public NeuralAgent()
- Parameters:
playerNo
-
NeuralAgent
public NeuralAgent(NeuralAgent other)
- Parameters:
other
-
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 scalemin
- the lower boundmax
- 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.