fern.simulation.observer
Class InstantOutputObserver

java.lang.Object
  extended by fern.simulation.observer.Observer
      extended by fern.simulation.observer.InstantOutputObserver

public class InstantOutputObserver
extends Observer

Simply prints out every event that the simulator reports to the observer.

Author:
Florian Erhard

Constructor Summary
InstantOutputObserver(Simulator sim, PrintWriter pw)
          Creates the observer for a given simulator and a given PrintWriter
 
Method Summary
 void activateReaction(int mu, double tau, Simulator.FireType fireType, int times)
          Prints event.
 void finished()
          Prints event.
 void started()
          Prints event.
 void step()
          Prints event.
 void theta(double theta)
          Prints 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, toString, wait, wait, wait
 

Constructor Detail

InstantOutputObserver

public InstantOutputObserver(Simulator sim,
                             PrintWriter pw)
Creates the observer for a given simulator and a given PrintWriter

Parameters:
sim - simulator
pw - PrintWriter
Method Detail

activateReaction

public void activateReaction(int mu,
                             double tau,
                             Simulator.FireType fireType,
                             int times)
Prints event.

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()
Prints event.

Specified by:
finished in class Observer

started

public void started()
Prints event.

Specified by:
started in class Observer

step

public void step()
Prints event.

Specified by:
step in class Observer

theta

public void theta(double theta)
Prints event.

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