Hello,

I search a rule implementation for the following calculation:
I have n Objects of differents types (A, B, C, ...) each with a parameter certainty.

the overall certainty is calculated as follows: certaintyOverall = (certaintyA * weightA + certaintyB * weightB + ... ) / (weightA  + weightB + ...)

If it can be assumed that all Objects in the formula always exist it's quite easy:
when
  A (certaintyA: certainty)
  B (certaintyB: certainty)
  ...
then
  certaintyOverall = (certaintyA * weightA + certaintyB * weightB + ... ) / (weightA  + weightB + ...)

But if one ore more objects are missing the formula should be reduced to the certainty and weights of the existing objects. But there are too many combinations of existing/nonexisting objects. How can this be implemented in Drools?

Regards
Thomas