IVR VehicleVehicle
Overview
Vehicles are the active resources in a schedule. The goal of the optimiser is to find an allocation of tasks to vehicles, and a sequence within each vehicle of the tasks assigned to it, that minimises the total cost. Without vehicles, there can be no schedule.
In the simplest case there may be a single vehicle. In a more complex case, there could be many vehicles, and our goal is to choose the most cost effective vehicles among them.
Applicable models
- IVR7
ivr7-kt461v8eoaif - IVR8
ivr8-yni1c9k2swof
Vehicle
Schema definition
message Vehicle {
required string id = 1;
required string classId = 2;
required string costClassId = 3;
required Shift shift = 4;
repeated Capacity capacities = 5;
repeated string transitRuleIds = 6;
optional string compartmentSetId = 7; // IVR 8
}Fields
- id
- The unqiue identifier for a vehicle. Duplicate vehicle id’s within a model will result in an error being returned by the API.
- classId
- The vehicle class assigned to this vehicle. The class id should correspond to a provided vehicle class object on the model instance.
- costClassId
- The vehicle cost class assigned to this vehicle. The cost class id should correspond to a provided vehicle cost class object on the model instance.
- shift
- The shift describes the start and end restrictions on this vehicle instance. It is typical to specify return time constraints on a vehicle which indicate the maximum duration of a particular vehicle-shift and the location where the vehicle is required to start and end its shift.
- capacities
- The list of dimension capacities available to this vehicle instance. If empty, there are no capacity constraints on this particular vehicle.
- transitRuleIds
- The optional transit rule assigned to this vehicle. If a transit rule has been associated with the vehicle class the specified transit rule on a vehicle level will override the vehicle class transit rule.
- compartmentSetId
- The compartment set id assigned to this vehicle. If omitted, no compartment set is defined for the vehicle (default). If a compartment set has been associated with the vehicle class, the specified compartment set on an individual vehicle level will override the vehicle class compartment set.
Examples
This example demonstrates how a two tonne vehicle (capacity dimension in Kg’s) can be configured to begin and end its day at the Guiness Storehouse. The shift has a hard-constraint of starting no earlier than 07:00 and returning no later than 18:00 (time dimension measured in minutes).
id: "v-1"
classId: "vc1"
costClassId: "vcc1"
shift {
shiftStart {
locationId: "Guinness Storehouse"
attributes {
dimensionId: "time"
quantity: 0
windows {
start: 420
end: 1080
}
}
}
shiftEnd {
locationId: "Guinness Storehouse"
attributes {
dimensionId: "time"
quantity: 0
windows {
start: 420
end: 1080
}
}
}
}
capacities {
dimensionId: "capacity"
capacity: 2000
}In this example there is a vehicle class named vc1 which determines the speed and interactions of this vehicle instance against the network. The costing of the vehicle movements are determined by vcc1, the vehicle cost class assigned to this vehicle instance. The vehicle class and cost class are always required to correctly configure a vehicle. The capacity constraints for a vehicle are optional as well as the associated transit rules (advanced usage).
Vehicle Shift
A vehicle shift provides a mechanism to define the start and end characteristics for a vehicle.
Schema definition
message Shift {
required Task shiftStart = 1;
optional Task shiftEnd = 2;
}Fields
- shiftStart
- The start of the vehicle shift.
- shiftEnd
- The end of the vehicle shift. If omitted, the shiftStart is assumed to apply to the shiftEnd.
Examples
This example illustrates a shift start that is at a different location to the end shift. This means that if the vehicle is used in the schedule, it should start at the Guiness Storehouse and end at St Stephen’s Green.
shiftStart {
locationId: "Guinness Storehouse"
attributes {
dimensionId: "time"
quantity: 0
windows {
start: 420
end: 480
}
}
}
shiftEnd {
locationId: "St Stephen's Green"
attributes {
dimensionId: "time"
quantity: 0
windows {
start: 0
end: 1080
}
}
}This next example illustrates a vehicle shift which omits the vehicle end shift. This means that the vehicle is required to return to the Guiness Storehouse after its last visit and return before 18:00 (time dimension measured in minutes).
shiftStart {
locationId: "Guinness Storehouse"
attributes {
dimensionId: "time"
quantity: 0
windows {
start: 420
end: 1080
}
}
}Vehicle Task
The vehicle.Task definition is used to characterise the details of a vehicle shift.
Schema definition
message Task {
required string locationId = 1;
repeated Attribute attributes = 2;
}Fields
- locationId
- The location id for the vehicle task.
- attributes
- A list of attributes to be applied to the vehicle task. This may include aspects such as time or capacity windows which are specific to the vehicle-location combination.
Examples
This example illustrates a valid shift (either start or end) which occurs at the Guiness Storehouse location. There are no time window constraints on the shift. This would be the type of shift used to model a TSP and is the minimum requirement for a shift:
locationId: "Guinness Storehouse"Vehicle Task Attibute
The vehicle.Task.Attribute definition is used to specify the attributes for a vehicle.Task.
Schema definition
message Attribute {
required string dimensionId = 1;
optional float quantity = 2;
repeated Window windows = 3;
}Fields
- dimensionId
- The dimension to which this attribute should be applied.
- quantity
- The amount to be added to the associated dimension when executing the associated shift (typically zero or omitted).
- windows
- An optional list of window objects applicable to this shift.
Examples
This example illustrates a time window which begins at 07:00 and ends at 17:00 (time dimension measured in minutes) which can be applied as a set of attributes on a shift task.
attributes {
dimensionId: "time"
quantity: 0
windows {
start: 420
end: 1020
}
}Vehicle Capacity
The vehicle.Capacity definition is used to specify the global cumulative capacity limit for a vehicle. This is analogous to the maximum amount that can be carried by a vehicle at any point in the schedule.
Schema definition
message Capacity {
required string dimensionId = 1;
required float capacity = 2;
}Fields
- dimensionId
- The id of the dimension to which the capacity limit should be applied. The dimension should be defined by the dimension configuration and quantities specified by tasks which contribute to the target dimension.
- capacity
- The capacity limit for the associated dimension measured in the same base-units as the dimension
Examples
This example illustrates two global maximum capacity constraints on the target vehicle across the weight dimension (measured in kilograms) and the cubes dimension (measured in metres cubed - a volumetric measurement) where the vehicle may not load more than 2 tonnes of product, or 8 “cubes” on the vehicle at any point in the schedule.
capacities {
dimensionId: "weight"
capacity: 2000
}
capacities {
dimensionId: "cubes"
capacity: 8
}Notes
- Currently capacitated dimensions are assumed to be independent of one another. If you’re looking for behaviour which models the product of two dimensions (or some other arithmetic function between two or more dimensions), watch this space as there are some interesting use cases for this style of functionality.