Skip to content

Asset Time Windows

Time windows are an optional feature that is enabled with route optimisation.

Time windows allow you to define times when jobs can't be done. (eg: We can't mow the sportsfield on Saturday and Sunday mornings between 8am and 1 pm becuase of the soccer games.) This is an exclusion time slot and can be added to an asset like so:

<time_windows type="array">
    <time_window>
        <start_time>28800</start_time>
        <end_time>46800</end_time>
        <day_of_week>6</day_of_week>
    </time_window>
    <time_window>
        <start_time>28800</start_time>
        <end_time>46800</end_time>
        <day_of_week>0</day_of_week>
    </time_window>
</time_windows>
<negative_time_windows>true</negative_time_windows>

The days of the week start from Sunday as day 0, so Monday is day 1 and Sunday is day 6.

The start time and end time are in seconds from midnight, so 8am is 28800 and 1pm is 46800.

You can also define times when jobs must be done. (We only have access to the forklift between 9 and 12 on Mon, Wed and Fri.) This is an inclusion time slot and can be added to a job like so:

<time_windows type="array">
    <time_window>
        <start_time>32400</start_time>
        <end_time>43200</end_time>
        <day_of_week>1</day_of_week>
    </time_window>
        <time_window>
        <start_time>32400</start_time>
        <end_time>43200</end_time>
        <day_of_week>3</day_of_week>
    </time_window>
    <time_window>
        <start_time>32400</start_time>
        <end_time>43200</end_time>
        <day_of_week>5</day_of_week>
    </time_window>
</time_windows>
<negative_time_windows>false</negative_time_windows>

The day and time logic works the same way, but negative time windows are set to false instead of true.

If these time windows are added to an asset (either by the webapp or the API) we will prevent jobs associated with that asset from breaking these rules when they are being optimised.

We will also warn dispatchers if they manually schedule a job that breaks one of these rules, but won't prevent it.

If you wish to remove a time window from an asset, you would PUT the following XML:

<?xml version="1.0" encoding="utf-8"?>
<asset>
    <time_windows type="array">
        <time_window>
            <id>5198001</id>
            <_destroy>true</_destroy>
        </time_window>
    </time_windows>
</asset>   

If you wish to remove all time windows from an asset, then you can PUT an empty array, like so:

<?xml version="1.0" encoding="utf-8"?>
<asset>
    <time_windows type="array">
    </time_windows>
</asset>