[
https://issues.jboss.org/browse/JBRULES-3643?page=com.atlassian.jira.plug...
]
Reinis Vicups updated JBRULES-3643:
-----------------------------------
Workaround Description: No known workarounds, this issue causes unpredictable results.
(was: As a possible workaround remove rules that check if planning variable is null. But,
since during construction heuristics rules are checked as well, consider explicitly
checking that the planning variables are NOT null e.g. Foo(bar != null) or you will get
NPEs.)
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
Priority: Minor
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