[rules-users] priority based on object properties

Simon Chen simonchennj at gmail.com
Mon Jul 18 16:44:37 EDT 2011


But here comes another problem...

I used "salience (-$path.cost)" in the rule for propagating current
shortest paths on a node to neighboring nodes. At first, it worked
great, as in the log I see routes with smaller costs being propagated.
But later on, I see the progress slowing down quite a bit. My guess is
that the sorting based on (-$path.cost) takes longer and longer as the
number of objects increases - now my java process takes about 8GB of
memory.

One idea is to use some sort of bucketing, such that I duplicate the
propagation rule from one to, for example, five, and each of the five
rules would be applied on a subset of the paths with a particular
range of costs. This might work, but has the downside of needing the
input of some data statistics (for proper bucketing, for example.)

Any ideas on this?

Thanks.
-Simon

On Mon, Jul 18, 2011 at 4:07 PM, Simon Chen <simonchennj at gmail.com> wrote:
> I think it works.
>
> Actually, just found it in the current Drools expert documentation
> too. Shame on me...
>
> Thanks.
> -Simon
>
> 2011/7/18 Michael Anstis <michael.anstis at gmail.com>:
>> I believe this
>> http://blog.athico.com/2007/05/dynamic-salience-expressions.html still
>> works.
>>
>> On 18 July 2011 20:44, Simon Chen <simonchennj at gmail.com> wrote:
>>>
>>> Hi all,
>>>
>>> I am curious if we can inform Drools' execution based on properties
>>> within objects.
>>>
>>> In particular, the salience value is defined for each rule, in the
>>> sense that rule A has priority over rule B to execute. I am wondering
>>> if we can define some kinda of salience metric, such that object X has
>>> higher priority than object Y to be executed in the same rule.
>>>
>>> To give an example, I am (still) playing with implementing shortest
>>> path using a few rules. I have a rule for selecting a shortest path on
>>> a node (among all the paths received from its neighbors) to a source
>>> node, and another rule for propagating the shortest path on a node to
>>> neighboring nodes. When I have many nodes in my graph, I found that
>>> the paths propagated (via the second rule) are not always the
>>> shortest, while Dijkstra's algorithm always "propagate" from the node
>>> with the shortest distance to the source. The effect is that my rules
>>> are wasting most of the time propagating paths that would be dropped
>>> in the end anyway...
>>>
>>> Any ideas?
>>>
>>> Thanks.
>>> -Simon
>>> _______________________________________________
>>> rules-users mailing list
>>> rules-users at lists.jboss.org
>>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
>>
>> _______________________________________________
>> rules-users mailing list
>> rules-users at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
>>
>



More information about the rules-users mailing list