ObjectType
Document
DocName |
Project |
Version |
FullName |
ShortDescription |
EnvTrain |
RailwayCrossing |
V12 |
Environment train |
|
|
Description
A train, once it has entered the railway crossing area, can reside
in one of three different zones (as shown in Fig. 1): The first one is
between the outside and the approaching sensor ts1, the second one describes
the way from ts1 to the signal, and the third one is defined by the stretch
from the signal to the leaving sensor ts2, including the gate.
Fig. 1: The Railway Crossing Area
All distances have been mapped to durations, which allows the straightforward
use of timers for simulating the trains. This means e.g. that the distance
between the approaching sensor ts1 and the signal is mapped to the duration
ts1SigDur.
Each train knows of its succeeding train, such that the succeeding train
can be notified of the current train's stopping or restarting activities.
The trains will all stop with a minimal distance between them, if not in
the meantime the preceding train restarts. |
|
Components
ModelName |
Number |
Type |
Version |
|
|
|
|
|
Tasks
ModelName |
Description |
Strategy |
StrategyType |
RealizedRequirement |
EnvTrainTask1 |
Creation of a train |
After the creation a train, switch to the mode init (curMode).
Then, receive initTrain and set the durations (i.e. values for approaching
the ts1 (ts1Dur), ts1SigDur and sigTS2Dur; set the
duration of the breaking phase (breakDur), the minimum distance
duration (minDistDur)). Further, set the current signal state (sigState).
Finally, switch to appGo. |
f |
|
EnvTrainTask7 |
getting a new sequencing train |
If a train gets a new sequencing train, i.e. another train has been
created after the current train has been initialized, (newSeqTrain),
store its name (seqTrain). If curMode is appStop, trainStop
or sigStop, immediately notify the sequencing train of this trains current
position, relative to the signal, by sending newTrainStop. |
f |
|
EnvTrainTask8 |
notifying the sequencing trains |
If curMode changes to appGo, sigGo, or gateGo, send newTrainStart
to seqTrain. If curMode changes to appStop or sigStop, send
newTrainStop
with the current position, relative to the signal. |
f |
|
EnvTrainTask9 |
preceding train stops |
The receiving of newTrainStops signals the stopping of the preceding
train. The parameter is the current position of this train. This position
plus breakDur plus minDistDur is the position, the train
has to stop. Compute the distance to this point. After reaching this position,
switch curState to appStop (if the train has not yet reached
ts1) or otherwise to trainStop. |
f |
|
EnvTrainTask10 |
preceding trains starts |
The receiving of newTrainStarts signals the new movement of
the preceding train. After breakDur, start moving and change curState
to appGo or sigGo. |
f |
|
EnvTrainTask2 |
Approaching the ts1 |
If curMode changes to appGo, start counting down ts1Dur.
If curMode changes to appStop, stop counting down ts1Dur. |
f |
|
EnvTrainTask3 |
Reaching the ts1 |
If ts1Dur becomes zero, switch curMode to sigGo.
Notify the track of the reaching via sending trainArrived. |
f |
|
EnvTrainTask11 |
Approaching the signal |
If curMode changes to sigGo, start counting down ts1SigDur-breakDur. |
f |
|
EnvTrainTask12 |
Reaching the signal |
If ts1SigDur-breakDur becomes zero, switch curMode to
gateGo or sigBreak, depending on sigState. |
f |
|
EnvTrainTask13 |
Receiving current signal state |
If curMode is not sigBreak or sigStop, receive newSignalState
and set sigState to the given value. |
f |
|
EnvTrainTask6 |
Passing the signal |
If curMode is sigStop or sigBreak, wait for newSignalState
with a go. After breakDur, switch to gateGo. |
f |
|
EnvTrainTask5 |
Passing the gate |
If curMode changes to gateGo, compute the distance to ts2 by
adding the current distance to the signal (the remaining part of ts1SigDur)
to sigTs2Dur and begin counting down this duration. If it
becomes zero, send trainPassed to the track and terminate. |
f |
|
EnvTrainTask4 |
computing the current position, relative to the signal |
If curMode is appGo or appStop, the current position is computed
by ts1SigDur + the remaining part of ts1Dur. If curMode
is sigGo, sigStop, trainStop, the postion is the remaining part of ts1SigDur. |
f |
EnvTrainTask7, EnvTrainTask8, EnvTrainTask9 |
EnvTrainRepTask14 |
Reporting current state periodically |
Every second, report the following values to the ProtoCtrl by calling
putPanelVal,
if one of those has changed: instanceName; current position, relative
to ts2; current state (halt, go); train type; the duration: creation time-current
time. |
f |
|
|
Attributes
ModelName |
FullName |
Type |
Value |
Tasks |
Usage |
Description |
ts1Dur |
approach duration |
Duration |
0 |
EnvTrainTask1, EnvTrainTask2 |
w |
duration to reach the ts1 |
|
|
|
|
EnvTrainTask3, EnvTrainTask5, EnvTrainTask4 |
r |
|
ts1SigDur |
signal duration |
Duration |
0 |
EnvTrainTask1, EnvTrainTask11, EnvTrainTask4 |
w |
duration from ts1 to signal |
|
|
|
|
EnvTrainTask12 |
r |
|
sigTs2Dur |
passing duration |
Duration |
0 |
EnvTrainTask1, EnvTrainTask5 |
w |
duration from the signal to ts2 |
breakDur |
breaking duration |
Duration |
0 |
EnvTrainTask1 |
w |
duration that is needed to break |
|
|
|
|
EnvTrainTask9, EnvTrainTask10, EnvTrainTask11, EnvTrainTask12, EnvTrainTask6 |
r |
|
minDistDur |
minimum distance duration |
Duration |
0 |
EnvTrainTask1 |
w |
minimum time difference between two trains |
|
|
|
|
EnvTrainTask9 |
r |
|
sigState |
signal state |
SignalStateType := Enum (go, halt) |
halt |
EnvTrainTask1, EnvTrainTask13, EnvTrainTask6 |
w |
current state of the signal |
|
|
|
|
EnvTrainTask12 |
r |
|
curMode |
current mode |
Enum (init, appGo, appStop, sigStop, trainStop, sigGo, gateGo, sigBreak) |
init |
EnvTrainTask1, EnvTrainTask9, EnvTrainTask10, EnvTrainTask3, EnvTrainTask12 |
w |
|
|
|
|
|
EnvTrainTask7, EnvTrainTask8, EnvTrainTask2, EnvTrainTask11, EnvTrainTask13,
EnvTrainTask6, EnvTrainTask5, EnvTrainTask4 |
r |
|
seqTrain |
sequenced train |
CharString |
'' |
EnvTrainTask7 |
w |
names the sequencing train |
|
|
|
|
EnvTrainTask8 |
r |
|
|
Signals
ModelName |
FullName |
Parameters |
Tasks |
Usage |
Description |
SignalPaths |
newTrainStart |
|
CharString |
EnvTrainTask8 |
p |
Parameters:
Receiver |
|
|
|
|
EnvTrainTask10 |
c |
|
|
newTrainStop |
|
CharString, Duration |
EnvTrainTask7 |
p |
Parameters:
Receiver,
current position, relative to the signal |
|
|
|
|
EnvTrainTask9 |
c |
|
|
trainArrived |
|
CharString |
EnvTrainTask3 |
p |
Parameters:
Sender |
|
initTrain |
|
CharString, TrackDurationType, SignalStateType |
EnvTrainTask1 |
c |
Parameters:
Instancename, (. ts1Dur, ts1SigDur, sigTs2Dur,
breakDur,
minDistDur .), sigState |
|
newSignalState |
|
CharString, SignalStateType |
EnvTrainTask13, EnvTrainTask6 |
c |
Parameters:
Instancename, signalState |
|
trainPassed |
|
CharString |
EnvTrainTask5 |
p |
Parameters:
Sender |
|
newSeqTrain |
|
CharString, CharString |
EnvTrainTask7 |
c |
Parameters:
instanceName, seqTrainName |
|
|