NDD Transit RuleTransit Rule
Overview
Transit rules define conditional activities that are triggered based on the cumulative state of a dimension during a vehicle’s route. A common use case is modelling mandatory rest breaks after a certain number of hours of driving. Transit rules are assigned to vehicle classes or individual vehicles.
Applicable models
- NDD
ndd-cmibu6krtqja
TransitRule
Schema definition
message TransitRule {
required string id = 1;
required string dimensionId = 2;
optional bool useStandingState = 3 [default = true];
optional bool useTransitState = 4 [default = false];
required string ruleIdPrefix = 5;
repeated Trigger triggers = 6;
}Fields
- id
- A unique identifier for this transit rule.
- dimensionId
- The dimension on which this rule is evaluated.
- useStandingState
- Whether the rule considers the cumulative dimensional value at stops (standing state). Defaults to
true. - useTransitState
- Whether the rule considers the cumulative dimensional value during transit. Defaults to
false. - ruleIdPrefix
- A prefix applied to the rule identifiers generated in the solution response. This allows multiple triggers from the same rule to be distinguished.
- triggers
- A list of triggers that define the threshold values and quantities applied when the rule is activated.
Examples
A rest-break rule that triggers a 30-minute break after every 4.5 hours of driving:
id: "rest-break"
dimensionId: "time"
useStandingState: true
useTransitState: true
ruleIdPrefix: "break"
triggers {
value: 270
quantity: 30
}Transit Rule Trigger
A trigger defines the threshold at which a transit rule is activated and the quantity that is applied.
Schema definition
message Trigger {
required float value = 1;
required float quantity = 2;
}Fields
- value
- The cumulative dimensional value at which this trigger activates.
- quantity
- The quantity that is applied to the dimension when the trigger activates. In the context of a rest-break rule on the time dimension, this represents the duration of the break.
Notes
- Multiple triggers can be defined on a single transit rule to model escalating rest requirements.
- Transit rules are evaluated during the optimisation process and their effects are reported in the solution response as transit rule attributes.