2.1 Common Data Items

This section describes the representation of data that is common across the MWO input and output formats.

2.1.1 Identifiers

Entities, such as crews and jobs, must have a unique identifier (Id) that is used to refer to them.

Identifiers must contain at least one character and must not contain the semicolon (;) character. They are not case or “white space” sensitive.

For example, “JOB2”, “job2” and “Job 2 ” will all be treated as identifying the same entity by the optimiser because they only differ in case or the amount of white space they contain.

Even though they may be composed of digits, identifiers are not numeric. For example, the optimiser will treat “1” and “001” as distinct identifiers.

All references to an entity are made via its identifier.

In JSON, identifiers are representing using strings.

2.1.2 Times

Points in time during a day are given in HH:mm format using the 24 hour clock, for example 12:30 or 22:05.

Times are represented using strings in JSON.

2.1.3 Durations

A duration of time is given in HH:mm format, for example 12:30. Unlike times, these can extend over 24 hours such as 37:00.

Durations are represented using strings in JSON.

2.1.4 Dates

Calendar dates are given in YYYY-MM-DD format, for example 2019-07-16 or 2020-01-02.

Dates are represented using strings in JSON.

2.1.5 Date-Times

Combined dates and times are given in YYYY-MM-DDTHH:mm format, for example 2019-07-16T10:59 or 2019-12-24T13:01.

Date-times are represented using strings in JSON.

2.1.6 Time Zones

Time zones have the form Area/Location and must match an entry in the IANA time zone database 1 , for example “Australia/Melbourne” or “Asia/Kolkata”.

Time zones are represented using strings in JSON.

2.1.7 Date Window

A date window is a contiguous span of dates. It is identified by, and inclusive of, the endpoints of the window. It is represented in JSON using a date window object, which has the following fields:

  1. start: the date on which this date window begins.
  2. finish: the date on which this date window ends.

2.1.8 Date-Time Window

A date-time window is a contiguous span of time where the endpoints include both a date and a time component. It is identified by, and inclusive of, the endpoints of the window. It is represented in JSON using a date-time window object, which has the following fields:

  1. start: the date-time on which this date-time window begins.
  2. finish: the date-time on which this date-time window ends.

2.1.9 Time Window

A time window is a contiguous span of time. It is identified by, and inclusive of, the end points of the window. It is represented in JSON using a time window object, which has the following fields:

  1. start: the time on which this time window begins.
  2. finish: the time on which this time window ends.

If the finish field occurs before the start field, then that means that the finish of the time window occurs on the following day.

2.1.10 Location Object

A location is given using its geographic coordinates. It is represented in JSON using a location object, which has the following fields:

  1. longitude: a number giving the longitude in decimal degrees.
  2. latitude: a number giving the latitude in decimal degrees.

2.1.11 Allowed Crew Object

An allowed crew object describes if a crew can undertake a job; the amount of time they require complete the job; a measure of the desirability of assigning the job to the crew and the monetary cost of assigning the crew to the job.

  1. crew_id: the identifier of the crew.
  2. duration: the number (integer) of minutes the crew require to complete the job (once they are on-site).
  3. preference: a number indicating the desirability (or not) of assigning the job to this crew. A value of 0 means that there is no preference.
  4. cost: a number, giving the monetary cost in dollars for the crew to undertake the job.

2.1.12 Response Status Codes

A response status code is used by the optimiser to indicate if an operation succeeded or not. There are two possible values:

  1. OK: indicates that the operation was successful.
  2. ERROR: indicates that the operation failed and an error occurred.

2.1.13 Dispatch Response Status Codes

A dispatch response status code is used by the dispatch optimiser to indicate if an operation succeeded or not. There are four possible values:

  1. OK: indicates that the operation was successful.
  2. NO_COMPATIBLE_CREWS: indicates that the operation was successful, but no crews were compatible with the new job.
  3. MISSING_REQUIRED_EQUIPMENT: indicates that the operation was successful, but no crews had the equipment required to undertake the new job.
  4. ERROR: indicates that operation failed and an error occurred.