typedef unsigned short TrainNum;
typedef unsigned short SegmentNum;
typedef unsigned short LocationNum;
+typedef unsigned short MovPosComb;
+typedef unsigned char Small;
typedef short TimeInterval;
typedef short Distance;
typedef char Speed; /* non-negative, units of 4mm/s */
unsigned
owned:1, /* this track segment is reserved for a train */
tr_backwards:1, /* train's motion is (would be) backwards wrt track */
- pt_sideways:1, /* points are set to `alternative'. (no points?: 0) */
- pt_moving:1, /* points have been told to change to pt_sideways */
+ movfeat_moving:1, /* feature(s) have been told to change to movposcomb */
cm_autostop:1, /* train should stop on detection */
- cm_pointchange:1, /* points should change when they can */
seg_inverted:1, /* polarity is inverted */
tr_updated:1; /* for use by safety.c:lay_train etc.; otherwise 0 */
TimeInterval until_here, /* ) nonnegative; */ /* ) always valid but */
until_detect; /* ) 0 if already */ /* ) only meaningful */
TrainNum owner; /* ) iff owned */
+ MovPosComb movposcomb;
/*polarity?*/
} SegmentState;
typedef struct {
unsigned next_backwards:1;
SegmentNum next;
- Distance dist;
} SegmentLinkInfo;
typedef struct {
- unsigned invertible:1;
- SegmentLink backwards, forwards, sideways;
const char *pname;
+ Small posns;
+ MovPosComb weight;
+} MovFeatInfo;
+
+typedef struct {
+ SegmentLinkInfo backwards, forwards;
+ Distance dist;
+} SegPosCombInfo;
+
+typedef struct {
+ const char *pname;
+ unsigned invertible:1;
+ Small n_movfeats;
+ const MovFeatInfo *movfeats;
+ MovPosComb n_poscombs;
+ const SegPosCombInfo *poscombs;
} SegmentInfo;
typedef struct {