Search…
Time settings
You will learn the basics of working with time on cloud.
  • Date and time formats are explicitly defined using the RFC 3339 standard, using a 24-hour clock and offset with respect to UTC (YYYY-MM-DDTHH:MM:SS-UTC). It is a profile of the ISO 8601 international standard.
  • Durations are defined in seconds.
Time settings define when certain routing events should take place for vehicles and stops. This can include the hours of operation for vehicles, the ideal time a vehicle should service a stop, the exact time a vehicle should service a stop, and how long it takes a vehicle to service a stop. Time settings impact the order in which stops get serviced by vehicles as well as the application of penalties. They are also used to schedule vehicle break times.

Target times

Target times define a specific time a vehicle should service a stop. This time setting is useful for encouraging vehicle timeliness at stops in ride sharing or food transportation scenarios.
Target times are exact times rather than windows or ranges of time. Target times are defined per stop. They are only enforced when earliness and lateness penalties are defined.
JSON
1
{
2
"defaults": {
3
"vehicles": {
4
"shift_start": "2021-10-17T09:00:00-06:00",
5
"speed": 10
6
}
7
},
8
"vehicles": [
9
{ "id": "vehicle-1" }
10
],
11
"stops": [
12
{
13
"id": "location-1",
14
"position": { "lon": -96.8128, "lat": 33.02428 },
15
// Target delivery time is 9:45am.
16
"lateness_penalty": 10,
17
"target_time": "2021-10-17T09:45:00-06:00"
18
},
19
{
20
"id": "location-2",
21
"position": { "lon": -96.6201, "lat": 33.04621 },
22
// Target delivery time is 9:55am.
23
"lateness_penalty": 100,
24
"target_time": "2021-10-17T09:55:00-06:00"
25
},
26
{
27
"id": "location-3",
28
"position": { "lon": -96.9122, "lat": 32.95215 },
29
// Target delivery time is 9:35am.
30
"lateness_penalty": 10,
31
"target_time": "2021-10-17T09:35:00-06:00"
32
}
33
]
34
}
Copied!

Hard windows

Hard windows are ranges of time a vehicle must service a stop within. This time setting is useful for enforcing strict timeliness for vehicles servicing stops. For example, a ride-sharing service may only want to pick up passengers within a specific time frame to catch a flight at the airport.
Hard windows are hard constraints, i.e., if a stop is assigned to a route it's time window must be met. Otherwise, the stop gets unassigned. Priorities of stops with conflicting windows can be controlled by introducing unassigned penalties. Waiting at a stop for the window to open is allowed by default and can be limited by setting waiting times.
JSON
1
{
2
"defaults": {
3
"vehicles": {
4
"shift_start": "2021-10-17T09:00:00-06:00",
5
"speed": 10
6
}
7
},
8
"vehicles": [
9
{ "id": "vehicle-1" }
10
],
11
"stops": [
12
{
13
"id": "location-1",
14
"position": { "lon": -96.8585, "lat": 32.9912 },
15
// Delivery must be completed 9:00-10:00am
16
"unassigned_penalty": 200000,
17
"hard_window": [
18
"2021-10-17T09:00:00-06:00",
19
"2021-10-17T10:00:00-06:00"
20
]
21
},
22
{
23
"id": "location-2",
24
"position": { "lon": -96.6201, "lat": 33.04621 },
25
// Delivery must be completed 9:15-10:15am
26
"unassigned_penalty": 100000,
27
"hard_window": [
28
"2021-10-17T09:15:00-06:00",
29
"2021-10-17T10:15:00-06:00"
30
]
31
},
32
{
33
"id": "location-3",
34
"position": { "lon": -96.9122, "lat": 32.95215 },
35
// Delivery must be completed 9:30-10:30am
36
"unassigned_penalty": 200000,
37
"hard_window": [
38
"2021-10-17T09:30:00-06:00",
39
"2021-10-17T10:30:00-06:00"
40
]
41
}
42
]
43
}
Copied!

Waiting times

Waiting time is the maximum amount of time a vehicle is allowed to wait at a stop for the time window to open. For example, a customer was informed about a package delivery between 2 and 4 p.m. Setting a maximum waiting Time (max_wait) to 1800s (30min) the vehicle is allowed to arrive as early as 1:30 p.m. but can start servicing the stop only as soon as the time window opens at 2 p.m.
Waiting time is a hard constraint that is defined at the stop level (default or individually). Note, if waiting time is defined, a hard window must also be defined.
JSON
1
{
2
"defaults": {
3
"vehicles": {
4
"shift_start": "2021-10-17T09:00:00-06:00",
5
"speed": 10
6
}
7
},
8
"vehicles": [
9
{ "id": "vehicle-1" }
10
],
11
"stops": [
12
{
13
"id": "location-1",
14
"position": { "lon": -96.8585, "lat": 32.9912 },
15
// Delivery must be completed 9:00-10:00am
16
// Allow 30 minutes wait time at stop.
17
"max_wait": 1800,
18
"hard_window": [
19
"2021-10-17T09:00:00-06:00",
20
"2021-10-17T10:00:00-06:00"
21
]
22
},
23
{
24
"id": "location-2",
25
"position": { "lon": -96.6201, "lat": 33.04621 },
26
// Delivery must be completed 9:15-10:15am
27
// Allow 30 minutes wait time at stop.
28
"max_wait": 1800,
29
"hard_window": [
30
"2021-10-17T09:15:00-06:00",
31
"2021-10-17T10:15:00-06:00"
32
]
33
},
34
{
35
"id": "location-3",
36
"position": { "lon": -96.9122, "lat": 32.95215 },
37
// Delivery must be completed 9:30-10:30am
38
// Allow 30 minutes wait time at stop.
39
"max_wait": 1800,
40
"hard_window": [
41
"2021-10-17T09:30:00-06:00",
42
"2021-10-17T10:30:00-06:00"
43
]
44
}
45
]
46
}
Copied!

Shift start and end

Shift start and end indicates a range of time a vehicle is available to service stops. This time setting is useful for enforcing availability of a given vehicle for a defined shift while also accounting for breaks.
Shift start and end are hard constraints. They are defined at the vehicle level (default or individually) and will influence how unassigned penalties are applied to the value function.
JSON
1
{
2
"defaults": {
3
"vehicles": {
4
// Driver shift starts at 9:00am and ends at 11:00am.
5
"shift_start": "2021-10-17T09:00:00-06:00",
6
"shift_end": "2021-10-17T11:00:00-06:00",
7
"speed": 10
8
}
9
},
10
"vehicles": [
11
{ "id": "vehicle-1" }
12
],
13
"stops": [
14
{
15
"id": "location-1",
16
"position": { "lon": -96.8703, "lat": 33.1058 }
17
},
18
{
19
"id": "location-2",
20
"position": { "lon": -96.6154, "lat": 33.0117 }
21
},
22
{
23
"id": "location-3",
24
"position": { "lon": -96.8205, "lat": 32.7546 }
25
}
26
]
27
}
Copied!

Stop duration

Stop duration is the estimated amount of time in seconds a vehicle needs to service a stop. For example, a vehicle might need less time to service a stop for a ride-sharing scenario than it would for loading large quantities of produce in a sourcing scenario.
They are defined at the stop level (default or individually).
JSON
1
{
2
"defaults": {
3
"vehicles": {
4
"shift_start": "2021-10-17T09:00:00-06:00",
5
"speed": 10
6
}
7
},
8
"vehicles": [
9
{ "id": "vehicle-1" }
10
],
11
"stops": [
12
{
13
"id": "location-1",
14
"position": { "lon": -96.8703, "lat": 33.1058 },
15
// It takes 20 minutes to service the location.
16
"stop_duration": 1200
17
},
18
{
19
"id": "location-2",
20
"position": { "lon": -96.6154, "lat": 33.0117 },
21
// It takes 30 minutes to service the location.
22
"stop_duration": 1800
23
},
24
{
25
"id": "location-3",
26
"position": { "lon": -96.8205, "lat": 32.7546 },
27
// It takes 40 minutes to service the location.
28
"stop_duration": 2400
29
}
30
]
31
}
Copied!

Stop duration multiplier

It may be the case that some vehicles within your fleet need considerably longer time to service a stop. In order to introduce this information to the model, you can use the stop_duration_multiplier at the vehicle level to increase or decrease the given service time for the stop.
JSON
1
{
2
"defaults": {
3
"vehicles": {
4
"shift_start": "2021-08-24T09:00:00-06:00",
5
"speed": 10
6
}
7
},
8
"vehicles": [
9
{
10
"id": "vehicle-1",
11
// Increase the given service time for every stop by factor 1.2 for this vehicle
12
"stop_duration_multiplier": 1.2
13
},
14
{
15
"id": "vehicle-2"
16
}
17
],
18
"stops": [
19
{
20
"id": "location-1",
21
"position": {
22
"lon": 7.6129,
23
"lat": 51.957
24
},
25
"stop_duration": 900
26
},
27
{
28
"id": "location-2",
29
"position": {
30
"lon": 7.6166,
31
"lat": 51.9635
32
},
33
"stop_duration": 600
34
},
35
{
36
"id": "location-3",
37
"position": {
38
"lon": 7.6258,
39
"lat": 51.9624
40
},
41
"stop_duration": 600
42
},
43
{
44
"id": "location-4",
45
"position": {
46
"lon": 7.6386,
47
"lat": 51.9449
48
},
49
"stop_duration": 600
50
},
51
{
52
"id": "location-5",
53
"position": {
54
"lon": 7.5896,
55
"lat": 51.9486
56
},
57
"stop_duration": 900
58
}
59
]
60
}
Copied!