1.20 new consistency checks issue, for changing shadow variables, due to fact changes rather that genuine variable changes #1449
christian8096
started this conversation in
General
Replies: 1 comment 3 replies
-
Hello @christian8096, without having access to your codebase, it is difficult for me to point to any particular problem. Instead, I'll just list some basic guidelines:
I believe that, if you follow all of these rules, the exception will go away. If you experience the contrary, please provide code that reproduces this behavior - we have not yet seen any instances where the assertions would be misfiring. You can of course also get rid of the assertion by using the |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Upgrading to 1.20 we ran into an issue: The new checks in 1.20 flags a shadow variable (start time) changed without any of its genuine planning variables was changed.
The error states “ shadow variable (meeting.startIndexInGrains)'s corrupted value (108) changed to uncorrupted value (144) after all variable listeners were triggered without changes to the genuine variables.”
This is correct and as intended! As we use a sort of chained pattern where an entity also depends on a mix of previous entities shadow variable ( start time ) and facts ( unavailable time periods) that can both affect the shadow variable of a later meeting as well as its genuine variables.
The entity does not reference all these previous entities and facts itself, it is kept in a parallel data model which is updated by a custom variable listener that is called when any of it genuine variables are changed, but also called whenever a fact of the “unavailable time” is added or removed. Hence it works as we would expect, but not as Timefold would expect.
The cascading changes of shadow variables from meeting entities does not seem to trigger the error, it is when a fact is changed, that cause the meetings to change by triggering the custom variable listener, which again moves the meetings, without any genuine variables was changes.
Can this be remedied without moving all the affecting facts into the Meeting.class or can the shadow variable annotation have source variables that point to the ProblemFactCollections of the PlanningSolution in someway or is there a another solution.
Timefold already detects the fact change and trigger all listeners, So it seems that the result is consistent even though we get the error ?
Beta Was this translation helpful? Give feedback.
All reactions