xsimlab.RuntimeSignal

class xsimlab.RuntimeSignal(value)

Signal controlling simulation runtime.

Such signal may be returned either by runtime methods of process() decorated classes or by runtime_hook() decorated functions or methods.

All signals listed below are ordered from the lowest to the highest priority. If multiple signals are emitted at the same time during a simulation, the one with the highest priority prevails.

One signal may affect the simulation workflow in different ways, depending on whether it is returned during the execution of a simulation stage (process-level) or just before/after a stage (model-level).

NONE

Do nothing (blank signal). Used by default when a process runtime method or a hook function doesn’t explicitly return a value. Priority = 0.

Type

int

SKIP

If returned by a pre-hook function, skip the current process (process-level) or the current simulation stage (model-level). Otherwise do nothing. Priority = 1.

Type

int

CONTINUE

Skip the current process or current simulation stage (pre-hook). When returned by a model-level hook function in a looped simulation stage (e.g., run_step), also skip all remaining simulation stages (e.g., finalize_step) at the current step and continues the simulation at the next step. Priority = 2.

Type

int

BREAK

Skip the current process or current simulation stage (pre-hook). Also skip all remaining processes in a simulation stage (process-level) or all remaining steps in looped simulation stages (model-level). Priority = 3.

Type

int

__init__()

Initialize self. See help(type(self)) for accurate signature.

Attributes

BREAK

Skip all remaining processes or steps.

CONTINUE

Skip all the remaining stages of the current step.

NONE

Do nothing (blank signal).

SKIP

Skip the current process or simulation stage.