No more than one hypermarket per trip
When to use?
When you need to build more reliable routes, taking into account the poorly predictable time spent by vehicles waiting for unloading.
At hypermarkets, you can spend from 30 minutes to 4 hours in the queue for unloading. To increase the reliability of routes, trips can be formed in such a way that there is no more than 1 hypermarket on the trip.
Scheme
How to implement the script?
Use the order_features and order_restrictions compatibility.
- Order_features is the feature of the order.
- Order_restrictions is an order requirement.
If you make these values unique for each hypermarket, the route will be built in such a way that orders cannot overlap in one trip, since they will not be compatible.
It is also possible to solve this problem through capacity restrictions capacity_x, when we indicate 1 for each order in a hypermarket, and set the maximum possible number of hypermarkets in a trip for transport.
Examples
Example 1
There are three orders, two of them to hypermarkets.
- Order #1 in hypermarket has order_restrictions = 1, order_features = 1
- Order #2 in hypermarket has order_restrictions = 2, order_features = 2
- Order #3 has order_features = 1.2
As a result, the algorithm calculated the route in the following way:
- Orders #1 and #2 were delivered by different vehicles as they are not compatible.
- Order No. 3 was delivered together with order 2 from the hypermarket, since this is the most optimal in terms of distance.
Example 2
There are three orders. two of them are in hypermarkets. There are two vehicles.
- Orders #1 and #2 to hypermarkets have cargos.capacity_x = 1
- Order #3 has cargos.capacity_x = 0
- Two vehicles have transports.capacity_x = 1
As a result, the algorithm calculated the route in the following way:
- Orders No. 1 and No. 2 were delivered to hypermarkets by different vehicles, as they do not fit in capacity.
- Order No. 3 was delivered together with the second order from the hypermarket, as this is the most optimal in terms of distance.