Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: updated figure of Mutex_KH, fixed typo

...

A train must signal the wish to enter a segment by setting the variable bool <segment>_req[trainNum] to true.
The right to enter a segement is given to the train by setting the variable int <segment>_perm to the train number.
After leaving a segment the train must remove his its request by setting <segment>_req[trainNum] to false again.

For a free track the *_perm variable is set to -1 and all tracks, apart from starting positions, are initialised initialized 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.

...

Each part has two operational modes, in and out, being active when trains are allowed to either enter or leave the pass. When entering the pass the controller counts the entering trains and only lets two trains enter (one after the other). When leaving the pass the trains are removed from the counter, making freeing space for the next train.

...