- We have a fleet with multiple vehicles we can utilize.
- For some of the vehicles we can consider an optional trailer which means:
- If a trailer is attached to the vehicle it's COSTS and CAPACITIES change.
- The optimization should check whether a trailer is meaningful or not for a certain vehicle.
- Bonus: some orders may prohibit a trailer vehicle to serve them.
- Define a so-called Resource "Resource-4711" which is free of costs and limited to maximumVehicles=1:
Code: Select all
{ "id" :"TheVehicle4711", "minimumBufferDuration" : 0, "constraints" : { "maximumVehicles" : 1 }, "costs": null, "categories" : ["Cat-Res-4711"] } - Create two alternative vehicle objects : one with the trailer based properties (higher capacity, higher costs)
-
Code: Select all
{ "id" : "vehicle-4711-no-trailer", "requiredResourceCategories": [ "Cat-Res-4711" ], ... } Code: Select all
{ "id" : "vehicle-4711-with-trailer", "requiredResourceCategories": [ "Cat-Res-4711" ], ... "categories": ["hasTrailer"] }
-
- For the bonus requirement: forbid "hasTrailer" vehicles to serve certain orders:
- use constraints.combinations.orderVehicle:
Code: Select all
{ "combinations": { "orderVehicle": [ "type": "FORBIDDEN_COMBINATION", "orderCategory": "no-trailer", "vehicleCategory" : "hasTrailer" ] } } - Mark the critical orders as "no-trailer" category:
Code: Select all
{ "id" ; "order-23", "properties": { "categories" : [ "no-trailer" ] } }
- use constraints.combinations.orderVehicle: