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
multiple breaks for vehicles #211
Comments
Would you need an AND or OR connection between multiple breaks. When it comes to multiple time windows, it is an OR connection, e.g. either time window A or time window B. |
Hi! In my problem I would need an AND connection between the breaks. I would use this in the following context: Every break is an timewindow that the vehicle dont need to work. I want to plan tours for a long time (week, month, maybe year...) and i get some information about initial routes and about vacation. Normaly vehicles shouldnt work at sunday so i would give this vehicles a 8h(or working time) break. Some could work saturday, some could work a half day and so on. If someone has vacation, i´ll give him also a break so he will not be planed this day. I thought about making this problem to another. I had an idea that i would make some "dummy" services that represent the "break" and give the vehicle and the service an unique skill so that i have to say "sorry little algorithm, only vehicle2 can make at this day the service2 because the service requires skill "break_mrBean1" and this skill has only vehicle2." But multiple breaks with and AND connection would be a little bit better :) |
Hi, What could be the reason for this? Attaching the results of that example with the breaks defined.but the break was assigned to |
@Simbu1988 How did you define your breaks? |
This is how i define my breaks.
SolomonWithSkillsExample:
|
hmm. try to assign unique break objects to your vehicles such as "skill1VehicleBreak", "skill2VehicleBreak". probably you just defined one break object and assigned it to several vehicles, however each vehicle requires its own break object. we should make the problem builder throw an exception in case a single break object is assigned to several vehicles. |
It worked after creating a unique break object.However in the same example , without any breaks all the jobs are assigned to a vehicle.but after adding the breaks to all the vehicle 1 job was unassigned. I have a another question also. |
Maybe your time constraints are too tight (operation time of driver) ? Multiple breaks are not possible yet (see discussion above). BTW: Would you mind to ask latter kind of question in the forum? Great. Thanks. |
Hi, |
Hi, we need this feature as well to model multiple day vehicle routing in which each vehicle has different (multiple) break times during the whole time horizon for rest, maintenance, etc. Really appreciate it. |
Any chance that this feature Driving time dependent break scheduling - beta release will be available in jsprit? |
We need multiple breaks per vehicle as well. If it is difficult to program for multiple breaks, would it be easier if you could use a Service with no Location? Does that make sense? @oblonski |
Let Jsprit optimize this, then remove the no location breaks from the routing request, after the routing request returns add the breaks back and adjust the arrival time to the places where the breaks were inserted in the optimized solution. Any thought on this approach before I give it a try? |
As per the comment above, we are doing the following and it seems to be working: a. Create a skill for each vehicle called "break" here is an example solution result with the above breaks: +--------------------------------------------------------------------------------------------------------------------------------+ Again once the breaks are removed and the it is routed, the gpx produced is valid and reasonable! |
Doesn't this mean you can teleport between locations by going via a break? I suspect this would distort routes in the optimiser. |
Yes that is correct actually. However until jsprit supports more than one break its the best solution... |
Also in our case distances are fairly all close together and time windows are not that long. If anyone has a better solution please ket me know! |
PGWelch -agree. What if costing function added an additional argument that was the previous service. I think this would address your observation of teleportation using breaks, but unfortunately would involve changing core. Any other suggestions? |
This is huge for us. +1 If you only needed to route for one vehicle, would it be possible to string along "fictional" vehicles to pick up where the previous vehicle left off, as a temporary hack? |
Has anyone found a solution for this? |
+1 We would like to be able to define multiple breaks for a vehicle. This fulfils New Zealand employment law, where a 9-hour shift legally needs to have two 15 minute breaks and one 30 minute break. |
+1 This would be a very beneficial feature. The "teleportation" issue mentioned above, makes the suggested solution of using services as breaks non-viable for us. |
I'm interested in developing this feature. Anyone interested in discussing the implementation of the solution? |
Hi @emersonl91 Did you make any progress with this ? |
If it helps, I can share some information about how we implemented multiple breaks. We did this in ODL Live which started off as jsprit plus extra stuff mostly focused on realtime/dynamic route optimisation. ODL Live doesn't use any jsprit code now but at the time we implemented multiple breaks, it still used a significant proportion of jsprit code. If I recall correctly, the current jsprit breaks implementation has an issue in that when a break is inserted, a coordinate is assigned to it (I.e. probably the previous / next stop coordinate). This increases the complexity of implementing multiple breaks, as you need to manage assigning coordinates to multiple breaks in a row when breaks are consecutive in a route. It also effects solution quality when you evaluate a new job insert, as an insert next to a break could be evaluated as infeasible or costly due to the fixed coordinate of the break, whereas in-reality the break coordinate could actually be changed to match the coordinate of the new insert job and the insert would be feasible. (I believe jsprit does optimise break assigned coordinate and position after an insert has been done, but not during the insertion evaluation, so it could miss good inserts). I'm also guessing this problem would be worse with multiple breaks. Anyway, because of these issues we replaced jsprit breaks with our own implementation instead. In our implementation breaks aren't assigned a coordinate internally to the optimisation. Instead calculations related to travel are always calculated with the preceding stop, any number of breaks in-between and the next stop available together, so we can evaluate the impact of breaks knowing the coordinates both before and after the breaks, and without locking the breaks themselves down to a fixed coordinate. As we didn't want to repeat this logic, we also had to ensure all travel calculations were done centrally with the same bit of code. (I can’t really say any more publicly about how the implementation works but feel free to PM me). This methodology does involve replacing substantial amounts of jsprit, so isn't quick to implement, but the end result is that it has no problems supporting multiple breaks, no teleporting issues and no impact on the reliability of the insertion heuristic. |
@PGWelch Given that you no longer use the jsprit in ODL, could you maybe opensource the solution for jsprit? |
@oblonski |
Hi folks |
Hi guys, sorry for the delay. I had no further progress because I changed employer and now I do not work with routing, but I am interested in helping with implementation. I did several tests, but I had difficulty understanding some concepts, especially in the VehicleDependentTimeWindowConstraints file. What do you think about creating a slack channel to strengthen communication? |
Hi @emersonl91 Lets go ahead and create that slack channel (whatever that is 👍 ) Im very keen to see this implemented as Im sure others are as well. regards |
Hi everyone, I already tried to implement the rest periods as stated in the EU regulations. Unfortunately, I didn't reach a 100% working solution. In some cases, the constraints got broken after the ruin process. Though I'm currently working on a different area, I'm still interested on a fully working solution for this problem. Glad to know that the comunnity is considering creating a Slack channel to discuss this topic. You can count on me as well. |
When I clicked on the invite it said it was no longer active. Perhaps it is per person |
Hi @emersonl91 The channel link on slack does not work. Can you please create a new link |
@grantm009 Sorry, emersonl91 is no longer working in our company, so I believe that the channel on slack is dead. |
@emersonl91 I see that you are working on this feature and that there's work still not commited to your fork: Is there any way I can help? I don't have the much experience on jsprit source code, but I'm willing to learn and make tests. |
Modelling multiple breaks should now be possible with the latest master. It allows you to add an arbitrary number of services without locations which can represent breaks. Here is an example: https://github.com/graphhopper/jsprit/blob/master/jsprit-examples/src/main/java/com/graphhopper/jsprit/examples/SimpleWithoutLocationExample2.java Please let me know if you see things that can be improved immediately. BTW: https://github.com/graphhopper/jsprit/releases/tag/v1.8 is the latest release before "Activities without location". It is already available on Maven Central. |
Hi @oblonski This sounds great. I will finish my current task in a few days and will build this into a test version of our application. But is sounds exactly what we (and others) need. Thanks for taking the time to do this. |
@grantm009 were you able to get correct solution for this? |
@mikeppp Could you post a working example? |
Hi there!
Just like spoken in the graphhopper-forums i post here an issue for the feature "multiple breaks".
This could help people plan routes for multiple days/weeks/months, what is just what I and also may other people need :)
Thanks
Patrick
The text was updated successfully, but these errors were encountered: