elge.engine
Interface Monitor

All Known Implementing Classes:
AbstractMonitor

public interface Monitor

Monitor implementations monitor the simulation. In each simulation step, at its and every monitor is called, for it values.

Actualy the storage mechanism calles the monitors to get the values from them and stores them.

Monitor can monitor anything the programer has acces to. The rules are, that an value should be returned that monitor defines. The monitor can also change the identifiers, but should always has as many values as identifier. If it cannot make a value, it should return 0. Monitor can also return a non number values, but these cannot be displayd for now in graphs.

Monitor should hold only one tick values. For the collecting of the values is responsible the DataStorage

Author:
Pavol Žibrita

Method Summary
 String getDescription()
          A monitor description, describing to user, what is this monitor doing.
 String getFullName()
          The monitor full name.
 String[] getIdentifiers()
          The value identifier.
 String getMonitorName()
          The monitor name, should be readable for the user.
 boolean getPersistence()
          The persistence of this monitor.
 Project getProject()
          Returns the project the monitor is in.
 Object[] getValues()
          Returns an array of values, that the monitor has monitored.
 void restart()
          Restart the monitor.
 void setPersistence(boolean per)
          Sets the persistence of this monitor
 void setProject(Project w)
          Sets the project the monitor is in.
 

Method Detail

getValues

public Object[] getValues()
Returns an array of values, that the monitor has monitored. One value for one identifier.

Returns:
array of values.

getIdentifiers

public String[] getIdentifiers()
The value identifier. One Monitor can monitor more things and so it will have more identifier.

Returns:
an array of identifiers.

getMonitorName

public String getMonitorName()
The monitor name, should be readable for the user.

Returns:
the name of the monitor

getFullName

public String getFullName()
The monitor full name. If possible, it shoudl include the monitor name and its identifiers..

Returns:
full monitor name

getDescription

public String getDescription()
A monitor description, describing to user, what is this monitor doing.

Returns:
a monitor description.

setProject

public void setProject(Project w)
Sets the project the monitor is in.

Parameters:
w - the project

getProject

public Project getProject()
Returns the project the monitor is in.

Returns:
the Project for this monitor.

getPersistence

public boolean getPersistence()
The persistence of this monitor. If false, the storage should not write the values, but should have the values avaible for graphs.

Returns:
true if the values should be stored to disk (or whatever)

setPersistence

public void setPersistence(boolean per)
Sets the persistence of this monitor

Parameters:
per - the value to set
See Also:
getPersistence()

restart

public void restart()
Restart the monitor. The monitor should go to state before simulation. It should dispose the datas it does not need now.