-
Notifications
You must be signed in to change notification settings - Fork 175
feat: allow shadow variable updaters to read the solution #2029
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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 adds the ability for shadow variable supplier methods (updater methods annotated with @ShadowSources) to optionally accept the solution as a parameter. This allows shadow variable calculations to read global solution data when needed.
Changes:
- Core implementation now supports shadow variable supplier methods with an optional solution parameter
- Quarkus and Spring Boot integrations updated to handle the new optional parameter
- Test coverage added for both parameterized and non-parameterized shadow variable suppliers
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| DeclarativeShadowVariableDescriptor.java | Adds logic to lookup supplier methods with optional solution parameter |
| VariableUpdaterInfo.java | Changes calculator from Function to BiFunction to pass solution |
| ChangedVariableNotifier.java | Adds getWorkingSolution() method to provide solution to calculators |
| SingleDirectionalParentVariableReferenceGraph.java | Updates to pass calculator accessor instead of lambda |
| DefaultShadowVariableSessionFactory.java | Updates to pass calculator accessor instead of lambda |
| TimefoldProcessor.java | Updates Quarkus build-time method lookup to handle optional solution parameter |
| IntegrationTestEntity.java | Adds test shadow variables with and without solution parameter |
| IntegrationTestSolution.java | Adds dummy method to support solution parameter test |
| TestdataStringLengthShadowEntity.java | Adds test shadow variables with and without solution parameter |
| TestdataStringLengthShadowSolution.java | Adds dummy method to support solution parameter test |
| TestdataBasicVarParameter*.java | New test domain classes demonstrating the feature |
| TestdataInvalidDeclarativeParameter*.java | New test domain classes for invalid parameter validation |
| TestdataCountingValue.java | Updated signature to accept solution parameter |
| TestdataConcurrentValue.java | Updated signature to accept solution parameter |
| RootVariableSourceTest.java | Adds test for invalid parameter type detection |
| ShadowVariableUpdateTest.java | Adds test for shadow variables with solution parameter |
...mefold/solver/core/impl/domain/variable/declarative/DeclarativeShadowVariableDescriptor.java
Outdated
Show resolved
Hide resolved
...st/java/ai/timefold/solver/core/impl/domain/variable/declarative/RootVariableSourceTest.java
Outdated
Show resolved
Hide resolved
...a/ai/timefold/solver/core/testdomain/shadow/parameter/TestdataBasicVarParameterSolution.java
Outdated
Show resolved
Hide resolved
...ava/ai/timefold/solver/core/testdomain/shadow/parameter/TestdataBasicVarParameterEntity.java
Outdated
Show resolved
Hide resolved
...mefold/solver/core/impl/domain/variable/declarative/DeclarativeShadowVariableDescriptor.java
Outdated
Show resolved
Hide resolved
...uarkus/deployment/src/main/java/ai/timefold/solver/quarkus/deployment/TimefoldProcessor.java
Outdated
Show resolved
Hide resolved
...uarkus/deployment/src/main/java/ai/timefold/solver/quarkus/deployment/TimefoldProcessor.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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 23 out of 23 changed files in this pull request and generated 4 comments.
core/src/test/java/ai/timefold/solver/core/impl/domain/variable/ShadowVariableUpdateTest.java
Outdated
Show resolved
Hide resolved
...est/java/ai/timefold/solver/core/impl/domain/solution/descriptor/SolutionDescriptorTest.java
Outdated
Show resolved
Hide resolved
...ation-test/src/main/java/ai/timefold/solver/spring/boot/it/domain/IntegrationTestEntity.java
Show resolved
Hide resolved
core/src/test/java/ai/timefold/solver/core/impl/domain/variable/ShadowVariableUpdateTest.java
Outdated
Show resolved
Hide resolved
|



No description provided.