Skip to content

feat: add replaceValue... methods to MutableSolutionView#2180

Merged
triceo merged 6 commits intoTimefoldAI:mainfrom
triceo:smarter
Mar 13, 2026
Merged

feat: add replaceValue... methods to MutableSolutionView#2180
triceo merged 6 commits intoTimefoldAI:mainfrom
triceo:smarter

Conversation

@triceo
Copy link
Copy Markdown
Collaborator

@triceo triceo commented Mar 10, 2026

In addition to moveValue...

Copilot AI review requested due to automatic review settings March 10, 2026 19:09
Copy link
Copy Markdown
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 PR optimizes moving and swapping elements inside planning list variables in MoveDirector, aiming to reduce per-move overhead on the solver hot path.

Changes:

  • Introduces a moveInList(...) helper that selects between Collections.rotate and remove+add based on move distance/position.
  • Updates moveValueInList(...) to use the new helper and return the moved value via the list after mutation.
  • Replaces manual swap logic with Collections.swap(...) in swapValuesInList(...).

Copy link
Copy Markdown
Contributor

@Christopher-Chianelli Christopher-Chianelli left a comment

Choose a reason for hiding this comment

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

LGTM when tests are green.

@triceo
Copy link
Copy Markdown
Collaborator Author

triceo commented Mar 11, 2026

@Christopher-Chianelli Since I was already here, I decided to implement a feature request from the models. Please re-review, new code was added.

@winklerm Was this what you had in mind?

@triceo triceo linked an issue Mar 11, 2026 that may be closed by this pull request
@triceo triceo added this to the v2.0.0 milestone Mar 11, 2026
@triceo triceo requested a review from Copilot March 11, 2026 08:29
Copy link
Copy Markdown
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 3 out of 3 changed files in this pull request and generated 3 comments.

Copy link
Copy Markdown
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 3 out of 3 changed files in this pull request and generated 3 comments.

Copilot AI review requested due to automatic review settings March 11, 2026 10:13
Copy link
Copy Markdown
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 3 out of 3 changed files in this pull request and generated 2 comments.

Copilot AI review requested due to automatic review settings March 11, 2026 10:31
Copy link
Copy Markdown
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 3 out of 3 changed files in this pull request and generated 1 comment.

Copilot AI review requested due to automatic review settings March 11, 2026 10:36
Copy link
Copy Markdown
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 3 out of 3 changed files in this pull request and generated 1 comment.

@triceo triceo changed the title perf: improve value move within a list feat: add replaceValue... methods to MutableSolutionView Mar 11, 2026
@winklerm
Copy link
Copy Markdown
Contributor

@winklerm Was this what you had in mind?

Yes, thank you very much!!

Copy link
Copy Markdown
Contributor

@Christopher-Chianelli Christopher-Chianelli left a comment

Choose a reason for hiding this comment

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

Code LGTM; although I think a better name can be chosen for replaceValueBetweenLists.

@triceo triceo removed this from the v2.0.0 milestone Mar 13, 2026
@sonarqubecloud
Copy link
Copy Markdown

@triceo triceo merged commit 6c99a5b into TimefoldAI:main Mar 13, 2026
19 checks passed
@triceo triceo deleted the smarter branch March 13, 2026 07:00
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.

Feat: MutableSolutionView.replaceValue()

4 participants