Penalty for underloaded runs {#empty-run-before-full}

To ensure that couriers prioritize runs with maximum load, use the penalty options.penalty.empty_run_before_full.scaled. This penalty is applied for each less-loaded run completed before a more heavily loaded run by the same courier.

The penalty is calculated as follows: for each run, the maximum utilization (a value between 0 and 1) and the maximum utilization of subsequent runs are determined. The difference between these utilization rates is multiplied by the penalty amount.

For example, the route has 3 runs. The courier delivered 10 units of cargo on the first run, 15 on the second, and 20 on the third. Vehicle capacity is 25 units. The third run has a maximum utilization of 20 units. The penalty is charged for the first and second runs.

[(20−10)/25 + (20−15)/25] * options.penalty.empty_run_before_full.scaled

If the same courier delivers 20 units of cargo on the first run, 10 on the second, and 15 on the third, a penalty will be charged only for the second run.

(15−10)/25 * options.penalty.empty_run_before_full.scaled

Example 1

The courier makes 3 runs. The first run has time windows before 12:00, while the second and third runs have time windows after 13:00. The cost of the courier service depends on the waiting time on the route, so after delivering early orders, the courier returns to the depot.

Vehicle capacity is 25 units. The courier delivered 12 units of cargo on the first run, 16 on the second, and 20 on the third.

API request (JSON)API responseView on map

Example 2

The same as in Example 1, but the penalty is defined as options.penalty.empty_run_before_full.scaled = 10,000. On the first run, the courier continues to deliver early orders: 12 units of cargo. But on the second and third runs, the courier now delivers 18 units of cargo. The penalty empty_run_before_full_penalty is calculated for the first run only:

(18−12) / 25 * 10000 = 2400

API request (JSON)API responseView on map

Contact support