uchicago.src.repastdemos.genetic
Class Competitor
java.lang.Object
uchicago.src.sim.network.DefaultNode
uchicago.src.sim.network.DefaultDrawableNode
uchicago.src.repastdemos.genetic.Competitor
- All Implemented Interfaces:
- AutoStepable, Drawable2DGridNode, DrawableNonGridNode, Moveable, NonGridDrawable, Node
public class Competitor
- extends DefaultDrawableNode
- implements AutoStepable
This is an agent in the simulation. The brains of the agent are represented
by a genetic algorithm.
- Version:
- $Revision: 1.1 $ $Date: 2005/08/12 20:04:55 $
- Author:
- Jerry Vos
|
Method Summary |
void |
draw(SimGraphics g)
Draws this Drawable2DGridNode. |
CoinStruct |
getCoinCount()
|
double |
getError()
|
void |
postStep()
normally the method for swapping in new public data and otherwise
handling the results/cleanup of a step |
void |
preStep()
normally the method for setting up an agent for the next step |
static void |
resetIndices()
|
void |
step()
normally the method that performs the actual actions of a 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, toString, wait, wait, wait |
Competitor
public Competitor(double x,
double y,
Judge judge)
throws RepastException
- Throws:
RepastException
resetIndices
public static void resetIndices()
preStep
public void preStep()
throws RepastException
- Description copied from interface:
AutoStepable
- normally the method for setting up an agent for the next step
- Specified by:
preStep in interface AutoStepable
- Throws:
RepastException
step
public void step()
throws RepastException
- Description copied from interface:
AutoStepable
- normally the method that performs the actual actions of a step
- Specified by:
step in interface AutoStepable
- Throws:
RepastException
postStep
public void postStep()
- Description copied from interface:
AutoStepable
- normally the method for swapping in new public data and otherwise
handling the results/cleanup of a step
- Specified by:
postStep in interface AutoStepable
draw
public void draw(SimGraphics g)
- Description copied from interface:
Drawable2DGridNode
- Draws this Drawable2DGridNode.
- Specified by:
draw in interface Drawable2DGridNode- Specified by:
draw in interface NonGridDrawable- Overrides:
draw in class DefaultDrawableNode
- Parameters:
g - the SimGraphics object used for drawing
getCoinCount
public CoinStruct getCoinCount()
getError
public double getError()
- Returns:
- returns the neural network's error