Package SimPy :: Module Recording :: Class Monitor |
[hide private]
[frames] | no frames]

# Class Monitor

source code

    object --+
             |
          list --+
                 |
                Monitor

Monitored variables

A Class for monitored variables, that is, variables that allow one to gather simple statistics. A Monitor is a subclass of list and list operations can be performed on it. An object is established using m = Monitor(name = '..'). It can be given a unique name for use in debugging and in tracing and ylab and tlab strings for labelling graphs.

Instance Methods | [hide private]
new list |
__init__(self, name=`'``a_Monitor``'`, ylab=`'``y``'`, tlab=`'``t``'`, sim=None) x.__init__(...) initializes x; see x.__class__.__doc__ for signature | source code
setHistogram(self, name=`'````'`, low=0.0, high=100.0, nbins=10) Sets histogram parameters. | source code
observe(self, y, t=None) record y and t | source code
tally(self, y) deprecated: tally for backward compatibility | source code
accum(self, y, t=None) deprecated: accum for backward compatibility | source code
reset(self, t=None) reset the sums and counts for the monitored variable | source code
tseries(self) the series of measured times | source code
yseries(self) the series of measured values | source code
integer |
count(self) deprecated: the number of observations made | source code
total(self) the sum of the y | source code
mean(self) the simple average of the monitored variable | source code
var(self) the sample variance of the monitored variable | source code
timeAverage(self, t=None) the time - weighted average of the monitored variable. | source code
timeVariance(self, t=None) the time - weighted Variance of the monitored variable. | source code
histogram(self, low=0.0, high=100.0, nbins=10) A histogram of the monitored y data values. | source code
getHistogram(self) Returns a histogram based on the parameters provided in preceding call to setHistogram. | source code
printHistogram(self, fmt=`'``%s``'`) Returns formatted frequency distribution table string from Monitor. | source code
Inherited from `list`: `__add__`, `__contains__`, `__delitem__`, `__delslice__`, `__eq__`, `__ge__`, `__getattribute__`, `__getitem__`, `__getslice__`, `__gt__`, `__hash__`, `__iadd__`, `__imul__`, `__iter__`, `__le__`, `__len__`, `__lt__`, `__mul__`, `__ne__`, `__new__`, `__repr__`, `__reversed__`, `__rmul__`, `__setitem__`, `__setslice__`, `append`, `extend`, `index`, `insert`, `pop`, `remove`, `reverse`, `sort` Inherited from `object`: `__delattr__`, `__reduce__`, `__reduce_ex__`, `__setattr__`, `__str__`

Properties | [hide private]
Inherited from `object`: `__class__`

Method Details | [hide private]

### __init__(self, name=`'``a_Monitor``'`, ylab=`'``y``'`, tlab=`'``t``'`, sim=None) (Constructor) | source code
x.__init__(...) initializes x; see x.__class__.__doc__ for signature Returns: new list Overrides: object.__init__ (inherited documentation)

### setHistogram(self, name=`'````'`, low=0.0, high=100.0, nbins=10) | source code
Sets histogram parameters. Must be called before call to getHistogram

### count(self) | source code
deprecated: the number of observations made Returns: integer Overrides: list.count

### timeAverage(self, t=None) | source code
the time - weighted average of the monitored variable. If t is used it is assumed to be the current time, otherwise t = self.sim.now()

### timeVariance(self, t=None) | source code
the time - weighted Variance of the monitored variable. If t is used it is assumed to be the current time, otherwise t = self.sim.now()

### printHistogram(self, fmt=`'``%s``'`) | source code
Returns formatted frequency distribution table string from Monitor. Precondition: setHistogram must have been called. fmt == format of bin range values