Drools Knapsack Optaplanner
<p>I try to solve the Knapsack-Problem with the Optaplanner by using drools. Did someone this before? This refers to the example by optaplanner. </p>

<p>Thanks for your help </p>

<p>I have implemented these rules as follows: </p>

<p><code><br>
rule "weigth" 
dialect "java"
when<br>
$knapsack : Knapsack($capacity : capacity)
    $weightTotal : Number(intValue > $capacity) from accumulate(
    Item(
            $weight : weight),
        sum($weight)
        )
    then
    scoreHolder.addHardConstraintMatch(kcontext, $capacity - $weightTotal.intValue())
end
</code></p>