Skip to content
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

Required break problems #81

Open
nkl1996 opened this issue Jul 7, 2022 · 16 comments
Open

Required break problems #81

nkl1996 opened this issue Jul 7, 2022 · 16 comments

Comments

@nkl1996
Copy link

nkl1996 commented Jul 7, 2022

I tested the new required break feature and its not working like i except it. Here i provide you a example where the break is made inside a service. I thought the required break would always be done between two stops while driving.

"activities": [
	{
		"jobId": "85965",
		"type": "service",
		"location": {
			"lat": 52.5414079,
			"lng": 7.8738088
		},
		"time": {
			"start": "2022-07-11T16:31:14Z",
			"end": "2022-07-12T08:31:14Z"
		}
	},
	{
		"jobId": "break",
		"type": "break",
		"time": {
			"start": "2022-07-11T17:00:00Z",
			"end": "2022-07-12T08:00:00Z"
		}
	}

]

Here is the full problem and solution:example.zip

@reinterpretcat
Copy link
Owner

Hi,

required break is also scheduled during activity's service time to make sure that it is respected in any case. Have you tried to use optional break with time window like 17:00-18:00 instead?

I guess you're trying to model multiple shifts with such breaks to allow vehicle to start at last job location next day. That's why you're not using multi shift feature instead.

@nkl1996
Copy link
Author

nkl1996 commented Jul 7, 2022

Yeah you are right i am trying to model mutitple shifts where the employee sleeps in his car so he starts at the last job next day.
But i dont use optional breaks because they are never scheduled between stops. Sometimes the stops are 2-3 hours away with optional breaks the solution would be to wait at the previous stop when there is not enough time to make it.

@reinterpretcat
Copy link
Owner

Got it. I would say it requires a new field to be exposed on the required break definition (e.g. policy) as I want to keep an existing logic too. Internally, this field can be used as a flag to disable behavior for activity or transport costs. Need to check how difficult it will be to add. The complex part is that if break time happens during activity's service time, then it skipped and new stop won't be scheduled according to existing logic..

Alternative way is to do post processing on the client side: detect such use cases and override last activity and break scheduled times.

@nkl1996
Copy link
Author

nkl1996 commented Jul 7, 2022

I will check if i can post process this case on client side. Thanks.

@nkl1996
Copy link
Author

nkl1996 commented Jul 15, 2022

Hey i tested some more cases with the required break feature but i am getting weird breaks.
Here is a example with 3 breaks i a row with overlapping times:

  			"activities": [
  				{
  					"jobId": "54479",
  					"type": "service",
  					"location": {
  						"lat": 52.65101,
  						"lng": 7.6198201
  					},
  					"time": {
  						"start": "2022-07-12T09:30:31Z",
  						"end": "2022-07-12T09:45:31Z"
  					}
  				},
  				{
  					"jobId": "break",
  					"type": "break",
  					"location": {
  						"lat": 52.65101,
  						"lng": 7.6198201
  					},
  					"time": {
  						"start": "2022-07-12T09:45:31Z",
  						"end": "2022-07-12T12:00:00Z"
  					}
  				},
  				{
  					"jobId": "break",
  					"type": "break",
  					"location": {
  						"lat": 52.65101,
  						"lng": 7.6198201
  					},
  					"time": {
  						"start": "2022-07-12T12:00:00Z",
  						"end": "2022-07-13T23:30:00Z"
  					}
  				},
  				{
  					"jobId": "break",
  					"type": "break",
  					"time": {
  						"start": "2022-07-12T18:30:00Z",
  						"end": "2022-07-13T06:00:00Z"
  					}
  				}
  			]

Can you provide more details what happend here? I know sometimes the solution can have waiting times because there is no job that can be done before a break so maybe this logic is having a problem? I am mixing required and optinal breaks but that should be fine right?
Here is the problem and full solution:example3994.zip

@nkl1996 nkl1996 changed the title Required break inside service Required break problems Jul 15, 2022
@reinterpretcat
Copy link
Owner

Actually, implementation assumes that breaks time windows (both, optional and required) don't intersect. I guess I need to add a validation rule to make this explicit.

@nkl1996
Copy link
Author

nkl1996 commented Jul 26, 2022

The break time windows of my problem dont intersect. I use optional breaks for lunch and required breaks for sleepovers.
Can you check again why in the solution the breaks intersect?

@reinterpretcat
Copy link
Owner

It seems like a bug:

Stop with breaks has departure at 2022-07-13T12:00:00

"time": {
						"arrival": "2022-07-12T09:30:31Z",
						"departure": "2022-07-13T12:00:00Z"
					},

But one of the stop activities for break has 2022-07-13T23:30:00 which is later:

							"time": {
								"start": "2022-07-12T12:00:00Z",
								"end": "2022-07-13T23:30:00Z"
							}

I would need to find a time to dig into the implementation details to find the problem.

@nkl1996
Copy link
Author

nkl1996 commented Aug 15, 2022

I tried to use only required breaks but still sometimes the solution is buggy.

Can you estimated when you have time to fix the issue?

				"location": {
					"lat": 53.148326,
					"lng": 8.2302781
				},
				"time": {
					"arrival": "2022-08-12T08:52:33Z",
					"departure": "2022-08-15T05:19:55Z"
				},
				"distance": 5436,
				"load": [
					0
				],
				"activities": [
					{
						"jobId": "48241",
						"type": "service",
						"location": {
							"lat": 53.148326,
							"lng": 8.2302781
						},
						"time": {
							"start": "2022-08-12T08:52:33Z",
							"end": "2022-08-15T04:51:03Z"
						}
					},
					{
						"jobId": "break",
						"type": "break",
						"time": {
							"start": "2022-08-12T09:00:00Z",
							"end": "2022-08-18T00:00:00Z"
						}
					},
					{
						"jobId": "48288",
						"type": "service",
						"location": {
							"lat": 53.148326,
							"lng": 8.2302781
						},
						"time": {
							"start": "2022-08-15T04:51:03Z",
							"end": "2022-08-15T05:19:55Z"
						}
					}
				]
			},

@reinterpretcat
Copy link
Owner

At the moment, I don't have plans to start working on it.

@kaiSchweegmann
Copy link

Hey i recently started to work with required breaks and also facing the issue. Any updates on this topic?

@reinterpretcat
Copy link
Owner

reinterpretcat commented Sep 19, 2022

No updates. At the moment, I'm working on some internal refactoring

@leobudima
Copy link

Just to add a +1 on break issues (and also in context of multi-day routes), happy to provide examples too if it helps ❤️

@reinterpretcat
Copy link
Owner

I started to look into this issue. If you have a smallest possible problem to reproduce, this would help

@leobudima
Copy link

Great news, @reinterpretcat ! I'll try to provide an example as soon as possible if it helps contribute to what others are experiencing as well!

@reinterpretcat
Copy link
Owner

I pushed a fix for some required breakk problems I've identified:

ac05b25

You can try them in vnext branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants