1

我有一个形式的规则

rule "notBar"
    when
        $foo : Foo(bar == false)
    then
        insertLogical(new IntConstraintOccurrence("notBar", ConstraintType.NEGATIVE_SOFT,
                $foo));
end

我希望看到每个 Foo 触发一次 bar 为 false 但是该规则只触发一次。令人困惑的是,如果我将其更改为$foo : Foo(bar == false)$foo : Foo()那么它会为所有 Foo 正确触发。我错过了什么?

4

1 回答 1

1

呸。我是个白痴。我的 cloneSolution 方法调用了一个没有正确复制 bar 的复制构造函数。

于 2011-07-07T10:04:14.117 回答