Tracerestrict: Add a flag for whether slot conditionals are present
This commit is contained in:
@@ -2207,6 +2207,7 @@ class NIHTraceRestrict : public NIHelper {
|
||||
CA(TRAIN_NOT_STUCK)
|
||||
CA(CHANGE_COUNTER)
|
||||
CA(NO_PBS_BACK_PENALTY)
|
||||
CA(SLOT_CONDITIONALS)
|
||||
CA(SPEED_ADAPTATION)
|
||||
CA(PBS_RES_END_SIMULATE)
|
||||
CA(RESERVE_THROUGH_ALWAYS)
|
||||
|
@@ -1286,6 +1286,7 @@ CommandCost TraceRestrictProgram::Validate(const std::vector<TraceRestrictItem>
|
||||
|
||||
case TRIT_COND_TRAIN_IN_SLOT:
|
||||
case TRIT_COND_SLOT_OCCUPANCY:
|
||||
actions_used_flags |= TRPAUF_SLOT_CONDITIONALS;
|
||||
if (find_index(pbs_res_end_released_slots, GetTraceRestrictValue(item)) >= 0 || find_index(pbs_res_end_acquired_slots, GetTraceRestrictValue(item)) >= 0) {
|
||||
actions_used_flags |= TRPAUF_PBS_RES_END_SIMULATE;
|
||||
}
|
||||
@@ -1350,7 +1351,7 @@ CommandCost TraceRestrictProgram::Validate(const std::vector<TraceRestrictItem>
|
||||
case TRIT_SLOT:
|
||||
switch (static_cast<TraceRestrictSlotCondOpField>(GetTraceRestrictCondOp(item))) {
|
||||
case TRSCOF_ACQUIRE_WAIT:
|
||||
actions_used_flags |= TRPAUF_SLOT_ACQUIRE | TRPAUF_WAIT_AT_PBS;
|
||||
actions_used_flags |= TRPAUF_SLOT_ACQUIRE | TRPAUF_SLOT_CONDITIONALS | TRPAUF_WAIT_AT_PBS;
|
||||
break;
|
||||
|
||||
case TRSCOF_ACQUIRE_TRY:
|
||||
@@ -1367,7 +1368,7 @@ CommandCost TraceRestrictProgram::Validate(const std::vector<TraceRestrictItem>
|
||||
break;
|
||||
|
||||
case TRSCOF_PBS_RES_END_ACQ_WAIT:
|
||||
actions_used_flags |= TRPAUF_PBS_RES_END_SLOT | TRPAUF_PBS_RES_END_WAIT;
|
||||
actions_used_flags |= TRPAUF_PBS_RES_END_SLOT | TRPAUF_PBS_RES_END_WAIT | TRPAUF_SLOT_CONDITIONALS ;
|
||||
if (find_index(pbs_res_end_released_slots, GetTraceRestrictValue(item)) >= 0) actions_used_flags |= TRPAUF_PBS_RES_END_SIMULATE;
|
||||
include(pbs_res_end_acquired_slots, GetTraceRestrictValue(item));
|
||||
break;
|
||||
|
@@ -470,6 +470,7 @@ enum TraceRestrictProgramActionsUsedFlags {
|
||||
TRPAUF_TRAIN_NOT_STUCK = 1 << 11, ///< Train is not stuck
|
||||
TRPAUF_CHANGE_COUNTER = 1 << 12, ///< Change counter value is present
|
||||
TRPAUF_NO_PBS_BACK_PENALTY = 1 << 13, ///< No PBS back penalty is present
|
||||
TRPAUF_SLOT_CONDITIONALS = 1 << 14, ///< Slot conditionals are present
|
||||
TRPAUF_SPEED_ADAPTATION = 1 << 15, ///< Speed adaptation control
|
||||
TRPAUF_PBS_RES_END_SIMULATE = 1 << 16, ///< PBS reservations ending at this signal slot changes must be fully simulated in dry run mode
|
||||
TRPAUF_RESERVE_THROUGH_ALWAYS = 1 << 17, ///< Reserve through action is unconditionally set
|
||||
|
Reference in New Issue
Block a user