-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
jsprit returns invalid tours when mixing Services and Shipments #7
Comments
I have to say that I am a bit surprised that jsprit accepts mixes of services and shipments. In my intuition, they are not the same: "services" assigns a tour with the only constraint that the sum of all services has to fit into the vehicle (which is also why it does not matter if we have pickups or deliveries), while "shipments" really is a pickup-and-delivery problem. I suggest to just throw an exception when these two are mixed. |
@kt86 Would you mind to write a simple unit test that reproduces this "bug"? This way I can easily analyse this as well. |
@kainagel There are many real world use cases where it is very convenient to use both shipments and services. For example, if you want to model a dynamic pickup and delivery problem much like a minibus-on-demand problem and you want to optimize routes continously, i.e. at t1, t2 and t3. Let us assume there is only one shipment (s.from -> s.to). The activity at s.from is conducted at t1 and s.to at t3. At t2 s.from has already been conducted. Then intuitively you would not model the problem at t2 with a shipment (since nothing needs to be picked up anymore), but with an ordinary delivery (service). This means that if there are more than one shipment in the problem, you have a problem with services AND shipments. |
Thus, modeling a problem with ordinary deliveries does not necessarily mean that
but that the capacity is reduced right from the beginning of the route by the sum of all deliveries. |
This is an excerpt of GraphHopper's doc. It might help understanding the differences.
Does this make sense? |
However, if you want to prohibit the use of both services and shipments in your problems, it should be relatively easy to do this on your side. |
@kt86 I assume you used an ordinary service (Service.class). This is basically modelled as Pickup, and not - as you assumed - Delivery. To avoid this, you can use Pickup.class and Delivery.class. |
@wlbean this has bearing on our approach as well. |
@oblonski : Thanks for that Information, I will try/test it and report. In my mind it was the other way round (service are modelled as Delivery). |
matsim now throws an exception when services and shipments are mixed. That addresses the issue for the time being. |
See attached visualization. The vehicle has the capacity of 3.
it starts at depot, then Pickup the two shipments (quantity 1 + 2 =3). That would be ok. BUT after picking up the shipments it will deliver the Service which in fact means that it has to transport it from depot. -> After pickup both Shipments, there are is the quantity of 5 in the vehicle... more than its capacity allows..
-> Needs more investigation why the constraint did not work.
mixed-solution-wo-route
The text was updated successfully, but these errors were encountered: