NDD JobJob
Overview
A job maps to a collection of tasks (e.g. a pickup and dropoff can be one job). All tasks within a job must be completed in the order specified. In the NDD model, each job also carries a profile which defines the visit frequency and day-pattern constraints. This is the key field that separates the NDD schema from the standard IVR7 job.
Applicable models
- NDD
ndd-cmibu6krtqja
Job
Schema definition
message Job {
required string id = 1;
optional Task pickupTask = 2;
optional Task dropoffTask = 3;
required float penalty = 4;
optional VehicleRelation vehicleRelations = 5;
required Profile profile = 6;
}Fields
- id
- A unique identifier for this job.
- pickupTask
- An optional pickup task for this job.
- dropoffTask
- An optional dropoff task for this job. When both pickup and dropoff tasks are specified, both are assumed to occur on the same vehicle.
- penalty
- The penalty cost incurred if this job is not included in the solution. Penalties should be greater than zero and preferably very large to force inclusion of the job.
- vehicleRelations
- An optional vehicle relation for specifying vehicle inclusions or exclusions.
- profile
- The profile defining the visit frequency and allowable day patterns for this job. This is the field that distinguishes the NDD schema from the standard IVR7 model.
Examples
A simple delivery job visited once a week with a high penalty for non-inclusion:
id: "customer-001"
dropoffTask {
taskId: "customer-001:dropoff"
locationId: "loc-001"
attributes {
dimensionId: "time"
quantity: 10
}
attributes {
dimensionId: "weight"
quantity: 25
}
}
penalty: 100000
profile {
frequencyType: ONCE_A_WEEK
}A pickup-and-dropoff job visited twice a week:
id: "job-pd-001"
pickupTask {
taskId: "job-pd-001:pickup"
locationId: "warehouse-01"
attributes {
dimensionId: "weight"
quantity: -50
}
}
dropoffTask {
taskId: "job-pd-001:dropoff"
locationId: "customer-042"
attributes {
dimensionId: "weight"
quantity: 50
}
}
penalty: 100000
profile {
frequencyType: TWICE_A_WEEK
}Notes
- Currently only single-task and pickup-dropoff task combinations are supported.
- Jobs are also used to represent shifts on vehicles with at most two tasks indicating the start and end location.
Task
A task represents a unit of work to be performed at a location.
Schema definition
message Task {
required string taskId = 1;
required string locationId = 2;
repeated Attribute attributes = 3;
repeated TripConstraint tripConstraints = 4;
}Fields
- taskId
- A unique identifier for this task.
- locationId
- The location at which this task is performed.
- attributes
- A list of task attributes defining dimensional quantities and windows for this task.
- tripConstraints
- An optional list of trip constraints specifying whether this task must be first or last on a trip.
Examples
taskId: "customer-001:dropoff"
locationId: "loc-001"
attributes {
dimensionId: "time"
quantity: 15
windows {
start: 480
end: 720
}
}Task Attribute
A task attribute defines dimensional properties for a specific task, optionally scoped to particular vehicles.
Schema definition
message Attribute {
required string dimensionId = 1;
optional float quantity = 2;
repeated Window windows = 3;
repeated string vehicleIds = 4;
}Fields
- dimensionId
- The dimension to which this attribute applies.
- quantity
- A quantity on the specified dimension incurred when performing this task. In the context of time, this represents service time. In the context of capacity, this represents the pickup or delivery quantity.
- windows
- A list of windows defining feasible intervals on the specified dimension for this task.
- vehicleIds
- An optional list of vehicle identifiers. When specified, this attribute only applies when the task is performed by one of the nominated vehicles. When empty, the attribute applies to all vehicles.
Task Trip Constraint
Trip constraints specify ordering requirements for a task within a vehicle’s route.
Schema definition
enum TripConstraint {
FIRST = 0;
LAST = 1;
}Fields
- FIRST
- The task must be the first task on the trip (after the shift start).
- LAST
- The task must be the last task on the trip (before the shift end). A task may have both
FIRSTandLASTconstraints.
Job Vehicle Relation
A vehicle relation constrains which vehicles may (or may not) perform a particular job.
Schema definition
message VehicleRelation {
required Type type = 1;
repeated string vehicleIds = 2;
}Fields
- type
- The type of relation, either
INCLUSIVEorEXCLUSIVE. - vehicleIds
- A list of vehicle identifiers to which the relation applies.
Examples
A job that may only be performed by two specific vehicles:
type: INCLUSIVE
vehicleIds: "truck-01"
vehicleIds: "truck-02"A job that may not be performed by a particular vehicle:
type: EXCLUSIVE
vehicleIds: "truck-03"Job Vehicle Relation Type
Schema definition
enum Type {
INCLUSIVE = 0;
EXCLUSIVE = 1;
}Fields
- INCLUSIVE
- The job may only be performed by the vehicles listed.
- EXCLUSIVE
- The job may not be performed by the vehicles listed.