<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
Probably you forgot to notify the workingMemory.update in the doMove
method:<br>
<br>
public void doMove(WorkingMemory workingMemory) {<br>
FactHandle factHandle =
workingMemory.getFactHandle(activity);<br>
activity.setAssignee(...);<br>
workingMemory.update(factHandle, activity);<br>
}<br>
<br>
Op 14-10-11 09:21, Geoffrey De Smet schreef:
<blockquote cite="mid:j78ntn$nqn$1@dough.gmane.org" type="cite">
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
A corrupted score normally indicates a problem with the Move
implementation (or sometimes the score drl).<br>
<br>
Basically this happened: for a number of moves, it did the move,
calculated the score and undo the move.<br>
One of those move was associated with a score -10hard/0soft, that
was the best one.<br>
Now, it does that move (which is now called the "step") and when
it calculates the score it's a different score 0hard/0soft.<br>
<br>
Try TRACE environment and see if it crashes sooner. Copy paste
your Move implementation here.<br>
In Planner 5.4 there will be 2 out-of-the-box Move implementations
to use, so writing Move's become optional.<br>
<br>
Op 13-10-11 16:37, Guilherme Kunigami schreef:
<blockquote
cite="mid:CAK0MeX67J-jcuUhiJ-hCrDBTFS5siswCAJimm+mke8m9UA-2Rg@mail.gmail.com"
type="cite">
<div>Hi,</div>
<div><br>
</div>
<div>I've implemented a very simple application using drools
planner consisting of a bunch of activities. My rule file is
very simple too and just counts the number of activities not
assigned. When I run Solver.solve(), I get the following error
message:</div>
<div><br>
</div>
<div><font class="Apple-style-span" face="'courier new',
monospace">Exception in thread "AWT-EventQueue-0"
java.lang.IllegalStateException: The presumedScore
(-10hard/0soft) is corrupted because it is not the realScore
(0hard/0soft).</font></div>
<div><font class="Apple-style-span" face="'courier new',
monospace"><br>
</font></div>
<div><font class="Apple-style-span" face="'courier new',
monospace">Presumed workingMemory:</font></div>
<div><font class="Apple-style-span" face="'courier new',
monospace"> Score rule (remainingActivitiesCount) has count
(1) and weight total (11).</font></div>
<div><font class="Apple-style-span" face="'courier new',
monospace">Real workingMemory:</font></div>
<div><font class="Apple-style-span" face="'courier new',
monospace"> Score rule (remainingActivitiesCount) has count
(1) and weight total (0).</font></div>
<div><font class="Apple-style-span" face="'courier new',
monospace"><br>
</font></div>
<div><font class="Apple-style-span" face="arial, helvetica,
sans-serif">I've tracked down this message and found this
piece of code
@DefaultLocalSearchSolver.solveImplementation():</font></div>
<div><font class="Apple-style-span" face="'courier new',
monospace"><br>
</font></div>
<div>
<div style="font-family: 'courier new',monospace;">
<div>// there is no need to recalculate the score, but we
still need to set it</div>
<div>localSearchSolverScope.getWorkingSolution().setScore(localSearchStepScope.getScore());</div>
<div>if (assertStepScoreIsUncorrupted) {</div>
<div>
localSearchSolverScope.assertWorkingScore(localSearchStepScope.getScore());</div>
<div>}</div>
</div>
<div style="font-family: 'courier new',monospace;"><br>
</div>
<div><font class="Apple-style-span" face="arial, helvetica,
sans-serif">It seems that the working score is never
updated along the algorithm, but the score in the working
memory changes. Thus, when we use the DEBUG environment,
assertStepScoreIsUncorrupted is turned on and the
assertion fails. </font></div>
</div>
<div><font class="Apple-style-span" face="arial, helvetica,
sans-serif"><br>
</font></div>
<div><font class="Apple-style-span" face="arial, helvetica,
sans-serif">Should the score be updated or am I using the
library incorrectly?</font></div>
<div><font class="Apple-style-span" face="arial, helvetica,
sans-serif"><br>
</font></div>
<div><font class="Apple-style-span" face="arial, helvetica,
sans-serif">Thanks,</font></div>
<pre wrap=""><fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
rules-users mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
With kind regards,
Geoffrey De Smet</pre>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
rules-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
With kind regards,
Geoffrey De Smet</pre>
</body>
</html>