IVR Transit rulesTransit rules
Overview
Transit rules provide a mechanism to model conditional rules which are linked to the cumulative value on a dimension at some point in the schedule. Typical examples of this are lunch breaks or fatigue rules for line haul modelling.
Applicable models
- IVR7
ivr7-kt461v8eoaif
- IVR8
ivr8-yni1c9k2swof
Transit Rule
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
- The unique identifier for this transit rule. Duplicate identifiers across transit rules specified in a model will results in an invalid payload.
- dimensionId
- The dimension to which this transit rule should be applied.
- useStandingState
- Whether the standing state of a transaction in the schedule may be used to perform the transit rule (if triggered). Standing states are incurred at a location after arrival, before departure or between tasks at the same location.
- useTransitState
- Whether the transit state of a transaction in the schedule may be used to perform the transit rule (if triggered). Transit states are incurred when moving between locations.
- ruleIdPrefix
- A naming prefix provided which is used to label transactions where the transit rule has been effected. This is useful when a transit rule may be triggered multiple times (depending on the context). The
ruleIdPrefix
will prefix each triggered transaction with theid
provided by the user. It is recommended that this prefix be unique for each rule type applied to ensure that the results returned in the solution response are easily interpretable. - triggers
- A list of triggers which should be monitored to indicate when the transit rule should be applied.
Examples
This sample provides an example of a typical fatigue break which has two triggers linked to the time dimension (measured in minutes). The first break is performed for 60 minutes once the vehicle has cumulatively been assigned 720 minutes of work. The second trigger is performed at 16:00 and is a shorter break of 30 minutes. Both the standing and transit states may be used in order to execute the break. If the vehicle works less than 720 minutes neither the first nor second trigger are reached and, as a result, no breaks are scheduled.
id: "typical_fatigue_break"
dimensionId: "time"
useStandingState: true
useTransitState: true
ruleIdPrefix: "driver_breaks_"
triggers {
value: 720
quantity: 60
}
triggers {
value: 960
quantity: 30
}
Transit Rule Trigger
A transit rule trigger is the mechanism used to describe when the the transit rule should be applied. The transit rule monitors the cumulative instantaneous value of a dimension and when the dimension “crosses” the value specified for the rule. Once the value is crossed, the quantity specified in the trigger is then applied to the dimension.
Schema definition
message Trigger {
required float value = 1; // value at which this is cut
required float quantity = 2; // quantity that is applied
}
Fields
- value
- The value that when crossed indicates that the
quantity
should be applied to the parent dimension. - quantity
- The quantity that should be applied to the parent dimension each time the
value
is crossed.
Examples
This trigger is linked to a time dimension (measured in minutes) which configures a trigger which is linked to 12:00. A vehicle that implements this transit rule and has an activity which transitions the vehicle from morning to the afternoon will incur a 60 minute lunch break. Vehicles that work only a morning shift (i.e. finish before cumulatively working 720 minutes) will not reach the trigger value and thus not incur the lunch break.
value: 720
quantity: 60