Package mosp :: Module group :: Class Message
[hide private]
[frames] | no frames]

Class Message

source code


Encapsulates a single methods that will be executed by the simulation.

For example used to implement Person interaction/communication as the zombie infect.


Author: F. Ludwig

Instance Methods [hide private]
 
__init__(self, func, args, kwargs, delay)
Initializes Message object and schedules it for execution by mosp.core.Simulation.run()
source code
 
__call__(self)
If Message is finally called, execute self.func with its arguments and keyword arguments
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  sim = None
the simulation this Message will be executed by (in mosp.core.Simulation.run)
Instance Variables [hide private]
  func
method to be called
  args
arguments for self.func
  kwargs
keyword arguments for self.func
  time
execution time of self.func
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, func, args, kwargs, delay)
(Constructor)

source code 

Initializes Message object and schedules it for execution by mosp.core.Simulation.run()

Parameters:
  • func - method to be executed if this Message is called
  • args - arguments for func
  • kwargs - keyword arguments for func
  • delay - tick delay before func is called
Overrides: object.__init__