6 typedef unsigned short TrainIx;
7 typedef unsigned short SegmentIx;
8 typedef unsigned short Distance;
9 typedef unsigned char Speed; /* non-negative, units of 4mm/s */
14 justarrived:1, /* is stopped just after triggering foredetect segment */
15 reverse:1; /* train is moving backwards wrt its own front and back */
21 present_now:1, present_future:1, /* owning train is or will use space */
22 detectable_now:1, detectable_future:1, /* owning train draws current */
23 reverse:1, /* owning train's motion is (would be) backwards wrt track */
24 sideways:1, /* for segment with points, points are set to `alternative' */
25 autostop:1; /* owning train is slow and should stop on detection */
38 SegmentLink backwards, forwards, sideways;
44 const Distance *detections; /* incremental distances from rear */
49 TrainState trasNUM_TRAINS];
50 SegmentState segs[NUM_SEGMENTS];