Skip to content

Conversation

jcoupey
Copy link
Collaborator

@jcoupey jcoupey commented Feb 24, 2020

Issue

This PR targets #186

Tasks

  • Add a struct to describe a break
  • Parse breaks in input
  • Maintain a data structure storing break ranks relative to TWRoute::route
  • Init breaks in all new empty routes
  • Take breaks into account for add timing validity checks
  • Take breaks into account for add route updates
  • Take breaks into account for replace timing validity checks
  • Take breaks into account for replace route updates
  • Take breaks into account for remove timing validity checks
  • Take breaks into account for remove route updates
  • Adjust output
  • Update libvroom example
  • Update docs/API.md
  • Update CHANGELOG.md
  • review

@jcoupey
Copy link
Collaborator Author

jcoupey commented Mar 23, 2020

After spending a significant amount of time fiddling with the first idea of actually inserting breaks as "special" jobs in TWRoute::route, I think this is not the right thing to do. The main interest was that all timing-related checks would work out of the box, but then we'd break the current meaning of the cost of an "edge" between two jobs in a route. If a break is involved, this cost would need to account for previous/subsequent jobs/breaks (sometimes at several level of distance), introducing a whole new layer of complex case checks whenever a travel time cost has to be evaluated. Considering this happens everywhere throughout the code-base, I fear we'd end up with an unmaintainable code.

On the other hand, if we don't include breaks directly in TWRoute::route but somehow remember where they stand, then the whole cost-checking thing can remain unchanged. This would shift the touchy part to the time-related checks and would require to:

  • maintain a data structure storing break ranks relative to TWRoute::route
  • take breaks into account for all timing validity checks (TWRoute::is_valid_addition_for_tw and is_valid_removal)
  • take breaks into account for all route updates (TWRoute::add, remove and replace) and update breaks data

Also in case of several breaks for a vehicle at a given rank (think an empty route at the beginning of the heuristic), we need to account for the insertion position of new jobs with regard to breaks. The best way to do this is probably to expose this position to the above validity checks and update functions.

EDIT: I updated the task list accordingly.

@jcoupey jcoupey merged commit c3bb7f8 into master May 2, 2020
@jcoupey jcoupey mentioned this pull request May 2, 2020
@jcoupey jcoupey deleted the feature/breaks branch May 2, 2020 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant