uchicago.src.repastdemos.rabbitPopulation
Class Deaths
java.lang.Object
uchicago.src.sim.network.DefaultNode
uchicago.src.sim.network.DefaultDrawableNode
uchicago.src.repastdemos.rabbitPopulation.Deaths
- All Implemented Interfaces:
- CustomProbeable, Drawable2DGridNode, DrawableNonGridNode, Moveable, Named, NonGridDrawable, Node
public class Deaths
- extends DefaultDrawableNode
- implements CustomProbeable, Named
Calculates how many rabbits should die each year. This encapsulates the death equation in the Rabbit
Population model. The actual equation is (population / lifeTime) * deathMultiplier.
- Version:
- $Revision: 1.1 $ $Date: 2005/08/12 20:04:58 $
- Author:
- Nick Collier
|
Constructor Summary |
Deaths(CEquationFactory factory)
Creates a Deaths object using the specified CEquationFactory. |
| 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 |
Deaths
public Deaths(CEquationFactory factory)
- Creates a Deaths object using the specified CEquationFactory. This factory creates a CEquation
and schedules that CEquation's assignment and evaluation.
- Parameters:
factory -
init
public void init(RabbitPopulation population,
DeathMultiplier deathMult)
- Initialize this Deaths instance. The RabbitPopulation is queried for the current population when
the CEquation encapsulated by this Deaths instance is evaluated.
- Parameters:
population - deathMult -
getLifeTime
public float getLifeTime()
setLifeTime
public void setLifeTime(float lifeTime)
getDeathMultiplier
public double getDeathMultiplier()
getEquation
public CEquation getEquation()
setEquation
public void setEquation(CEquation equation)
getPopulation
public double getPopulation()
getDeaths
public double getDeaths()
setDeaths
public void setDeaths(double deaths)
getName
public java.lang.String getName()
- Specified by:
getName in interface Named
- Returns:
- the name of this object
getProbedProperties
public java.lang.String[] getProbedProperties()
- Description copied from interface:
CustomProbeable
- Gets the names of the properties that are allowed to be probed. The
property names returned by this method should be reflect the accessor
and mutator method names. For example, given getAge and setAge, an
appropriate property name would be Age.
- Specified by:
getProbedProperties in interface CustomProbeable
- Returns:
- an array of the property names.