-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge solutions not settlements (#2471)
# Description Currently merging multiple solutions into a larger one happens in the `Settlement` type and reuses the legacy settlement encoder. As part of our initiative to fully transition away from the legacy code base this PR moves solution merging logic into our solution domain model. This means we will now merge solutions before simulating and encoding them. This can potentially lead to a lot more solution candidates being generated and requiring simulation. I don't expect this to be an issue in practice as encoding is already part of a stream which will yield the best solution candidate found so far as soon as we approach the solving deadline (thought may have to go into in which order solution candidate should be attempted to be simulated). # Changes <!-- List of detailed changes (how the change is accomplished) --> - [x] Implement `merge` method on `Solution` - [x] Change the `Id` type on `Solution` to be able to represent when a solution was generated from multiple sub-solutions. - [x] Replace `settlement.merge` with `solution.merge` (this means merging now happens before first simulation) - [x] Change the way merge candidates are generated - [x] Sort stream of to encode settlements by "simples" ie least merged solution (might want to use `score` instead once #2448 is merged) Depending on how risky we think this change is, we can also keep the existing merging logic and have a feature flag guard the two codepaths. ## How to test Existing unit test ## Related Issues Fixes #1478
- Loading branch information
Showing
11 changed files
with
294 additions
and
203 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.