Skip to content

feat: let a nearby distance meter declare several distance matrices - #2842

Merged
triceo merged 18 commits into
TimefoldAI:mainfrom
triceo:nearby-multiple-matrices
Dec 4, 2026
Merged

triceo merged 18 commits into
TimefoldAI:mainfrom
triceo:nearby-multiple-matrices

Conversation

@triceo

@triceo triceo commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator

Stacked on #2841. Until #2841 merges, this PR also shows its commits.
Review only the 7 commits from "feat: let a nearby distance meter declare several distance matrices" onwards.

  • NearbyDistanceMeter gets default methods for several distance matrices:
    getDistanceMatrixCount(), getDistanceMatrixIndex(neighbor) and getNearbyDistance(moved, neighbor, matrix).
    Existing meters compile and work without changes.
  • Docs: a new section "Several distance matrices" in the move selector reference,
    and the upgrade note "Nearby selection ranks moves by the trips they create".

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

triceo added 16 commits December 4, 2026 11:47
A meter can count its distance matrices from the dataset, for example
from the transport types of its vehicles. The solver calls the method
once when solving starts, and again after each problem change.
NearbyDistanceMeter keeps only its distance method. A meter with several
distance matrices implements the new MatrixAwareNearbyDistanceMeter. Its
entry point, initializeDistanceMatrices(Solution_), is called once each
time solving starts and may create state. The docs show the plain meter
first and the matrices in their own section.
Also align the nearby Javadoc and the upgrade note with the behavior:
moved item and neighbor wording, A/B naming, and the changes that apply
to every meter.
@triceo
triceo force-pushed the nearby-multiple-matrices branch from 3d3bf75 to ba5497f Compare December 4, 2026 10:59
@triceo triceo added this to the v2.10.0-rc-1 milestone Dec 4, 2026
@triceo
triceo merged commit 177d722 into TimefoldAI:main Dec 4, 2026
19 checks passed
@triceo
triceo deleted the nearby-multiple-matrices branch December 4, 2026 14:47
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.

3 participants