http://www.cs.colorado.edu/~main/applications/PondLife.java
- See Also:
Organism,
Plant,
Herbivore
|
Method Summary |
static void |
main(java.lang.String[] args)
Run the simulation, using the values indicated in the documentation. |
static void |
pondWeek(java.util.Vector<Herbivore> fish,
java.util.Vector<Plant> weeds)
Simulate one week of life in the pond, using the values indicated in the
documentation. |
static
|
totalMass(java.util.Vector<T> organisms)
Calculate the total mass of a collection of Organisms. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MANY_WEEDS
public static final int MANY_WEEDS
- See Also:
- Constant Field Values
WEED_SIZE
public static final double WEED_SIZE
- See Also:
- Constant Field Values
WEED_RATE
public static final double WEED_RATE
- See Also:
- Constant Field Values
INIT_FISH
public static final int INIT_FISH
- See Also:
- Constant Field Values
FISH_SIZE
public static final double FISH_SIZE
- See Also:
- Constant Field Values
FRACTION
public static final double FRACTION
- See Also:
- Constant Field Values
AVERAGE_NIBBLES
public static final int AVERAGE_NIBBLES
- See Also:
- Constant Field Values
BIRTH_RATE
public static final double BIRTH_RATE
- See Also:
- Constant Field Values
MANY_WEEKS
public static final int MANY_WEEKS
- See Also:
- Constant Field Values
PondLife
public PondLife()
main
public static void main(java.lang.String[] args)
- Run the simulation, using the values indicated in the documentation.
The
String arguments (args) are not used
in this implementation.
pondWeek
public static void pondWeek(java.util.Vector<Herbivore> fish,
java.util.Vector<Plant> weeds)
- Simulate one week of life in the pond, using the values indicated in the
documentation.
totalMass
public static <T extends Organism> double totalMass(java.util.Vector<T> organisms)
- Calculate the total mass of a collection of
Organisms.
- Parameters:
organisms - a Vector of Organism objects
- Precondition:
-
Every object in
organisms is an Organism.
- Returns:
- the total mass of all the objects in
Organism (in ounces).