[drools-research] How to said a list of bus should to contain at least one bus blue and one bus red ?

Davide Sottara dsotty at gmail.com
Thu Feb 20 22:01:54 UTC 2014


** If you don't have to insert all the buses because other rules might
match them **,

I would definitely try to minimise the space search and consumption.
Every time you insert an object, a handle is created and the object is
registered
in the working memory: these are operations that would take time and
extra memory.

The "loss of opportunity" due to not sharing memory should be more than
compensated
by avoiding those extra operations (it would be interesting to know
where the break-even
point exactly is, though).

Notice that, assuming that your data is consistent, you can probably
avoid the
check city == $c in the second example.

Davide


On 02/20/2014 10:45 PM, Jonathan MERCIER wrote:
> Last user question ( to not break this thread )
> Consider number of bus in world really huge compared to number of bus inside a city.
> What is the best aproach:
> - sharing network
>
> $c : City( name == "somewhere")
> exists( Bus( colour == "blue", city == $c ) )
> exists( Bus( colour == "red", city == $c )
>
> - minimise space search
> $c : City( name == "somewhere" )
> exists( Bus( colour == "blue", city == $c ) ) from $c.buses
> exists( Bus( colour == "red", city == $c ) ) from $c.buses
>
> second aproach seem to query over less bus object but :
> - no shared network
> - use of 'from'
>
> What is your expertis on this subject?
>
> Thanks
>
> Le 20 févr. 2014 16:22, Davide Sottara <dsotty at gmail.com> a écrit :
>> You're welcome. 
>> I am currently a researcher in bio-medical in
> formatics myself, mostly on > the clinical decision support side. I'd be happy to share ideas sometimes > Davide > > On 02/20/2014 04:11 PM, Jonathan MERCIER wrote: > > Thanks Davide for your quick answer. > > > > I am sorry to post in wrong forum. I follow research and user malling > > list, so ... > > I miss to verify to which forum i send my question. > > > > We hoping to use drools 6 for our bio-informatics research. I > > understand is not like drools research :-) > > > > > > Thanks again > > > > Kind Rergards > > > > _______________________________________________ > > drools-research mailing list > > drools-research at redhat.com > > https://www.redhat.com/mailman/listinfo/drools-research > > > > _______________________________________________ > drools-research mailing list > drools-research at redhat.com > https://www.redhat.com/mailman/listinfo/drools-research




More information about the drools-research mailing list