job
A job
represents a potential delivery to a geographical location. All jobs must have an id
,
even if the object is inlined in a route. The job object contains details about location,
allowed times, allowed dates, and allowed routes. These are factors in where the
optimizer chooses to place the job.
Name | Type | Description |
---|---|---|
allowed_dates | date[] | The dates that this job can be routed on. Do not use this if the date field is used. See Routing with Dates. Cannot use with schedules. |
allowed_days_of_week | day_of_week[] | The days of the week that the job can be delivered on. If null , all days of the week are allowed. Defaults to null . Cannot use with schedules. |
allowed_variance_after | integer | How many days the delivery can be made after the job.date. Defaults to 0 . Cannot use with schedules. |
allowed_variance_before | integer | How many days the delivery can be made before the job.date. Defaults to 0 . Cannot use with schedules. |
code | string | A free-form string that can be used to categorize the job. This has no effect on optimization. |
custom | custom | User-supplied custom fields that are returned unmodified in the response. These have no effect on optimization. |
date | date | The date to route this job. See also Routing with Dates. Cannot use with schedules. |
description | string | A free-form description of the job. This has no effect on optimization. |
disallowed_driver_attributes | string[] | The job must not be assigned to a route whose driver has any of these attributes. Can be used for forbidden drivers. See Routing with Attributes. |
disallowed_route_attributes | string[] | The job must not be assigned to a route that has any of these attributes. See Routing with Attributes. |
exit_location | marker or id | The location that the driver must travel to immediately after leaving the initial location. See Routing with Linked Stops. |
exit_time_on_site | timespan | The time that the driver will spend at the exit_location. This is ignored if no exit_location is provided. |
forbidden_drivers | (driver or id)[] | The ids of all drivers who are forbidden from performing this job. |
id | id | A unique job ID. |
job_attributes | string[] | A list of attributes to assign to the job. These have no effect on optimization. |
load | float | The amount of load delivered at the job. A route can deliver up to its load capacity. Not compatible with loads. See Routing with Capacities. |
loads | load_amount[] | The amount of load delivered at the job per metric. A route can deliver up to its load capacities for the metrics it defines. Metric names must not be duplicated in this list, and up to four unique metric names may be used in a request. Omitted metrics indicate an amount of 0 . Not compatible with load. See Routing with Capacities and load_amount. |
location | marker or id | The geographical location of the job site, or the id of a marker defined elsewhere in the request. |
name | string | Optional. The name of the job. |
notes | string | Free-form notes relating to the job. These have no effect on optimization. |
priority | string | Either "highest", "high", "normal", "low", or "lowest". If necessary, lower priority jobs are left unrouted first. |
required_driver | driver or id | The id of the driver required to perform this job. Also known as "preferred driver". |
required_driver_attributes | string[] | The job must be assigned to a route whose driver has all of these attributes. See Routing with Attributes. |
required_route_attributes | string[] | The job must be assigned to a route that has all of these attributes. See Routing with Attributes. |
required_vehicle_attributes | string[] | The job must be assigned to a route whose vehicle has all of these attributes. See Routing with Attributes. |
required_pre_job_depot_attributes | string[] | The job on a route must be preceded by depots that have all of these attributes. See Routing with Attributes. |
required_post_job_depot_attributes | string[] | The job on a route must be followed by depots that have all of these attributes. See Routing with Attributes. |
time_on_site | timespan | The time the driver will spend at the job. Defaults to the job type's default_time_on_site. |
time_window | time_window | A window of times that the driver can arrive at the job. Defaults to the job type's default_time_window. See Routing with Time Windows. |
time_window2 | time_window | An alternative window of times that the driver can arrive at the job. See Routing with Time Windows. |
type | job_type or id | The type of job, or the id of a job_type defined elsewhere in the request. |
Example
{
"id": "job0",
"location": "-43.549062, 172.642059",
"time_on_site": "00:10",
"time_window": {"start": "13:00:00", "end": "17:00:00"},
"allowed_dates": ["2016-02-03", "2016-02-04", "2016-02-07"],
"required_driver", "DRV-001",
"required_route_attributes": ["refrigeration"],
"disallowed_route_attributes": ["heavy_vehicle"],
"load": 1.5
}
The example above represents a requested delivery to latitude -43.549062, longitude 172.642059 on either February 3, 4, or 7, and between 1:00 PM and 5:00 PM on the delivery day. The item being delivered requires transport by a refrigerated heavy vehicle. It is expected that 10 minutes is required to unload at the customer location. The required driver for the job is the driver who has the ID of DRV-001
.
Job Dates and Schedules
If this job is part of a schedule, no date fields can be specified on the job, since the job will inherit all date information from the schedule. These are the date fields that cannot be used with a schedule:
- job.date.
- job.allowed_variance_before.
- job.allowed_variance_after.
- job.allowed_days_of_week.
- job.allowed_dates.
See Also
- The route.jobs field.
- The build.jobs, insert.jobs_to_insert, and recommend.job fields.
- The stop_response type.