Cross-entity shadow variable dependency in FJSSP — what's the recommended approach as VariableListener gets deprecated? #2196
Replies: 3 comments 5 replies
-
|
Declarative shadow variables should solve that problem; take a look at |
Beta Was this translation helpful? Give feedback.
-
|
Hi everyone, sorry for the long silence — I'm re-opening this topic I started a while ago. Thanks to everyone who replied in the meantime. |
Beta Was this translation helpful? Give feedback.
-
|
I'm still getting tagged in every single @ShadowVariable mention lmfao
…On Fri, May 15, 2026 at 12:56 AM electrosilvia ***@***.***> wrote:
ok, this works, thank you, but it is very slowly.
I'd like to avoid inconsistent Operations before the constraint
recalculation.
—
Reply to this email directly, view it on GitHub
<#2196 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AALMIO3YUELFYOAVWOPTEC3423ERHAVCNFSM6AAAAACWWJ2N2OVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTMOJSG43DMNQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***
.com>
--
Leeban Ahmed
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Context
I'm modelling a Flexible Job Shop Scheduling Problem (FJSSP) using
@PlanningListVariableonMachine. The domain is:Machine(@PlanningEntity): holds@PlanningListVariable List<Operation> assignedOperationsOperation(@PlanningEntity + @ValueRangeProvider): hasstartTimeas a shadow variableJob(@ProblemFact): fixed sequence of operationsThe
startTimeof each operation depends on two independent sources:previousOperationOnMachine— the operation preceding it in the same machine's list (@PreviousElementShadowVariable)previousOperation— the preceding operation in the same job, which may be assigned to a completely different machineFormally:
startTime(op) = max(endTime(prevOnMachine), endTime(prevInJob))Current implementation
I'm using a
VariableListenerthat listens on bothchosenMachineandpreviousOperationOnMachine, propagates iteratively along the machine chain, and handles the cross-machine job dependency:The listener propagates iteratively (not recursively) along
assignedOperations:This works correctly, but the problem is: when
previousOperation.startTimechanges (because that operation moved to a different machine), nothing triggers a recomputation on the downstream operation in the job chain.The core issue
The cross-entity dependency is essentially:
startTimeof operation N depends onstartTimeof operation N-1, which lives in a differentMachine's list. This makes it a dependency across two separate@PlanningListVariablelists.I explored the possibility of also declaring
startTimeas a source of itself (to propagate along the job chain when it changes), but this would introduce a cycle in the shadow variable dependency graph, which Timefold would reject at initialization.@CascadingUpdateShadowVariableseems to handle intra-list propagation well, but I don't see a clean way to also react to cross-list changes from a different entity's shadow variable.Question
As
VariableListenermoves toward deprecation (and presumably removal in 2.0), what is the recommended approach to model this pattern?Is there a planned primitive or API for shadow variables with cross-entity, cross-list dependencies? Or is
@CascadingUpdateShadowVariableexpected to cover this somehow in 2.0?Happy to share more context if useful. Thanks!
Beta Was this translation helpful? Give feedback.
All reactions