在求解器配置我的本地搜索的部分看起来像:IllegalStateException异常分数腐败
<acceptor>
<lateAcceptanceSize>400</lateAcceptanceSize>
<entityTabuSize>9</entityTabuSize>
</acceptor>
<forager>
<acceptedCountLimit>2000</acceptedCountLimit>
</forager>
,一切工作正常,但是当我将其更改为(是什么导致优化增益,我认为):
<acceptor>
<lateAcceptanceSize>600</lateAcceptanceSize>
</acceptor>
<forager>
<acceptedCountLimit>4</acceptedCountLimit>
</forager>
求解器开始工作后,我得到异常
Score corruption: the solution's score (-20hard/-8medium/-4soft) is not the uncorruptedScore (-20hard/-8medium/-8soft)
是什么原因问题? (距离FULL_ASSERT模式仅供参考)
编辑:
东西可以连接到治:
// Boundary lessons have to be schedulead at the beginning/end in a day
rule "boundaryLesson"
when
$oddzial : Oddzial()
$boundaryLesson : Lesson(scheduled == true, containsOddzial($oddzial), base.lessonLimits.isBoundaryLesson == true, $base : base)
exists Lesson(scheduled == true, containsOddzial($oddzial), dayLessonNumber.day == $base.day, base.lessonNumberFrom < $base.lessonNumberFrom)
and exists Lesson(scheduled == true, containsOddzial($oddzial), dayLessonNumber.day == $base.day, base.lessonNumberTo > $base.lessonNumberTo)
then
scoreHolder.addHardConstraintMatch(kcontext, -1);
end
,因为有时我得到下面的错误也:
Score corruption: the workingScore (0hard/-2medium/0soft) is not the uncorruptedScore (-1hard/-2medium/0soft) after completedAction (8848-537:Tuesday-3 {[email protected] -> [email protected]}):
The corrupted scoreDirector has no ConstraintMatch(s) which are in excess.
The corrupted scoreDirector has 1 ConstraintMatch(s) which are missing:
com.praca.mgr.cp.algorytm.solver/boundaryLesson/level0/[8854-537:Tuesday-2, [email protected]]=-1
Check your score constraints.
我知道增量分数计算是如何工作的,但我看不出这条规则会出现什么问题
错误信息应该输出更多的信息,特别是如果你使用6.3.0.Final或更高版本。 –
在您的方法中是否存在任何被调用的方法(存在Lesson(... containsOddzial($ oddzial),...'也查看其他Lessons?这可以解释其他Lesson改变,但Drools没有意识到这会影响这个教训,因为它已经收到了本课的modify()事件 –
有两个独立的问题在玩,因为第一个分数腐败是关于一个软约束,第二个是关于一个硬约束 –