0
这种计算每个传感器的平均温度:Drools的嵌套厚积薄发
rule "Average"
when
$s : Sensor()
accumulate(Reading(sensor == $s, $temp : temperature);
$avg : average($temp)
)
then
// print average of EACH sensor
end
我当时想什么传感器具有最大“平均温度”,我想这样的事情,但它显然是不正确的:
rule "MaxAvg"
when
accumulate ($s : Sensor()
accumulate(Reading(sensor == $s, $temp : temperature);
$avg : average($temp)
);
&max : max($avg)
)
then
// print sensor with max "average temperature"
end
请大家帮忙。