critter
Class MySim

java.lang.Object
  |
  +--critter.MySim

public class MySim
extends java.lang.Object


Field Summary
 critter.World myWorld
           
 
Constructor Summary
MySim()
          Constructs a simulation by initializing a world.
 
Method Summary
 void newGeneration()
          Creates a new population of critters.
 boolean updateGeneration()
          Is called for updating the simulation details when the "Step generation" has been pressed.
 boolean updateTimestep()
          Is called for updating the simulation details when the "Step timestep" has been pressed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myWorld

public critter.World myWorld
Constructor Detail

MySim

public MySim()
Constructs a simulation by initializing a world. The population is generated separately.

Method Detail

newGeneration

public void newGeneration()
Creates a new population of critters. Is called when the simulation is constructed and whenever the max lifetime of the critters has run out.


updateTimestep

public boolean updateTimestep()
Is called for updating the simulation details when the "Step timestep" has been pressed.

Returns:
boolean true if the timestep is still within the boundaries of the max lifetime, false otherwise.

updateGeneration

public boolean updateGeneration()
Is called for updating the simulation details when the "Step generation" has been pressed. Continues the life until the max lifetime has been reached.

Returns:
boolean success of completing the generation.