The Physiologist's Friend Simulation API

ch.unizh.ini.friend.simulation
Class SimulationStep

java.lang.Object
  extended by ch.unizh.ini.friend.simulation.SimulationStep

public class SimulationStep
extends Object

Implements a single iteration in the simulation process. This could actually be several iterations over the set of updateables, depending on the value of nIterate.

Version:
$Revision: 1.10 $
Author:
Christof Marti/tobi

Field Summary
protected  int nIterate
          number of times to iterate for a single step
protected  long previousTime
          Time during previous step.
protected  float speed
          The scalar 'real-time' will be multiplied with.
protected  float timeScale
          Time scale.
protected  Collection updateables
          The collection of updateable objects.
 
Constructor Summary
SimulationStep(Collection updateables, float speed)
          Creates a new instance of SimulationStep with the specified Collection of Updateable instances and a specified speed multiplier.
 
Method Summary
 int getNumberOfIterationsPerStep()
           
 Collection getUpdateables()
          Returns the collection of Updateable.
 void init()
          (Re-)Initializes this instance at the begin of the simulation.
 void setNumberOfIterationsPerStep(int n)
           
 void step()
          Makes all the cells first Updateable.compute(float), and then all the cells then Updateable.update() for a single simulation step.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nIterate

protected int nIterate
number of times to iterate for a single step


previousTime

protected long previousTime
Time during previous step.


timeScale

protected float timeScale
Time scale.


updateables

protected Collection updateables
The collection of updateable objects.


speed

protected float speed
The scalar 'real-time' will be multiplied with.

Constructor Detail

SimulationStep

public SimulationStep(Collection updateables,
                      float speed)
Creates a new instance of SimulationStep with the specified Collection of Updateable instances and a specified speed multiplier.

Parameters:
updateables - The updateable collection.
speed - The speed multiplier relative to 'real-time'.
Method Detail

setNumberOfIterationsPerStep

public void setNumberOfIterationsPerStep(int n)
Parameters:
n - the number of iterations per step
See Also:
nIterate

getNumberOfIterationsPerStep

public int getNumberOfIterationsPerStep()
Returns:
the number of iterations per step
See Also:
nIterate

init

public void init()
(Re-)Initializes this instance at the begin of the simulation.


step

public void step()
Makes all the cells first Updateable.compute(float), and then all the cells then Updateable.update() for a single simulation step.


getUpdateables

public Collection getUpdateables()
Returns the collection of Updateable.

Returns:
The updateables.

http://www.ini.unizh.ch/~tobi/friend