Show last authors
1 We compose our railway controller from several train controllers, combined with controllers for mutual exclusion.
2
3 == Mutual Exclusion ==
4
5 === Normal segments ===
6
7 For each block we generate one mutex controller, similar to the following pattern.
8
9 [[image:attach:Mutex.png]]
10
11 For each controlled train one state and the corresponding transitions are added.
12
13 For a free track the *_perm variable is set to -1 and all tracks, apart from starting positions, are initialised with -1. For the starting positions the *_perm variables are set to the corresponding train number and the *_req variable for the train is set to true.
14
15 **A train must not enter a segment without holding the lock for the segment. No exceptions from this rule are allowed.**
16
17 === Kicking Horse Pass ===
18
19 To prevent collisions on the track, a special controller manages the right to enter the Kicking Horse Pass.
20
21 [[image:attach:Mutex_KH.png]]
22
23 The controller splits the pass into two parts, left and right, corresponding to the track layout chart. [[(Simplified track layout)>>url:http://www.informatik.uni-kiel.de/~~railway/Downloads/kscheme.pdf||shape="rect"]]
24
25 We allow two trains in one direction