Neighborhoods: finishing touches#2010
Conversation
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 44 out of 44 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
zepfred
left a comment
There was a problem hiding this comment.
Looks great to me once the final comments are resolved!
fe3eb11 to
921cb13
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 67 out of 67 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.
|



The PR has 3 distinct parts:
The 3 commits require each other to function, therefore they are provided as a single PR. But they will be merged without squashing.