Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

For each controlled train one state and the corresponding transitions are added.

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 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 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.

...