6 typedef unsigned short TrainNum;
7 typedef unsigned short SegmentNum;
8 typedef unsigned short LocationNum;
9 typedef short TimeInterval;
10 typedef short Distance;
11 typedef char Speed; /* non-negative, units of 4mm/s */
14 SegmentNum foredetect;
16 justarrived:1, /* is stopped just after triggering foredetect segment */
17 backwards:1; /* train is moving backwards wrt its own front and back */
23 owned:1, /* this track segment is reserved for a train */
24 owner_backwards:1, /* train's motion is (would be) backwards wrt track */
25 pt_sideways:1, /* points are set to `alternative'. (no points?: 0) */
26 autostop:1, /* owning train is slow and wants to stop on detection */
27 tr_updated:1; /* for use by safety_train_changed etc.; otherwise 0 */
28 TimeInterval until_here, /* ) nonnegative; */ /* ) always valid but */
29 until_detect; /* ) 0 if already */ /* ) only meaningful */
30 TrainNum owner; /* ) iff owned */
42 SegmentLink backwards, forwards, sideways;
47 Distance tail, detectable, head;
50 extern const TrainInfo info_train[NUM_TRAINS];
51 extern const SegmentInfo info_segment[NUM_SEGMENTS];
54 TrainState tras[NUM_TRAINS];
55 SegmentState segs[NUM_SEGMENTS];