The Train System - The Protocol

by R.Popplestone

Grammatical Conventions.

Non-terminal symbols are enclosed in angle brackets, repeated items are enclosed in curlies.

Messages


    BL(ID:BLOCK <int>;Loc:<int>,<int>)
Starts a block definition.
    AS(ID:<ident>; Points:{<int,int>})
Adds a track-segment to a block.
    AJ(ID:<ident>; Open:<int>,<int>; Closed:<int>,<int>)
Adds a bifurcation-junction to a block.
    AI(ID:<ident>; Point:<int>,<int>; Angle:<int>)
Adds an infrared detector to a Block
    BE
Ends a block definition.
    UB(BLOCK <int>; <boolean>)
Updates the track-circuit detector of a block.
    UI(<ident>; <boolean>)
Updates the state of an infrared detector.
    UJ(<ident>; <boolean>)
Updates the state of a bifurcation junction.
    RT (<TrainId> <Communicator> < Power> <Exit> <Switches>)
Says how a train is to be routed.
    PL (<Block> <TrainId> <TrainState>)
Says how trains are to be initially placed.
    GO()
Initiates execution.
    RQ(<TrainId> <TrainState>)
Requests a track-section for a train.
    AC(<TrainId>)
Accepts a request.

Notes

An infrared detector needs to be located on a line/segment.

We need ways of inserting junctions between all segments, and relating junctions to the segments they connect.