I am struggling with modeling the following problem:
- I have a list of vehicles with known capacity
- I have a list of boxes that has to be loaded onto a vehicle, each vehicle has known size that contributes to the vehicle's capacity
- capacity is expresses as cubature i.e. box having 1m3 contributes to vehicles 20m3 of capacity by taking 1 from 20, leaving 19m3 available
- a box is part of the order
- order has to placed onto a single vehicle unless order is too big in which case it has to be splited and placed onto multiple trucks
- order cannot be splitted if it fits, as a whole, onto a single vehicle
- order can translate to multiple visits, pickup and delivery
- to simplify we are solving a problem for given day i.e. for given day we can have just delivery or just pickup for specific order but we can also have both
- delivery and pickup do not need to be handled by the same truck; however that is still possible to happen
- visits (order or deliveries) has to happen one by one
- we are minimizing the route's time of particular vehicle
- we are maximizing the vehicle's usage or, in other words, minimizing the air cubature
- order has pickup and delivery service windows
- order has a location where either delivery or pickup happens
- service window has start and end datetime which describes boundaries between which a service can happen
- service has a duration which describes how much time we have to unload the delivery or load the pickup
- vehile has a depot location and startTime, start time being the time when truck can start operating
- boxes assigned to a vehicle cannot exceed maximum capacity of the vehicle
What I am struggling with is finding the correct domain model that expresses that and allows to formulate a problem where a solution is both the vehicle's route and containers' assignment for given vehicle.
What I was able to do is:
- build list of visits for given day, knowing the list of orders
- retrieve list of containers for specific order
What I have:
- list of vehicles
- list of orders
- list of containers assigned to order
PS. I have been considering solving boxes<->vehicle assignment problem first, isolate it from routing problem, but that gave me the idea that an optimal assignment may be far away from optimal routing problem. That leads me to the idea that both boxes<->vehicle and vehicle<->visits problem are interconnected.
Any ideas?