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

Class RecordFilePlayerMonitor

source code


Records output for player.py in a file to playback later.

Usage example: python random_wiggler.py and later: slowcat.py -d .02 < simoutputfile | python player.py


Author: B. Henne

Instance Methods [hide private]
new empty list
__init__(self, name, sim, tick, kwargs)
Inits the monitor and opens the file.
source code
 
init(self)
Starts the monitor.
source code
 
observe(self)
Writes init data, person ids and coordinates.
source code
 
write(self, output)
Write to file self.f
source code
 
flush(self)
Flush output to file self.f
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'
  FORMAT_LEN = 13
  start_tick = 0

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 opens the file.

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 

Starts the monitor.

Overrides: EmptyMonitor.init

observe(self)

source code 

Writes init data, person ids and coordinates.

Overrides: EmptyMonitor.observe