Class PondLife

java.lang.Object
  extended by PondLife

public class PondLife
extends java.lang.Object

The PondLife Java application runs a simple simulation that models the fish and weeds in a pond.

The simulation is currently set up to use these values:

Java Source Code for this class:
http://www.cs.colorado.edu/~main/applications/PondLife.java

See Also:
Organism, Plant, Herbivore

Field Summary
static int AVERAGE_NIBBLES
           
static double BIRTH_RATE
           
static double FISH_SIZE
           
static double FRACTION
           
static int INIT_FISH
           
static int MANY_WEEDS
           
static int MANY_WEEKS
           
static double WEED_RATE
           
static double WEED_SIZE
           
 
Constructor Summary
PondLife()
           
 
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
<T extends Organism>
double
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
 

Field Detail

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
Constructor Detail

PondLife

public PondLife()
Method Detail

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).