- Notifications
You must be signed in to change notification settings - Fork 163
feat: enable sorting for CH with list variable #1833
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
Conversation
| @triceo I noticed other factories used by configurations and annotations that are not located in the public API. Maybe, we should handle that in a separate PR as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As always, the different selector combinations are causing me to ask questions - see inline.
Downstream tests are failing.
Also, please provide a migration recipe for the move of the interface to the public API; the uses of the old interface should be replaced by the new one.
Finally, the change needs to show up in the upgrade recipe in our docs.
core/src/main/java/ai/timefold/solver/core/api/domain/common/ComparatorFactory.java Show resolved Hide resolved
core/src/main/java/ai/timefold/solver/core/api/domain/common/ComparatorFactory.java Show resolved Hide resolved
core/src/main/java/ai/timefold/solver/core/api/domain/common/SorterWeightFactory.java Outdated Show resolved Hide resolved
core/src/main/java/ai/timefold/solver/core/api/domain/variable/PlanningListVariable.java Outdated Show resolved Hide resolved
...efold/solver/core/impl/heuristic/selector/common/decorator/SelectionSorterWeightFactory.java Outdated Show resolved Hide resolved
...in/java/ai/timefold/solver/core/impl/heuristic/selector/list/DestinationSelectorFactory.java Outdated Show resolved Hide resolved
...in/java/ai/timefold/solver/core/impl/heuristic/selector/list/DestinationSelectorFactory.java Outdated Show resolved Hide resolved
89b3bd0 to beebea8 Compare
I have included a recipe for automatic migration to the new interface. Do we need to add anything to our docs? |
beebea8 to bd61abc Compare There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
General comments:
- Deprecated declarations should move towards the end of the file. We want to see the active code first.
- Plenty of places use the word "sorterComparator" where it should just be "comparator"; other places already use "comparator". This needs to be standardized.
- If we ever touch code that uses
@NonNull, let's convert it to@NullMarked. Reduces boilerplate.
Most importantly though - this PR has the same potential to break the solver, just like 1.26.0 did. What can we do to ensure that the same problem isn't repeated?
I suggest you ask Marek to try this with his sorting PoC in FSR. That will prove it still does what it needs to do. Carefully testing ESS will ensure the old code still works, because AFAIK ESS was already using it.
I am not yet done with the review, but this should be enough for now. With this, the codebase will change enough that I'll have to re-read it anyway.
core/src/main/java/ai/timefold/solver/core/api/domain/common/ComparatorFactory.java Outdated Show resolved Hide resolved
core/src/main/java/ai/timefold/solver/core/api/domain/common/ComparatorFactory.java Outdated Show resolved Hide resolved
core/src/main/java/ai/timefold/solver/core/api/domain/entity/PlanningEntity.java Outdated Show resolved Hide resolved
core/src/main/java/ai/timefold/solver/core/api/domain/entity/PlanningEntity.java Show resolved Hide resolved
...n/java/ai/timefold/solver/core/impl/heuristic/selector/move/AbstractMoveSelectorFactory.java Outdated Show resolved Hide resolved
...n/java/ai/timefold/solver/core/impl/heuristic/selector/move/AbstractMoveSelectorFactory.java Outdated Show resolved Hide resolved
...rc/main/java/ai/timefold/solver/core/impl/heuristic/selector/value/ValueSelectorFactory.java Outdated Show resolved Hide resolved
...rc/main/java/ai/timefold/solver/core/impl/heuristic/selector/value/ValueSelectorFactory.java Outdated Show resolved Hide resolved
...rc/main/java/ai/timefold/solver/core/impl/heuristic/selector/value/ValueSelectorFactory.java Outdated Show resolved Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forgot to submit these comments as well.
...tdomain/valuerange/sort/comparator/oldapproach/TestdataOldSortableEntityProvidingEntity.java Outdated Show resolved Hide resolved
docs/src/modules/ROOT/pages/optimization-algorithms/overview.adoc Outdated Show resolved Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Big PR! Finally got through all of it.
Leaving some more comments, but I think we're getting there.
None of these changes will affect performance of the code, therefore the existing experiments are not invalidated.
core/src/main/java/ai/timefold/solver/core/api/domain/common/ComparatorFactory.java Outdated Show resolved Hide resolved
core/src/main/java/ai/timefold/solver/core/api/domain/common/ComparatorFactory.java Outdated Show resolved Hide resolved
core/src/main/java/ai/timefold/solver/core/api/domain/entity/PlanningEntity.java Outdated Show resolved Hide resolved
core/src/main/java/ai/timefold/solver/core/api/domain/variable/PlanningVariable.java Outdated Show resolved Hide resolved
core/src/main/java/ai/timefold/solver/core/impl/domain/entity/descriptor/EntityDescriptor.java Outdated Show resolved Hide resolved
...ai/timefold/solver/core/impl/heuristic/selector/common/decorator/FactorySelectionSorter.java Outdated Show resolved Hide resolved
.../test/java/ai/timefold/solver/core/impl/heuristic/selector/move/MoveSelectorFactoryTest.java Outdated Show resolved Hide resolved
docs/src/modules/ROOT/pages/using-timefold-solver/modeling-planning-problems.adoc Show resolved Hide resolved
migration/src/main/java/ai/timefold/solver/migration/v8/SortingMigrationRecipe.java Show resolved Hide resolved
migration/src/test/java/ai/timefold/solver/migration/v8/SortingMigrationRecipeTest.java Outdated Show resolved Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, assuming that the verification on models passes.
| Anything you still want to do, @zepfred? |
|



No description provided.