|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfern.simulation.observer.Observer
fern.simulation.observer.AmountAtMomentObserver
public class AmountAtMomentObserver
Observes the amount of some molecule species at a certain moment. In order to
accomplish that, this class also implements a SimulationController
and
registers a theta
at the simulator. The data produced after are histograms
for each species representing the distribution of amounts at theta.
Observer.getTheta()
Constructor Summary | |
---|---|
AmountAtMomentObserver(Simulator sim,
double moment,
int... speciesIndices)
Creates the observer for the given simulator, the given theta and the given species |
|
AmountAtMomentObserver(Simulator sim,
double moment,
String... speciesName)
Creates the observer for the given simulator, the given theta and the given species |
Method Summary | |
---|---|
void |
activateReaction(int mu,
double tau,
Simulator.FireType fireType,
int times)
Do nothing |
void |
finished()
Do nothing. |
Map<Integer,Integer> |
getHistogram(int species)
Gets the histogram of the distribution for a species |
String[] |
getStyles()
Gets the styles for the columns. |
boolean |
goOn(Simulator sim)
Causes the simulator to stop when theta has been passed and the amounts
have been recorded. |
void |
started()
Register theta at the simulator. |
void |
step()
Do nothing. |
void |
theta(double theta)
Records the amounts of the species and puts it into the histogram. |
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 |
---|
public AmountAtMomentObserver(Simulator sim, double moment, String... speciesName)
sim
- simulatormoment
- thetaspeciesName
- names of the species to observepublic AmountAtMomentObserver(Simulator sim, double moment, int... speciesIndices)
sim
- simulatormoment
- thetaspeciesIndices
- indices of the species to observeMethod Detail |
---|
public boolean goOn(Simulator sim)
theta
has been passed and the amounts
have been recorded.
goOn
in interface SimulationController
sim
- simulation
public void activateReaction(int mu, double tau, Simulator.FireType fireType, int times)
activateReaction
in class Observer
mu
- the reaction which is supposed to firetau
- the time the reaction fires (at this time Simulator.getTime()
does not necessarily yield the firing time)fireType
- the type of the firingtimes
- TODOpublic void theta(double theta)
theta
in class Observer
theta
- moment in timepublic void finished()
finished
in class Observer
public void started()
started
in class Observer
public void step()
step
in class Observer
public GnuPlot toGnuplot() throws IOException
GnuPlotObserver
GnuPlot
object and passes the actual observer data to it.
toGnuplot
in interface GnuPlotObserver
GnuPlot
object
IOException
- if gnuplot could not be accessedpublic GnuPlot toGnuplot(GnuPlot gnuplot) throws IOException
GnuPlotObserver
GnuPlot
object.
toGnuplot
in interface GnuPlotObserver
gnuplot
- the GnuPlot
object to pass the data to
GnuPlot
object
IOException
- if gnuplot could not be accessedpublic Map<Integer,Integer> getHistogram(int species)
species
- species index (but not in network index space - i means the ith passed species)
public String toString()
toString
in class Object
public String[] getStyles()
GnuPlotObserver
getStyles
in interface GnuPlotObserver
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |