uchicago.src.repastdemos.neuralfromfile
Class TrainedEmployee

java.lang.Object
  extended by uchicago.src.sim.network.DefaultNode
      extended by uchicago.src.sim.network.DefaultDrawableNode
          extended by uchicago.src.repastdemos.neural.Employee
              extended by 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

Nested Class Summary
 
Nested classes/interfaces inherited from class uchicago.src.sim.network.DefaultNode
DefaultNode.OrderedHashMap
 
Field Summary
 
Fields inherited from class uchicago.src.repastdemos.neural.Employee
BOSS_A, BOSS_B, desiredNetworkOutput, DO_NOTHING, DO_SOMETHING, inputForRetrieval, inputForTraining, net
 
Fields inherited from class uchicago.src.sim.network.DefaultDrawableNode
item
 
Fields inherited from class uchicago.src.sim.network.DefaultNode
inEdges, inMap, label, outEdges, outMap
 
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
 
Methods inherited from interface uchicago.src.sim.gui.DrawableNonGridNode
getOutEdges
 
Methods inherited from interface uchicago.src.sim.gui.Drawable2DGridNode
getOutEdges
 

Constructor Detail

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 coordinate
y - the agent's y coordinate
neuralNetFileName - the name of the file to load the neural network from
Throws:
RepastException - when there is an error constructing the network
Method Detail

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