Package mosp :: Module monitors :: Class EmptyMonitor
[hide private]
[frames] | no frames]

Class EmptyMonitor

source code


This monitor does nothing.

Other monitors should inherit from this one.

Usage example see mosp_examples/random_wiggler.py


Authors:
B. Henne, P. Tute
Instance Methods [hide private]
new empty list
__init__(self, name, sim, tick, kwargs)
Initialize the monitor.
source code
 
init(self)
Init the monitor once.
source code
 
observe(self)
This should be done each self.tick ticks.
source code
 
center_on_lat_lon(self, lat, lon) source code
 
draw_point(self, id, lat, lon, radius, color, ttl=0) source code
 
draw_circle(self, id, center_lat, center_lon, radius, filled, color, ttl=0) source code
 
draw_rectangle(self, id, lat_bottom, lat_top, lon_left, lon_right, line_width, filled, color, ttl=0) source code
 
draw_text(self, id, lat, lon, offset_x, offset_y, font_size, color, text, ttl=0) source code
 
remove_object(self, type, id) source code
 
end(self)
This can be called after a simulation ends.
source code

Inherited from SimPy.Lib.Process: acquired, active, cancel, interrupt, interruptReset, interrupted, passive, queuing, start, stored, terminated

Inherited from SimPy.Lib.Process (private): _hold, _passivate

Inherited from SimPy.Lister.Lister: __repr__, __str__, attrnames

Inherited from list: __add__, __contains__, __delitem__, __delslice__, __eq__, __ge__, __getattribute__, __getitem__, __getslice__, __gt__, __iadd__, __imul__, __iter__, __le__, __len__, __lt__, __mul__, __ne__, __new__, __reversed__, __rmul__, __setitem__, __setslice__, __sizeof__, append, count, extend, index, insert, pop, remove, reverse, sort

Inherited from object: __delattr__, __format__, __reduce__, __reduce_ex__, __setattr__, __subclasshook__

Class Variables [hide private]

Inherited from SimPy.Lister.Lister: indent

Inherited from list: __hash__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, name, sim, tick, kwargs)
(Constructor)

source code 

Initialize the monitor.

tick specifies the duration in ticks between two monitoring actions. The monitor does something in Monitor.observe() every tick ticks. name is its name, sim is the simulation.

Parameters:
  • name - unique string name of monitor
  • sim - reference to simulation
  • tick - monitoring is done every tick ticks
  • kwargs - additional keyword arguments for monitor
Returns: new empty list
Overrides: object.__init__

observe(self)

source code 

This should be done each self.tick ticks.

The monitoring code: A monitor is a SimPy Process.

end(self)

source code 

This can be called after a simulation ends.

Only necessary if the monitor is supposed to do something after the simulation ended.