The 2 entities should also be able do some activities in regular intervals.
The station should be able to determine the time of the the execution of
the action common_action
. The MoDeST-model:
01 action do_something,also_do_something,common_action; 02 process coordinator() { 03 do{ 04 ::do_something; common_action;do_something 05 } 06 } 07 process station() 08 { 09 clock timer; 10 do{ 11 ::also_do_something; 12 when(timer==5) common_action{=timer=0=} 13 } 14 } 15 par{ 16 ::coordinator() 17 ::station() 18 }
The process station()
has a clock that is called timer
.
It starts running from 0 linear with the time. If it reaches 5 the process is ready to synchronize.
If at the same time the process coordinator()
is also ready, then they proceed together.
If the process station()
executes the action common_action
,
it also executes the assignment timer=0
at the same time in one step.
The clock starts again running from 0 linear with the time.