[
https://issues.jboss.org/browse/JBRULES-3643?page=com.atlassian.jira.plug...
]
Reinis Vicups commented on JBRULES-3643:
----------------------------------------
This issue seriously limits usage of drools rule engine for planner. Except for couple of
primitive rules, a real-life examples are failing with this error 100% of time.
Drools Planner score corruption during construction heuristics if
there are rules that check if planning variable is null
-------------------------------------------------------------------------------------------------------------------------
Key: JBRULES-3643
URL:
https://issues.jboss.org/browse/JBRULES-3643
Project: Drools
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: drools-planner
Affects Versions: 5.4.0.Final
Environment: linux 32bit JavaSE 1.6
Reporter: Reinis Vicups
Assignee: Geoffrey De Smet
A score corruption occurs in DEBUG environment Mode during construction heuristics if
there are rules that add constraints if planning variable is null e.g.
{code}
rule "no foo without bar"
when
$foo : Foo(bar == null)
then
insertLogical( new IntConstraintOccurrence("foo without bar",
ConstraintType.NEGATIVE_HARD, 1, $foo) );
end
{code}
Debugging show following sympthoms: While
org.drools.planner.core.constructionheuristic.greedyFit.decider.DefaultGreedyDecider
executed doMove() a deviation between undoScore and lastCompletedStepScore occur (around
the 108th line of code):
{code}
...
if (assertUndoMoveIsUncorrupted) {
GreedyFitSolverPhaseScope greedyFitSolverPhaseScope =
moveScope.getGreedyFitStepScope()
.getGreedyFitSolverPhaseScope();
Score undoScore = greedyFitSolverPhaseScope.calculateScore();
Score lastCompletedStepScore =
greedyFitSolverPhaseScope.getLastCompletedStepScope().getScore();
if (!undoScore.equals(lastCompletedStepScore)) { //<-- HERE scores
deviate!
...
{code}
Again, this occurs only in DEBUG environment mode!
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:
http://www.atlassian.com/software/jira