How to understand Loop Detection in Section 20.3.3.2?

63 views
Skip to first unread message

Qiang Gao

unread,
Aug 8, 2021, 6:16:44 AM8/8/21
to OptaPlanner development
Hi, I'm building a flowshop machine scheduling model with ChainThroughTime pattern and facing variable listener corruption if a loop is found while updating each task's start time. 
But I could not understand the description "put all shadow variables involved to arrivalTime null (never) ". 

Does this mean I should set tasks' start time to null if they are in a loop in  customer variable listener function? What does (never) stand for?  Could this cause VariableListener corruption? 

Thanks for your help.

Jiří Locker

unread,
Sep 4, 2021, 5:15:11 AM9/4/21
to OptaPlanner development
I agree the text is confusing. I have updated it.

Note, that we don't have an example demonstrating this approach so this is a best-effort advice:

I think that "never" means you should set the shadow variable to a special value indicating that the activity can never start. Null is a good special value. Others could be -1, Integer.MAX_VALUE or similar. In any case, you should have a hard constraint for such condition that will make the solution infeasible. The variable listener loop is a symptom of infeasible chain order. Clearly, if you have Ann{A1, B1} and Bob{B2, A2} it's impossible to execute both As and Bs simultaneously while keeping this order (no matter how hard the variable listener tries to auto-delay their startTimes).

As I said, we don't have an example proving this concept actually works. Please share more details if you get variable listener corruption.

BR,
Jiri

Qiang Gao

unread,
Sep 15, 2021, 2:07:33 AM9/15/21
to OptaPlanner development
Jiri , thanks  for your reply and update. 

When a loop was detected in my model, setting shadow variables to Null and penalizing with a hard constraint did work well. No variable listener corruption so far.  The official user guide is well written and worth reading from time to time if I'm stuck when building a new model.
Reply all
Reply to author
Forward
0 new messages