-
Notifications
You must be signed in to change notification settings - Fork 169
Neighborhoods: finishing touches #2010
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
base: main
Are you sure you want to change the base?
Conversation
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.
Pull request overview
This pull request contains finishing touches for the Neighborhoods API feature, focusing on simplifications, optimizations, and better default behavior.
Changes:
- Removed planning ID-based duplicate filtering from swap move providers to simplify implementation and improve performance
- Added a default neighborhood provider that automatically provides change and swap moves when the Neighborhoods API is enabled
- Refactored indexer infrastructure to support both iteration and random access patterns more efficiently
Reviewed changes
Copilot reviewed 32 out of 32 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| docs/src/modules/ROOT/pages/optimization-algorithms/neighborhoods.adoc | Updated documentation to clarify default neighborhood behavior and future plans |
| core/src/test/java/ai/timefold/solver/core/preview/api/move/builtin/SwapMoveProviderTest.java | Updated tests to expect duplicate swap moves (A<>B and B<>A) |
| core/src/test/java/ai/timefold/solver/core/preview/api/move/builtin/ListSwapMoveProviderTest.java | Updated tests to expect duplicate swap moves |
| core/src/test/java/ai/timefold/solver/core/impl/solver/DefaultSolverTest.java | Fixed exception type and added test for default neighborhood provider |
| core/src/test/java/ai/timefold/solver/core/impl/bavet/common/index/EqualsAndComparisonIndexerTest.java | Added test for random access indexer functionality |
| core/src/test/java/ai/timefold/solver/core/impl/neighborhood/stream/enumerating/common/SelectionProbabilityTest.java | Refactored to use new ElementAccessor interface |
| core/src/main/java/ai/timefold/solver/core/preview/api/move/builtin/SwapMoveProvider.java | Removed planning ID logic, allowing duplicate swaps for simplicity and performance |
| core/src/main/java/ai/timefold/solver/core/preview/api/move/builtin/ListSwapMoveProvider.java | Removed planning ID logic and simplified type parameters |
| core/src/main/java/ai/timefold/solver/core/impl/neighborhood/DefaultNeighborhoodProvider.java | New default provider for basic change and swap moves |
| core/src/main/java/ai/timefold/solver/core/impl/localsearch/DefaultLocalSearchPhaseFactory.java | Added logic to use default neighborhood provider and improved validation |
| core/src/main/java/ai/timefold/solver/core/impl/heuristic/HeuristicConfigPolicy.java | Added helper methods for checking preview feature enablement |
| core/src/main/java/ai/timefold/solver/core/impl/util/ElementAwareArrayList.java | Added iterator() and get() methods for improved access patterns |
| core/src/main/java/ai/timefold/solver/core/impl/neighborhood/stream/enumerating/* | Refactored to support storing right sequences in tuple stores for memory efficiency |
| core/src/main/java/ai/timefold/solver/core/impl/neighborhood/stream/enumerating/common/ElementAccessor.java | New interface abstracting element access for lists and indexers |
| core/src/main/java/ai/timefold/solver/core/impl/neighborhood/stream/enumerating/common/ListBasedElementAccessor.java | List-based implementation of ElementAccessor |
| core/src/main/java/ai/timefold/solver/core/impl/neighborhood/stream/enumerating/common/IndexerBasedElementAccessor.java | Indexer-based implementation of ElementAccessor |
| core/src/main/java/ai/timefold/solver/core/impl/neighborhood/stream/BiRandomMoveIterator.java | Optimized to store sequences in tuple stores instead of separate map |
| core/src/main/java/ai/timefold/solver/core/impl/bavet/common/index/* | Enhanced indexer API to support both iteration and random access |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
core/src/main/java/ai/timefold/solver/core/impl/localsearch/DefaultLocalSearchPhaseFactory.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.
Pull request overview
Copilot reviewed 32 out of 32 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|


Adding default neighborhood provider.
Significantly improving performance.