Page tree

Versions Compared

Key

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

...

Mutual Exclusion

Normal segments

For each block we generate one mutex controller, similar to the following pattern.

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

...

A train must not enter a segment or alter the settings of a segment without holding the lock for the segment. No exceptions from this rule are allowed.

...

To prevent collisions on the track, a special controller manages the right rights to enter or leave the Kicking Horse Pass.

The controller splits the pass into two parts, left and right, corresponding to the track layout chart. (Simplified track layout)

We allow two trains in one directionEach 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 space for the next train.

Train controller

Each train controller is set in a separate region with a referenced state. This state has the following interface

    input int *_perm;         # All permission variables (Tracks)
input bool *_perm # KH permission variables
  input int trainNum;
    input bool cleanup;
input bool debug;
output bool *_req[]; # All request variables

The train controller is composed of several Station-2-Station controllers. These are combined to form a complete schedule. Additionally the cleanup signal has to be watched to abort the schedule and return back to the initial position.

Station-2-Station controller

Each station-2-station controller realizes the movement from one of the stations (IC,OC,KH) to a second station. All controllers using IC or OC parts have to respect the traveling directions. For the Kicking Horse Pass two separate controllers, forwards and backwards, are used.

The controllers starting from Kicking Horse Pass Station make an assumption of the direction the train is standing. These are dependent of the directions of the inner or outer circle, e.g. the KHIC controller starts backwards because this is the only valid direction to travel this path. To drive a train from the Kicking Horse Station (facing forward) to the Inner Circle we have to combine the KHOC and OCIC controllers.