fern.simulation.observer
Class FireTypeObserver

java.lang.Object
  extended by fern.simulation.observer.Observer
      extended by fern.simulation.observer.FireTypeObserver
All Implemented Interfaces:
GnuPlotObserver

public class FireTypeObserver
extends Observer
implements GnuPlotObserver

Observes the different types of firings.

If the simulation is repeated, the average numbers are calculated.

Author:
Florian Erhard
See Also:
Simulator.FireType

Constructor Summary
FireTypeObserver(Simulator sim)
          Create the observer for the given simulator.
 
Method Summary
 void activateReaction(int mu, double tau, Simulator.FireType fireType, int times)
          Counts the firing for the given Simulator.FireType
 void finished()
          Calculates the average over all runs of the simulator.
 String[] getStyles()
          Gets the styles for the columns.
 void started()
          Do nothing.
 void step()
          Do nothing.
 void theta(double theta)
          Do nothing.
 GnuPlot toGnuplot()
          Creates a new GnuPlot object and passes the actual observer data to it.
 GnuPlot toGnuplot(GnuPlot gnuplot)
          Passes the actual observer data to a GnuPlot object.
 String toString()
           
 
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

FireTypeObserver

public FireTypeObserver(Simulator sim)
Create the observer for the given simulator.

Parameters:
sim - simulator
Method Detail

activateReaction

public void activateReaction(int mu,
                             double tau,
                             Simulator.FireType fireType,
                             int times)
Counts the firing for the given Simulator.FireType

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()
Calculates the average over all runs of the simulator.

Specified by:
finished in class Observer

started

public void started()
Do nothing.

Specified by:
started in class Observer

step

public void step()
Do nothing.

Specified by:
step in class Observer

toString

public String toString()
Overrides:
toString in class Object

theta

public void theta(double theta)
Do nothing.

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

toGnuplot

public GnuPlot toGnuplot()
Description copied from interface: GnuPlotObserver
Creates a new GnuPlot object and passes the actual observer data to it.

Specified by:
toGnuplot in interface GnuPlotObserver
Returns:
the created GnuPlot object

toGnuplot

public GnuPlot toGnuplot(GnuPlot gnuplot)
Description copied from interface: GnuPlotObserver
Passes the actual observer data to a GnuPlot object.

Specified by:
toGnuplot in interface GnuPlotObserver
Parameters:
gnuplot - the GnuPlot object to pass the data to
Returns:
the GnuPlot object

getStyles

public String[] getStyles()
Description copied from interface: GnuPlotObserver
Gets the styles for the columns. If you don't want styles, just return null!

Specified by:
getStyles in interface GnuPlotObserver
Returns:
styles for the columns