6 typedef unsigned short TrainIx;
7 typedef unsigned short SegmentIx;
8 typedef unsigned short LocationIx;
9 typedef short Distance;
10 typedef char Speed; /* non-negative, units of 4mm/s */
15 justarrived:1, /* is stopped just after triggering foredetect segment */
16 reverse:1; /* train is moving backwards wrt its own front and back */
22 present_now:1, present_future:1, /* owning train is or will use space */
23 detectable_now:1, detectable_future:1, /* owning train draws current */
24 reverse:1, /* owning train's motion is (would be) backwards wrt track */
25 sideways:1, /* for segment with points, points are set to `alternative' */
26 autostop:1, /* owning train is slow and wants to stop on detection */
27 updated:1; /* for use by safety_train_changed etc.; otherwise 0 */
39 SegmentLink backwards, forwards, sideways;
44 Distance tail, detectable, head;
49 TrainState trasNUM_TRAINS];
50 SegmentState segs[NUM_SEGMENTS];