Multiple trains on a two-track station
Release of resources
In order to have multiple trains using the same routes at different times, resources need to be released
after one train has finished the route. We may use the release
statement inside a route to specify
one or more groups of resources which may be release, and which detector triggers the release.
modelentry ri from b1 {
exit sa
length 500.0
sections [] switches [] contains []
}
modelexit re1 to b2 {
entry s1x
entrysection a2
length 8000.0
sections [a2]
switches [] contains []
}
modelexit re2 to b2 {
entry s2
entrysection a2
length 8000.0
sections [a2]
switches [] contains []
}
route r1 {
entry sa exit s1
entrysection a1
length 600.0
sections [a1]
switches [sw1 left]
contains []
}
route r1x {
entry s1 exit s1x
entrysection a3
length 200.0
sections [a3]
switches []
contains []
}
route r2 {
entry sa exit s2
entrysection a1
length 800.0
sections [a1]
switches [sw1 right]
contains []
}
Dispatch
train t1 l=100.0 a=0.5 b=0.5 v=10.0 ri
route r1
wait 110.0
route r1x
train t2 l=100.0 a=0.5 b=0.5 v=10.0 ri
route r2
wait 130.0
route re2
route re1