RootDEVS¶
- class pypdevs.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)
- 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
- redoDirectConnection(ports)[source]¶
Redo direct connection for a specified port, and all ports connected to it.
- Parameters
ports – the ports that have changed.
- 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