Geoffrey,

We briefly discussed about having specialized nodes for operations like count(), average(), max(), etc, but if I remember correctly, we didn't came to a conclusion. The new version (in trunk) does have "accumulate" that provides the functionality, but being a general purpose conditional element, it can't provide optimizations like the one you described, that would not be difficult to implement in a specialized node.

So, even incurring the risk of making the language fat, I would agree in adding that functionallity. Lets hear the others.

  []s
  Edson


Geoffrey De Smet wrote:

I am logically asserting a bunch of Routeobjects:
  new Route(Object cause, int distance)
and I need the sum of all the distances of all the Routes.
so after the rules are fired I can fetch all Routes and sum the distances.

Problem is... in my use case I am constantly (like +1k times a second) changing one little fact, firing all rules and decide which fact to change next based on the sum of the distances. Talk about stressing drools's forward-chaining :)

So by constantly recalculating the sum of those distances starting from 0, it loses a huge amount of scalability.
It would be a lot better if a sum would be calculated like this:
nextSum = lastSum - distanceFromAnyRetractedRoutes + distanceFromAnyAssertedRoutes; This would mean that the rules engine would need to support some sort of sum query's.

What do you think? Is this feasible and in the scope of drools enough to create a long term feature request in jira for this?

Thanks.



--
 ---
 Edson Tirelli
 Software Engineer - JBoss Rules Core Developer
 Office: +55 11 3124-6000
 Mobile: +55 11 9218-4151
 JBoss, a division of Red Hat @ www.jboss.com

 IT executives: Red Hat still #1 for value
http://www.redhat.com/promo/vendor/

---------------------------------------------------------------------
To unsubscribe from this list please visit:

   http://xircles.codehaus.org/manage_email

Reply via email to