fern.network.sbml
Class SBMLEventHandlerObserver

java.lang.Object
  extended by fern.simulation.observer.Observer
      extended by fern.simulation.observer.TriggerObserver
          extended by fern.network.sbml.SBMLEventHandlerObserver

public class SBMLEventHandlerObserver
extends TriggerObserver

Observer which handles an event of a sbml model.

Author:
Florian Erhard

Constructor Summary
SBMLEventHandlerObserver(Simulator sim, SBMLNetwork net, org.sbml.libsbml.Event event)
          Creates the observer.
 
Method Summary
 void activateReaction(int mu, double tau, Simulator.FireType fireType, int times)
          Gets called before a reaction fires.
 void finished()
          Gets called when a simulation has finished, directly after the termination check.
 void setSimulatorAsync(Simulator sim)
           
 void started()
          Gets called when the simulation has started after the initialization and before the termination condition is checked the first time.
 void step()
          Gets called after each termination check and before Simulator.performStep(fern.simulation.controller.SimulationController) is called.
 void theta(double theta)
          Gets called by simulators when a certain moment in time is reached.
 String toString()
           
 boolean trigger()
          Is executed, whenever a event can trigger (before step and during a theta event).
 
Methods inherited from class fern.simulation.observer.Observer
getLabelFormat, getNumSimulations, getPrintWriter, getSimulator, getTheta, print, setLabelFormat, setPrintWriter, setTheta
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SBMLEventHandlerObserver

public SBMLEventHandlerObserver(Simulator sim,
                                SBMLNetwork net,
                                org.sbml.libsbml.Event event)
Creates the observer.

Parameters:
sim - the simulator
net - the sbml network
event - the event object of the sbml model
Method Detail

activateReaction

public void activateReaction(int mu,
                             double tau,
                             Simulator.FireType fireType,
                             int times)
Description copied from class: Observer
Gets called before a reaction fires.

Specified by:
activateReaction in class Observer
Parameters:
mu - the reaction which is supposed to fire
tau - the time the reaction fires (at this time Simulator.getTime() does not necessarily yield the firing time)
fireType - the type of the firing
times - TODO

finished

public void finished()
Description copied from class: Observer
Gets called when a simulation has finished, directly after the termination check.

Specified by:
finished in class Observer

started

public void started()
Description copied from class: Observer
Gets called when the simulation has started after the initialization and before the termination condition is checked the first time.

Specified by:
started in class Observer

step

public void step()
Description copied from class: Observer
Gets called after each termination check and before Simulator.performStep(fern.simulation.controller.SimulationController) is called.

Specified by:
step in class Observer

trigger

public boolean trigger()
Description copied from class: TriggerObserver
Is executed, whenever a event can trigger (before step and during a theta event).

Specified by:
trigger in class TriggerObserver
Returns:
whether or not the trigger has fired

theta

public void theta(double theta)
Description copied from class: Observer
Gets called by simulators when a certain moment in time is reached. This moment in time has to be registered by Observer.getTheta()

Specified by:
theta in class Observer
Parameters:
theta - moment in time

setSimulatorAsync

public void setSimulatorAsync(Simulator sim)

toString

public String toString()
Overrides:
toString in class Object