Package mosp :: Module controller
[hide private]
[frames] | no frames]

Module controller

source code

External-controllable simulation and a controller to couple multiple MoSP simulations.


Author: B. Henne, P. Tute

Contact: henne@dcsec.uni-hannover.de

Copyright: (c) 2010-2012, DCSec, Leibniz Universitaet Hannover, Germany

License: GPLv3

Classes [hide private]
  Controller
Controller to connect and coordinate simulations.
  Ticker
Ticker class to stop the simulation from doing more than one tick at a time.
  SimulationControlled
The MoSP Simulation, extended for use with an external controller.
Functions [hide private]
 
handle(code) source code
Variables [hide private]
  HANDLERS = {}
  QUIT = '\x00'
Signal for simulations to end
  GET_MODE = '\x01'
Signal to initialize getting data from simulations
  PUT_MODE = '\x02'
Signal to intitialize putting data to simulations
  STEP = '\x03'
Signal to let simulations do a number of steps
  IDENT = '\x04'
Signal to let simulations identify themselves
  REGISTER = '\x05'
Signal to register simulations at another simulation
  STEP_DONE_GOT_DATA = '\xf9'
Signal used by simulation to signal all demanded steps are done and data should be send
  STEP_DONE = '\xfa'
Signal used by simulation to signal all demanded steps are done
  SIM_ENDED = '\xfb'
Signal used by simulations to signal that they have ended (prematurely)
  ACK = '\xfc'
ACK for messages
  FIELD_SEP = '\xfd'
Seperates fields within one message
  MSG_SEP = '\xfe'
Seperates messages within one message-blob
  MSG_END = '\xff'
Signals end of message-blob
  SIM_TIMEOUT = 120
Timeout, after which simulations are considered dead when waiting for STEP_DONE
  TICK_DELAY = 0.01
Delay between each tick.
  __package__ = 'mosp'
Variables Details [hide private]

TICK_DELAY

Delay between each tick. Mainly used to avoid too fast sending of messages when using a monitor.

Value:
0.01