I am trying to run a simple test case which has 2 Shifts(PlanningEntity) and 2 Employees (PlanningVariable)
On running my test case , its running in infinite loop with below logs
NORMAL_OUTPUT{ 2024-07-23 15:30:12 TRACE FilteringMoveSelector:133 –
Move (com.business.shift.entity.ShiftOccurrence@ec8c4d30
{com.business.shift.EmployeeShiftDetails@ea28db8b} <->
com.business.shift.entity.ShiftOccurrence@ec8c4d30
{com.business.shift.EmployeeShiftDetails@ea28db8b}) filtered out by a
selection filter (Doable moves only). []NORMAL_OUTPUT{ 2024-07-23 15:30:12 TRACE FilteringMoveSelector:133 –
Move (com.business.shift.entity.ShiftOccurrence@ec8c4d30
{com.business.shift.EmployeeShiftDetails@ea28db8b} <->
com.business.shift.entity.ShiftOccurrence@ec8c4d30
{com.business.shift.EmployeeShiftDetails@ea28db8b}) filtered out by a
selection filter (Doable moves only). []NORMAL_OUTPUTv 2024-07-23 15:30:12 TRACE LocalSearchDecider:128 –
Move index (0), score (0hard/0soft), accepted (true), move
(com.business.shift.entity.ShiftOccurrence@ec8c4d30
{com.business.shift.EmployeeShiftDetails@ea28db8b} <->
com.business.shift.entity.ShiftOccurrence@d1e5fb82
{com.business.shift.EmployeeShiftDetails@8f27f1f}). []NORMAL_OUTPUTÇ 2024-07-23 15:30:12 DEBUG DefaultLocalSearchPhase:136
LS step (4393290), time spent (487837), score (0hard/0soft), best score (0hard/0soft), accepted/selected move count (1/1), picked
move (com.business.shift.entity.ShiftOccurrence@ec8c4d30
{com.business.shift.EmployeeShiftDetails@ea28db8b} <->
com.business.shift.entity.ShiftOccurrence@d1e5fb82
{com.business.shift.EmployeeShiftDetails@8f27f1f}). []NORMAL_OUTPUTy 2024-07-23 15:30:12 TRACE FilteringMoveSelector:133 –
Move (com.business.shift.entity.ShiftOccurrence@ec8c4d30
{com.business.shift.EmployeeShiftDetails@8f27f1f} <->
com.business.shift.entity.ShiftOccurrence@ec8c4d30
{com.business.shift.EmployeeShiftDetails@8f27f1f}) filtered out by a
selection filter (Doable moves only). []NORMAL_OUTPUTv 2024-07-23 15:30:12 TRACE LocalSearchDecider:128 –
Move index (0), score (0hard/0soft), accepted (true), move
(com.business.shift.entity.ShiftOccurrence@d1e5fb82
{com.business.shift.EmployeeShiftDetails@ea28db8b} <->
com.business.shift.entity.ShiftOccurrence@ec8c4d30
{com.business.shift.EmployeeShiftDetails@8f27f1f}). []NORMAL_OUTPUTÇ 2024-07-23 15:30:12 DEBUG DefaultLocalSearchPhase:136
LS step (4393291), time spent (487838), score (0hard/0soft), best score (0hard/0soft), accepted/selected move count (1/1), picked
move (com.business.shift.entity.ShiftOccurrence@d1e5fb82
{com.business.shift.EmployeeShiftDetails@ea28db8b} <->
com.business.shift.entity.ShiftOccurrence@ec8c4d30
{com.business.shift.EmployeeShiftDetails@8f27f1f}). []NORMAL_OUTPUT6 2024-07-23 15:30:12 TRACE LocalSearchDecider:128 –
Move index (0), score (0hard/0soft), accepted (true), move
(com.business.shift.entity.ShiftOccurrence@ec8c4d30
{com.business.shift.EmployeeShiftDetails@ea28db8b ->
com.business.shift.EmployeeShiftDetails@8f27f1f}). []NORMAL_OUTPUT‡ 2024-07-23 15:30:12 DEBUG DefaultLocalSearchPhase:136
LS step (4393292), time spent (487838), score (0hard/0soft), best score (0hard/0soft), accepted/selected move count (1/1), picked
move (com.business.shift.entity.ShiftOccurrence@ec8c4d30
{com.business.shift.EmployeeShiftDetails@ea28db8b ->
com.business.shift.EmployeeShiftDetails@8f27f1f}). []NORMAL_OUTPUTy 2024-07-23 15:30:12 TRACE FilteringMoveSelector:133 –
Move (com.business.shift.entity.ShiftOccurrence@d1e5fb82
{com.business.shift.EmployeeShiftDetails@8f27f1f} <->
com.business.shift.entity.ShiftOccurrence@d1e5fb82
{com.business.shift.EmployeeShiftDetails@8f27f1f}) filtered out by a
selection filter (Doable moves only). []NORMAL_OUTPUT9 2024-07-23 15:30:12 TRACE FilteringMoveSelector:133 –
Move (com.business.shift.entity.ShiftOccurrence@ec8c4d30
{com.business.shift.EmployeeShiftDetails@8f27f1f ->
com.business.shift.EmployeeShiftDetails@8f27f1f}) filtered out by a
selection filter (Doable moves only). []
To debug the issue, below is what I tried
-
If my understanding is correct, this issue could happen when constraints are tight this could happen, hence I commented all the constraints
-
Made sure that the problem is not complex with simple data [only 2 Shifts and 2 Employees ]
-
Enabled trace logs to debug , to see if i get any information
Questions I have is
- How to find out the cause of inifinite loop
- Though i have set timefold.solver.termination.spent-limit=1m why doesnt the solver terminate ?
- Under what condition does solver get into infinite loop
Below is the simple test data that I am running – 2 ShiftOccurrences(PlanningEntity) and 2 EmployeeShiftDetails (PlanningVariable)