Replies: 1 comment 2 replies
-
Hello @kentbill! Well spotted. Variable listeners can only modify shadow variables, as opposed to genuine variables. That was supposed to have been the key message there. In the Quickstart, you see us modifying fields which are neither genuine nor shadow variables. This is not a problem, as long as:
Even though our use in the Quickstart is safe, it is clearly a grey area and we should've avoided it. We are prototyping on a new approach to shadow variables which - if it works out - will eliminate these issues by eliminating variable listeners. ;-) Stay tuned! |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In the Project Job Scheduling example of QuickStarts, the fields startDate, endDate, and busyDates have been changed by the VariableListener, as shown in the following code.
https://github.com/TimefoldAI/timefold-quickstarts/blob/68b4e3f05954c04a97459390416b11887acfa3bf/java/project-job-scheduling/src/main/java/org/acme/projectjobschedule/domain/solver/PredecessorsDoneDateUpdatingVariableListener.java#L47
and
https://github.com/TimefoldAI/timefold-quickstarts/blob/68b4e3f05954c04a97459390416b11887acfa3bf/java/project-job-scheduling/src/main/java/org/acme/projectjobschedule/domain/Allocation.java#L172
Does it violate the principle that "VariballeListener can only modify shadow variables"?
https://github.com/TimefoldAI/timefold-solver/blob/c411ceba8fa58bccdd93e9bd83a889eb9e3ccbc5/docs/src/modules/ROOT/pages/using-timefold-solver/modeling-planning-problems.adoc?plain=1#L872
Beta Was this translation helpful? Give feedback.
All reactions