TimeWindow

Time windows constrain the time of an event, such as the arrival time at a visit, or the start and end time of a vehicle.

Hard time window bounds, startTime and endTime, enforce the earliest and latest time of the event, such that startTime <= event_time <= endTime. The soft time window lower bound, softStartTime, expresses a preference for the event to happen at or after softStartTime by incurring a cost proportional to how long before softStartTime the event occurs. The soft time window upper bound, softEndTime, expresses a preference for the event to happen at or before softEndTime by incurring a cost proportional to how long after softEndTime the event occurs. startTime, endTime, softStartTime and softEndTime should be within the global time limits (see ShipmentModel.global_start_time and ShipmentModel.global_end_time) and should respect:

  0 <= `startTime` <= `softStartTime` <= `endTime` and
  0 <= `startTime` <= `softEndTime` <= `endTime`.
JSON representation
{
  "startTime": string,
  "endTime": string,
  "softStartTime": string,
  "softEndTime": string,
  "costPerHourBeforeSoftStartTime": number,
  "costPerHourAfterSoftEndTime": number
}
Fields
startTime

string (Timestamp format)

The hard time window start time. If unspecified it will be set to ShipmentModel.global_start_time.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

endTime

string (Timestamp format)

The hard time window end time. If unspecified it will be set to ShipmentModel.global_end_time.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

softStartTime

string (Timestamp format)

The soft start time of the time window.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

softEndTime

string (Timestamp format)

The soft end time of the time window.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

costPerHourBeforeSoftStartTime

number

A cost per hour added to other costs in the model if the event occurs before softStartTime, computed as:

   max(0, softStartTime - t.seconds)
                          * costPerHourBeforeSoftStartTime / 3600,
t being the time of the event.

This cost must be positive, and the field can only be set if softStartTime has been set.

costPerHourAfterSoftEndTime

number

A cost per hour added to other costs in the model if the event occurs after softEndTime, computed as:

   max(0, t.seconds - softEndTime.seconds)
                    * costPerHourAfterSoftEndTime / 3600,
t being the time of the event.

This cost must be positive, and the field can only be set if softEndTime has been set.