可空的计划变量会破坏分数

时间:2017-12-29 12:44:18

标签: optaplanner

我有一个计划问题,它为班次分配了一些区间,但是某些区间无法分配给班次,因此计划变量为nullable。但问题是,使用FULL_ASSERT说:

java.lang.IllegalStateException: UndoMove corruption: the beforeMoveScore (-20hard/0medium/-1343soft) is not the undoScore (-15hard/0medium/-1343soft) which is the uncorruptedScore (-15hard/0medium/-1343soft) of the workingSolution.
  1) Enable EnvironmentMode FULL_ASSERT (if you haven't already) to fail-faster in case there's a score corruption.
  2) Check the Move.createUndoMove(...) method of the moveClass (class org.optaplanner.core.impl.heuristic.selector.move.generic.ChangeMove). The move (14[19:00-19:15] {null -> com.kairos.shiftplanning.domain.ShiftRequestPhase@af44779}) might have a corrupted undoMove (Undo(14[19:00-19:15] {null -> com.kairos.shiftplanning.domain.ShiftRequestPhase@af44779})).
  3) Check your custom VariableListeners (if you have any) for shadow variables that are used by the score constraints with a different score weight between the beforeMoveScore (-20hard/0medium/-1343soft) and the undoScore (-15hard/0medium/-1343soft).

上面14[19:00-19:15]是我的区间实体的toString()方法。我认为,它会转移分配null->some_value,但它不会生成some_value->null的undoMove。我应该实现自己的Move类吗?

Optaplanner版本:7.3.0.Final

0 个答案:

没有答案