modelExecutionPaths

Example to demonstrate parallel and alternative execution paths

Extends from Modelica.Icons.Example (Icon for runnable examples).

Information

This is an example to demonstrate in which way parallel activities can be modelled by a StateGraph. When transition1 fires (after 1 second), two branches are executed in parallel. After 6 seconds the two branches are synchronized in order to arrive at step6.

Before simulating the model, try to figure out whether which branch of the alternative sequence is executed. Note, that alternatives have priorities according to the port index (alternative.split[1] has a higher priority to fire as alternative.split[2]).

Components

TypeNameDefaultDescription
InitialStepstep0
Transitiontransition1
Stepstep1
Transitiontransition2
Stepstep6
Stepstep2
Transitiontransition3
Transitiontransition4
Stepstep3
Stepstep4
Transitiontransition5
Transitiontransition6
Stepstep5
Modelica.Blocks.Sources.RealExpressionsetReal
TransitionWithSignaltransition7
Modelica.Blocks.Sources.BooleanExpressionsetCondition
Transitiontransition4a
Stepstep4a
Transitiontransition6a
Modelica.Blocks.Interaction.Show.RealValueNumericValue1
Alternativealternative
ParallelParallel1
StateGraphRootstateGraphRoot