uchicago.src.repastdemos.genetic
Class Judge
java.lang.Object
uchicago.src.sim.network.DefaultNode
uchicago.src.sim.network.DefaultDrawableNode
uchicago.src.repastdemos.genetic.Judge
- All Implemented Interfaces:
- AutoStepable, Drawable2DGridNode, DrawableNonGridNode, Moveable, NonGridDrawable, Node
public class Judge
- extends DefaultDrawableNode
- implements AutoStepable
This is the agent that adjusts the location of Competitors based on
the correctness of their solution.
As competitors get closer to the solution they are moved towards the center
of the display.
- Version:
- $Revision: 1.1 $ $Date: 2005/08/12 20:04:55 $
- Author:
- Jerry Vos
| Methods inherited from class uchicago.src.sim.network.DefaultDrawableNode |
allowResizing, calcSize, contains, draw, 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 |
Judge
public Judge(CompetitionSpace space,
double x,
double y)
preStep
public void preStep()
- Description copied from interface:
AutoStepable
- normally the method for setting up an agent for the next step
- Specified by:
preStep in interface AutoStepable
step
public void step()
- Description copied from interface:
AutoStepable
- normally the method that performs the actual actions of a step
- Specified by:
step in interface AutoStepable
screenCoordsToNormalizedCartesianCoords
public double[] screenCoordsToNormalizedCartesianCoords(double x,
double y)
normalizedCartesianCoordsToScreenCoords
public double[] normalizedCartesianCoordsToScreenCoords(double x,
double y)
calcDistFromOptimal
public int calcDistFromOptimal(int targetAmount,
CoinStruct currentAmount)
computeOptimalCoinCount
public int computeOptimalCoinCount(int amountInCents)
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
getDesiredAmount
public double getDesiredAmount()
- Returns:
- Returns the desiredAmount.
setDesiredAmount
public void setDesiredAmount(double desiredAmount)
- Parameters:
desiredAmount - The desiredAmount to set.
main
public static void main(java.lang.String[] args)
- used for testing the coordinate functions