在求解器配置我的本地搜索的部分看起來像: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()事件 –
有兩個獨立的問題在玩,因爲第一個分數腐敗是關於一個軟約束,第二個是關於一個硬約束 –