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

Class ChildprocessPlayerChamplainMonitor

source code


Output of simulation to player.py via internal pipe to subprocess.

Usage example: python random_wiggler.py


Author: B. Henne

Instance Methods [hide private]
new empty list
__init__(self, name, sim, tick, kwargs)
Inits the monitor and the subprocess.
source code
 
init(self)
Activates the monitor.
source code
 
observe(self)
Pipes init data, person ids and coordinates to subprocess.
source code
 
write(self, output)
Write to player.py subprocess.
source code
 
flush(self)
Flush output to player.py subprocess.
source code

Inherited from EmptyMonitor: center_on_lat_lon, draw_circle, draw_point, draw_rectangle, draw_text, end, remove_object

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]
  FORMAT = '<BIII'
struct.pack format of Person information
  FORMAT_LEN = 13
length of FORMAT in bytes
  start_tick = 0
monitor starts with this tick

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 

Inits the monitor and the subprocess.

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__

init(self)

source code 

Activates the monitor.

Overrides: EmptyMonitor.init

observe(self)

source code 

Pipes init data, person ids and coordinates to subprocess.

Overrides: EmptyMonitor.observe