|
||||||||||
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.IntervalObserver
public abstract class IntervalObserver
Base class for observing certain aspects repeatedly after a given interval. Two methods can be used to observe intervals:
step
: check after each step if a interval range has been passed
theta
: register thetas for the interval ranges
The type of the used method can be set by using setThetaMethod(boolean)
.
Extending classes just have to implement getEntityValue(int)
and to
pass some indices and names to to constructor.
Constructor Summary | |
---|---|
IntervalObserver(Simulator sim,
double interval,
String[] entityName)
Create the observer for a given simulator, a given interval, given indices with names. |
Method Summary | |
---|---|
void |
activateReaction(int mu,
double tau,
Simulator.FireType fireType,
int times)
Do nothing. |
void |
finished()
Adds the recorded data to the average data pool. |
double |
getFinalValue(int entityIndex)
Gets the last value of the given entity. |
double[][] |
getRecentData()
Gets the recorded data of the most recent simulation run. |
boolean |
isPlotQuality()
Gets whether or not to plot quality data. |
boolean |
isThetaMethod()
Using theta method means that the time intervals are registered at the simulator and the simulator invokes at this moment the method theta. |
void |
setPlotQuality(boolean plotQuality)
Sets whether or not to plot quality data. |
void |
setThetaMethod(boolean thetaMethod)
Using theta method means that the time intervals are registered at the simulator and the simulator invokes at this moment the method theta. |
void |
started()
Clears the recorded values and registers (if needed) theta |
void |
step()
If the step method is used, the data is recorded here. |
void |
theta(double theta)
If the theta method is used, the data is recorded here. |
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. |
GnuPlot |
toGnuplotRecent()
Creates a new GnuPlot object and passes the recent observer data to it. |
GnuPlot |
toGnuplotRecent(GnuPlot gnuplot)
Passes the recent 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 |
Methods inherited from interface fern.simulation.observer.GnuPlotObserver |
---|
getStyles |
Constructor Detail |
---|
public IntervalObserver(Simulator sim, double interval, String[] entityName)
sim
- simulatorinterval
- intervalentityName
- names of the entitiesMethod Detail |
---|
public void started()
theta
started
in class Observer
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 finished()
finished
in class Observer
public void step()
step
method is used, the data is recorded here.
step
in class Observer
public void theta(double theta)
theta
method is used, the data is recorded here.
theta
in class Observer
theta
- moment in timepublic boolean isThetaMethod()
public void setThetaMethod(boolean thetaMethod)
thetaMethod
- the thetaMethod to setpublic 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 double[][] getRecentData()
public GnuPlot toGnuplotRecent() throws IOException
GnuPlot
object and passes the recent observer data to it.
Recent means that not the average data is used but only the recently produced.
GnuPlot
object
IOException
- if gnuplot could not be accessedpublic GnuPlot toGnuplotRecent(GnuPlot gnuplot) throws IOException
GnuPlot
object.
Recent means that not the average data is used but only the recently produced.
gnuplot
- the GnuPlot
object to pass the data to
GnuPlot
object
IOException
- if gnuplot could not be accessedpublic void setPlotQuality(boolean plotQuality)
toGnuplot
adds not only the values but also one
column in which the number of experiments (from how many values is the average of
the regarding row calculated) is
plotQuality
- whether or not to plot qualitiespublic boolean isPlotQuality()
toGnuplot
adds not only the values but also one
column in which the number of experiments (from how many values is the average of
the regarding row calculated) is
public double getFinalValue(int entityIndex)
entityIndex
- index of the entity
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |