Replies: 2 comments 1 reply
-
|
This is a transitive score corruption. Constraint Streams are incremental - meaning they only recompute constraints when something changes. In this case, What the solver won't do and can't do is to look inside your What happens therefore is that the constraint will only be recomputed when The fixed constraint code solves the problem by explicitly declaring a dependency on the other task as well. That way, the constraint will be recomputed when either of them change, getting rid of any score corruptions. |
Beta Was this translation helpful? Give feedback.
-
|
Okay, thank you so much for your detailed explanation! @triceo I'm not sure if this is a correct understanding: when a task changes, the solver detects this and recalculates the score between the task and its dependencyTask. However, when the dependencyTask changed, the solver is unaware of this change between the task and its dependencyTask, and therefore cannot detect this action (in fact, their times have changed). Consequently, no recalculation of the score is triggered, and score corruption occurs. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I found a case for Score Corruption in Timefold presentations.
https://github.com/TimefoldAI/timefold-presentations/blob/63b0533992436e54922e6bc689a77bd6f88a06ad/events/2024-11-05-BYOM_score_calculation.html#L290
I don't understand its causes. Could someone explain why?
This constraint ensures that a task's start time is no earlier than the end time of its dependent task.
Why does using
task.start < task.dependencyTask.endas a condition cause Score Corruption? However, finding a task and its dependent tasks usingjoinand checking if the times are reasonable doesn't cause this exception?.join(Task.class, equal(task -> task, task -> task.dependencyTask).filter(task1, task2 ->task1.start < task2.end)Many thanks!
Beta Was this translation helpful? Give feedback.
All reactions