-
Bug
-
Resolution: Done
-
Major
-
6.2.0.CR2
-
None
I've been getting the error
Exception in thread "main" java.lang.IllegalStateException: Score corruption: the workingScore (-1300hard/0soft) is not the uncorruptedScore (-1320hard/0soft) after completedAction ([ShiftAssignment for shift: MONDAY, from 8:0 to 8:20, assigned employee: null => null, ShiftAssignment for shift: MONDAY, from 8:0 to 8:20, assigned employee: null => null]):
Score corruption analysis could not be generated because either corrupted constraintMatchEnabled (true) or uncorrupted constraintMatchEnabled (false) is disabled.
Check your score constraints manually.
at org.optaplanner.core.impl.score.director.AbstractScoreDirector.assertWorkingScoreFromScratch(AbstractScoreDirector.java:296)
at org.optaplanner.core.impl.phase.scope.AbstractPhaseScope.assertExpectedUndoMoveScore(AbstractPhaseScope.java:139)
at org.optaplanner.core.impl.constructionheuristic.decider.ConstructionHeuristicDecider.doMove(ConstructionHeuristicDecider.java:108)
at org.optaplanner.core.impl.constructionheuristic.decider.ConstructionHeuristicDecider.decideNextStep(ConstructionHeuristicDecider.java:77)
at org.optaplanner.core.impl.constructionheuristic.DefaultConstructionHeuristicPhase.solve(DefaultConstructionHeuristicPhase.java:67)
at org.optaplanner.core.impl.solver.DefaultSolver.runPhases(DefaultSolver.java:213)
at org.optaplanner.core.impl.solver.DefaultSolver.solve(DefaultSolver.java:176)
at TeRo.TeRoAppMain.main(TeRoAppMain.java:25)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)
when executing the following rule with an EasyScoreCalculator
// Employees are forced to work the exact amount specified in their contracts rule "employeeWeeklyHours" when $employee : Employee( $weeklyHours : weeklyHours, weeklyHoursAreMandatory == true ) $totalWorkAssignedMinutes : Number(intValue != $weeklyHours * 60) from accumulate( $shiftAssignment : ShiftAssignment( $shift : shift ) and eval($shiftAssignment.employeeIsAssigned($employee) == true) and Shift(this == $shift, $shiftTime : shiftTime), sum($shiftTime.getShiftTotalMinutes()) ) then scoreHolder.addHardConstraintMatch( kcontext, -1 * Math.abs($totalWorkAssignedMinutes.intValue() - $weeklyHours * 60) ); end