The Physiologist's Friend Simulation API

ch.unizh.ini.friend.simulation
Interface SimulationTask

All Known Implementing Classes:
AbstractSimulation, ThreadedSimulation, TimedSimulation

public interface SimulationTask

The interface of a simulation for the controlling thread.

Version:
$Revision: 1.5 $
Author:
Christof Marti

Method Summary
 void addUpdateable(Updateable u)
          Adds an updateable to the simulation.
 long getDelay()
           
 int getNumberOfIterationsPerStep()
           
 SimulationStep getStep()
          Returns the simulation step instance.
 void removeUpdateable(Updateable u)
          Removes an updateable from the simulation.
 void setDelay(long ms)
          set the timer delay in ms between each simulation step
 void setNumberOfIterationsPerStep(int n)
          set the number of iterations over the updateables for each step.
 void start()
          Starts the simulation.
 void stop()
          Stops the simulation.
 

Method Detail

start

void start()
Starts the simulation.


stop

void stop()
Stops the simulation.


getStep

SimulationStep getStep()
Returns the simulation step instance.

Returns:
The simulation step.

addUpdateable

void addUpdateable(Updateable u)
Adds an updateable to the simulation.

Parameters:
u - An updateable.

removeUpdateable

void removeUpdateable(Updateable u)
Removes an updateable from the simulation.

Parameters:
u - An updateable.

setNumberOfIterationsPerStep

void setNumberOfIterationsPerStep(int n)
set the number of iterations over the updateables for each step. This is used for example to propogate an input through a feedforward network more quickly per GUI update. Since a change at the input of a network that is N deep takes at least N cycles to get to the output (owing to the double-buffering), you should set the number of iterations to N if you want an input to have an effect in the same simulation step.

Parameters:
n - the number

getNumberOfIterationsPerStep

int getNumberOfIterationsPerStep()
Returns:
the number of simulation iterations per step
See Also:
setNumberOfIterationsPerStep(int)

setDelay

void setDelay(long ms)
set the timer delay in ms between each simulation step

Parameters:
ms - the delay in ms
See Also:
getDelay()

getDelay

long getDelay()
Returns:
the delay between simulation steps in ms
See Also:
setDelay(long)

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