uchicago.src.repastdemos.neuralfromfile
Class TrainedEmployee
java.lang.Object
uchicago.src.sim.network.DefaultNode
uchicago.src.sim.network.DefaultDrawableNode
uchicago.src.repastdemos.neural.Employee
uchicago.src.repastdemos.neuralfromfile.TrainedEmployee
- All Implemented Interfaces:
- AutoStepable, Drawable2DGridNode, DrawableNonGridNode, Moveable, NonGridDrawable, Node
public class TrainedEmployee
- extends Employee
An employee that performs actions based on a neural network stored in a file.
- Version:
- $Revision: 1.1 $ $Date: 2005/08/12 20:04:58 $
- Author:
- Jerry Vos
|
Constructor Summary |
TrainedEmployee()
|
TrainedEmployee(double x,
double y)
|
TrainedEmployee(double x,
double y,
java.lang.String neuralNetFileName)
This constructor creates an employee who's decisions are made by the
neural network stored in a file. |
|
Method Summary |
void |
loadBrainFromFile(java.lang.String neuralNetFileName)
loads a neural network as this employee's brain from a specified
file |
void |
saveBrainToFile(java.lang.String neuralNetFileName)
saves this agent's neural network to a file |
java.lang.String |
toString()
|
| Methods inherited from class uchicago.src.repastdemos.neural.Employee |
doNothing, doSomething, draw, getActionPerformed, getCommands, getError, postStep, praise, preStep, receiveCommand, resetIndices, scold, step |
| Methods inherited from class uchicago.src.sim.network.DefaultDrawableNode |
allowResizing, calcSize, contains, getBorderColor, getBorderWidth, getColor, getFont, getHeight, getLabelColor, getNode, getWidth, getX, getY, setBorderColor, setBorderWidth, setColor, setDrawable, setDrawableNoCopy, setFont, setHeight, setLabelColor, setNodeLabel, setWidth, setX, setX, setY, setY |
| Methods inherited from class uchicago.src.sim.network.DefaultNode |
addInEdge, addInEdges, addOutEdge, addOutEdges, clearInEdges, clearOutEdges, getEdgesFrom, getEdgesTo, getFromNodes, getId, getInDegree, getInEdges, getInNodes, getNodeLabel, getNumInEdges, getNumOutEdges, getOutDegree, getOutEdges, getOutNodes, getRandomFromNode, getRandomNodeIn, getRandomNodeOut, getRandomToNode, getToNodes, hasEdgeFrom, hasEdgeTo, hasEdgeToOrFrom, makeRandomInEdge, makeRandomOutEdge, removeEdgesFrom, removeEdgesTo, removeInEdge, removeOutEdge |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
TrainedEmployee
public TrainedEmployee(double x,
double y)
throws RepastException
- Throws:
RepastException
TrainedEmployee
public TrainedEmployee()
throws RepastException
- Throws:
RepastException
TrainedEmployee
public TrainedEmployee(double x,
double y,
java.lang.String neuralNetFileName)
throws RepastException
- This constructor creates an employee who's decisions are made by the
neural network stored in a file.
- Parameters:
x - the agent's x coordinatey - the agent's y coordinateneuralNetFileName - the name of the file to load the neural network
from
- Throws:
RepastException - when there is an error constructing the network
loadBrainFromFile
public void loadBrainFromFile(java.lang.String neuralNetFileName)
throws NeuralException
- loads a neural network as this employee's brain from a specified
file
- Parameters:
neuralNetFileName - the name of the file to load the neural net from
- Throws:
NeuralException - when there is an error loading the network
saveBrainToFile
public void saveBrainToFile(java.lang.String neuralNetFileName)
throws NeuralException
- saves this agent's neural network to a file
- Parameters:
neuralNetFileName - the name of the file to save the neural net to
- Throws:
NeuralException - when there is an error loading the network
toString
public java.lang.String toString()
- Overrides:
toString in class java.lang.Object