【发布时间】:2016-03-01 10:42:02
【问题描述】:
我尝试通过使用流口水来使用 Optaplanner 解决背包问题。以前有人这样吗?这是指 optaplanner 的示例。
感谢您的帮助
我已将这些规则执行如下:
rule "weigth"
dialect "java"
when
$knapsack : Knapsack($capacity : capacity)
$weightTotal : Number(intValue > $capacity) from accumulate(
Item(
$weight : weight),
sum($weight)
)
then
scoreHolder.addHardConstraintMatch(kcontext, $capacity - $weightTotal.intValue())
end
【问题讨论】:
-
我们应该回答“是”还是“否”?
标签: drools knapsack-problem optaplanner