Skip to content

Conversation

@triceo
Copy link
Collaborator

@triceo triceo commented Jan 28, 2026

Updates Javadocs of several MutableSolutionView methods to better reflect the actual behavior.
Also introduces new assignValue options to support some corner cases.
Adds plenty of test coverage for each.

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@triceo
Copy link
Collaborator Author

triceo commented Jan 28, 2026

Tagging @Christopher-Chianelli for review because I had to touch the multi-stage move.

@triceo triceo marked this pull request as ready for review January 28, 2026 09:15
Copilot AI review requested due to automatic review settings January 28, 2026 09:15
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 4 out of 4 changed files in this pull request and generated 5 comments.

Copy link
Contributor

@zepfred zepfred left a comment

Choose a reason for hiding this comment

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

Looks good to me. My only suggestion is to include tests for scenarios where the source and destination entities are the same, as well as for the indexes.

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Contributor

@winklerm winklerm left a comment

Choose a reason for hiding this comment

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

Thank you, that is very helpful!

Copilot AI review requested due to automatic review settings January 28, 2026 11:02
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 12 out of 12 changed files in this pull request and generated 2 comments.

@triceo
Copy link
Collaborator Author

triceo commented Jan 28, 2026

Taking it back to draft again, because it still doesn't work right.
List variable listeners are a mess.

@triceo triceo marked this pull request as ready for review January 28, 2026 12:37
Copilot AI review requested due to automatic review settings January 28, 2026 12:37
@triceo triceo changed the title chore: improve MutableSolutionView API description around list variable chore: improve MutableSolutionView API around list variables Jan 28, 2026
Comment on lines +87 to +97
externalScoreDirector.beforeListVariableChanged(variableDescriptor, destinationEntity, destinationIndex,
destinationIndex + 1);
var actualOldValue = variableDescriptor.setElement(destinationEntity, destinationIndex, planningValue);
if (oldValue != actualOldValue) {
throw new IllegalStateException(
"Impossible state: The value (%s) at index (%d) of entity (%s) is not as expected (%s)."
.formatted(actualOldValue, destinationIndex, destinationEntity, oldValue));
}
externalScoreDirector.afterListVariableChanged(variableDescriptor, destinationEntity, destinationIndex,
destinationIndex + 1);
Copy link
Collaborator Author

@triceo triceo Jan 28, 2026

Choose a reason for hiding this comment

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

These notifications negate the performance benefit of this approach.
We only replace an element at a given place in the list, meaning nothing in the list needs to move back or forth; yet, these variable change notifications will still move things in the list.

I wonder if it could somehow be improved...

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 13 out of 13 changed files in this pull request and generated 1 comment.

@sonarqubecloud
Copy link

@triceo triceo merged commit d9085ed into TimefoldAI:main Jan 28, 2026
33 of 34 checks passed
@triceo triceo deleted the corner branch January 28, 2026 15:31
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.

4 participants