RootDEVS

class DEVS.RootDEVS(components, models, scheduler_type)[source]

The artificial RootDEVS model is the only ‘coupled’ model in the simulation after direct connection is performed.

__init__(components, models, scheduler_type)[source]

Basic constructor.

Parameters:
  • components – the atomic DEVS models that are the cildren, only those that are ran locally should be mentioned
  • models – all models that have to be passed to the scheduler, thus all models, even non-local ones
  • scheduler_type – type of scheduler to use (string representation)
directConnect()[source]

Perform direct connection on the models again

fetchActivity(time, activities)[source]

Fetch the activity of the model up to a certain time

Parameters:
  • time – the time up to which the activity should be calculated
  • activities – dictionary containing all activities for the models
revert(time, memorize)[source]

Revert the coupled model to the specified time, all submodels will also be reverted.

Parameters:
  • time – the time up to which revertion should happen
  • memorize – whether or not the saved states should still be kept for memoization
setGVT(gvt, activities, last_state_only)[source]

Sets the GVT of this coupled model

Parameters:
  • gvt – the time to which the GVT should be set
  • activities – dictionary containing all activities for the models
  • last_state_only – whether or not to use the last state for activity
setScheduler(scheduler_type)[source]

Set the scheduler to the desired type. Will overwite the previously present scheduler.

Parameters:scheduler_type – type of scheduler to use (string representation)
setTimeNext()[source]

Reset the timeNext

undoDirectConnect()[source]

Undo the work of direct connection. It basically doesn’t do anything except for marking the direct connected version as ‘dirty’.