<br><br><div class="gmail_quote">On 15 May 2012 00:30, Christopher Dolan <span dir="ltr">&lt;<a href="mailto:christopher.dolan@avid.com" target="_blank">christopher.dolan@avid.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I may be way off track, but I saw score corruption like yours in two cases:<br>
<br>
1) broken .equals()/.hashCode() method.<br>
I had a couple of model classes that accidentally looked at mutable data in their .equals() and .hashCode() methods. When these were applied as the cause of the constraint, the revert action then failed to find the constraint because the removed instance wasn&#39;t .equals() to the inserted instance. I solved this by reverting to Object.equals() and Object.hashCode().<br>
</blockquote><div><br></div><div>I don&#39;t think that problem with .equals() or .hashCode() methods, because I&#39;m using &lt;b&gt;apache EqualsBuilder&lt;/b&gt; and &lt;b&gt;apache HashCodeBuilder&lt;/b&gt;, this is 1st, and 2nd my each planning entity has al least unique &lt;b&gt;id&lt;/b&gt;.</div>








<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
2) broken variable assignment in aggregate predicates (<a href="https://issues.jboss.org/browse/JBRULES-3482" target="_blank">https://issues.jboss.org/browse/JBRULES-3482</a>)<br>
This is fixed in 5.4.0.Final.<br>
If your rules use collect() or accumulate() with a complicated first argument to either, then Drools becomes confused about which variable to assign the value to. In most cases, this results in a ClassCastException. But in some cases where the facts happened to be the same class, you ended up with the wrong fact assigned as the cause of the constraint.</blockquote>
<div>yes, I&#39;m using accumulate(), but not in this rule(wxGroupChildClassesInSamePeriodWithDiffLessons) and I&#39;ve switched to 5.4.Final version, same problem....</div>







<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">
-----Original Message-----<br>
From: <a href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a> [mailto:<a href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a>] On Behalf Of Nurlan<br>

Sent: Friday, May 11, 2012 5:06 PM<br>
To: <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
Subject: [rules-users] Score curruption exception in drools-planner-5.4.0.CR1<br>
<br>
Hi guys!<br>
I have some exception and I don&#39;t know why?<br>
My rule *someRuleId* has weight *1*<br>
2012-05-12 03:47:08,224 [main] DEBUG     Step index (570), time spend<br>
(115566), score (0hard/0soft), initialized planning entity<br>
(SomePlanningEntity [id=21, …]).<br>
2012-05-12 03:47:08,465 [main] DEBUG     Step index (571), time spend<br>
(115807), score (0hard/0soft), initialized planning entity<br>
(SomePlanningEntity [id=20, …]).<br>
java.lang.IllegalStateException: Score corruption: the workingScore<br>
(-4hard/0soft) is not the uncorruptedScore (0hard/0soft):<br>
  The workingMemory has 4 ConstraintOccurrence(s) in excess:<br>
    someRuleId/NEGATIVE_HARD:[SomePlanningEntity [id=2482309, …],<br>
SomePlanningEntity [id=54, …]]=1<br>
    someRuleId/NEGATIVE_HARD:[SomePlanningEntity [id=2482309, …],<br>
SomePlanningEntity [id=57, …]]=1<br>
    someRuleId/NEGATIVE_HARD:[SomePlanningEntity [id=57, …],<br>
SomePlanningEntity [id=2482309, …]]=1<br>
    someRuleId/NEGATIVE_HARD:[SomePlanningEntity [id=54, …],<br>
SomePlanningEntity [id=2482309, …]]=1<br>
  Check the score rules who created those ConstraintOccurrences. Verify that<br>
each ConstraintOccurrence&#39;s causes and weight is correct.<br>
        at<br>
org.drools.planner.core.score.director.AbstractScoreDirector.assertWorkingScore(AbstractScoreDirector.java:101)<br>
        at<br>
org.drools.planner.core.constructionheuristic.greedyFit.decider.DefaultGreedyDecider.doMove(DefaultGreedyDecider.java:111)<br>
        at<br>
org.drools.planner.core.constructionheuristic.greedyFit.decider.DefaultGreedyDecider.decideNextStep(DefaultGreedyDecider.java:78)<br>
        at<br>
org.drools.planner.core.constructionheuristic.greedyFit.DefaultGreedyFitSolverPhase.solve(DefaultGreedyFitSolverPhase.java:63)<br>
        at<br>
org.drools.planner.core.solver.DefaultSolver.runSolverPhases(DefaultSolver.java:183)<br>
        at<br>
org.drools.planner.core.solver.DefaultSolver.solve(DefaultSolver.java:151)<br>
        …<br>
        …<br>
<br>
<br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/Score-curruption-exception-in-drools-planner-5-4-0-CR1-tp3981199.html" target="_blank">http://drools.46999.n3.nabble.com/Score-curruption-exception-in-drools-planner-5-4-0-CR1-tp3981199.html</a><br>

Sent from the Drools: User forum mailing list archive at Nabble.com.<br>
<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div style="font-size:100%;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:3px;padding-right:3px;padding-bottom:3px;padding-left:3px;background-color:rgb(255,255,255);color:rgb(0,0,0);font-family:&#39;Times New Roman&#39;">
Regards, </div><div style="font-size:100%;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:3px;padding-right:3px;padding-bottom:3px;padding-left:3px;background-color:rgb(255,255,255);color:rgb(0,0,0);font-family:&#39;Times New Roman&#39;">
Nurlan Rakhimzhanov</div><br>