[rules-users] How to deal with doubles in Optaplanner drools rules

ns nick.snels at ocmwturnhout.be
Thu Nov 21 05:54:32 EST 2013


Hi,

I am having trouble dealing with doubles in the Optaplanner drools rule drl
file. See error message below.

Exception in thread "main" java.lang.IllegalStateException: There are errors
in the scoreDrl's:
Error Messages:
Message [id=1, level=ERROR,
path=optaplanner-kie-namespace//be/ocmwturnhout/permanenties/solver/permanentiesScoreRules.drl,
line=96, column=0
   text=Rule Compilation error The method
addSoftConstraintMatch(RuleContext, int) in the type HardSoftScoreHolder is
not applicable for the arguments (RuleContext, double)]

I have the following then rule part:

scoreHolder.addSoftConstraintMatch(kcontext, -(10 *
Math.abs(($employee.getArbeidsbreuk() * $assignmentTotal.intValue()) -
$assignmentTotalEmployee.intValue())) * (10 *
Math.abs(($employee.getArbeidsbreuk().intValue() *
$assignmentTotal.intValue()) - $assignmentTotalEmployee.intValue())) );

$employee.getArbeidsbreuk() is a double.

Aren't doubles allowed or can I convert it? Thanks.

Kind regards,

Ncik



--
View this message in context: http://drools.46999.n3.nabble.com/How-to-deal-with-doubles-in-Optaplanner-drools-rules-tp4026865.html
Sent from the Drools: User forum mailing list archive at Nabble.com.


More information about the rules-users mailing list