Skip to content

Conversation

@triceo
Copy link
Collaborator

@triceo triceo commented Jan 11, 2026

Adding default neighborhood provider.
Significantly improving performance.

Copy link
Contributor

Copilot AI left a 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.

Copy link
Contributor

Copilot AI left a 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.

@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
60.1% Coverage on New Code (required ≥ 70%)

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant