Statistical Data Collectors

General Use

   
 

In general, you will need to apply the following if you want to use a statistical data collector in a DESMO-J model:

  1. Import the package desmoj.core.statistic into your model class.
  2. Add a field (an attribute) of the desired data collector type to your model class.
  3. Initialise your data collector object in the init() method of the model class.
  4. Throughout your dynamic model components (processes or events), call the update() method of the data collector object whenever the value of interest changes.

Every statistical data collector in DESMO-J can simply be updated via the update(type value) method. The type of value passed as a parameter depends on the data collector; most expect a double value whereas the Count object needs an integer (type long). Counters also provide a parameter-less update() method to automatically increment the counter by one.



   
  http://desmoj.sourceforge.net/tutorial/statistics/1.html