||Creation of Trains
||Depending on typeOfTrack, create on request (creNewTrain)
or periodically (every perToCreTrain) a new train. Increment noOfTrains.
After creating, send initTrain to the new train with the apporpiate
||setting period to create new trains
||Receive the new new period (perToCreTrain) via setPerToCreTrain.
||propagation the change of newSignalState to all trains
||If newSignalState receives, propagate the new value by sending
with the new state to all trains.
||receiving a new signal state
||Change signalState by receiving newSignalState.
||changing type of track
||By receiving setTypeOfTrack, the type of new trains changes
from regular to fast or vice versa, depending on the given parameter. Change
the value of typeOfTrack stop creating new trains, until the track
is empty. Set the period to the smallest acceptable value and, in case
of creationMode = period, create new trains (EnvTrackTask1).
||setting type of creation Mode
||Receive setTypeOfCreMode and set the creationMode to
the given value.
||train receives signal
||The receiving of sigReach implies, that a train has stop at
(signalState is stop) or has passed (signalState is go) sig1.
Send newTrain to trainSens1.
||train leaves gate
||Receiving trainPassed signals that a train has left the gate.
Decrement noOfTrains. Send newTrain to trainSens2.
||after creation of a track, wait for the signal initTrack. Set
creationMode, and perToCreTrain to the given values. Send
getSignalState, wait for the reply (newSignalState) and store
the value in sigState.