The Stock is the Fact - which is bound to a parameter - Drools 2.x does not allow binding of fields. In Drools 3.0 we can handle bound facts and fields which gives performance improvements.

Mark

sol myr wrote:
Thanks, very cute links.
However, I was wondering about the *object oriented* part of Drools...
  In particular, suppose you have a class encapsulating several fields:
class Stock{
    Double price;
    Double profit;
    Double risk;
}

  Now, if you do  "assertObject( myStock)",  does it go into the Rete as a "tuple" with a 
single element < myStock >  ?  Or does it become a 3-tuple  < price, profit, risk >  ?
And if by default it's the former (just < myStock > ), is there an easy way to turn it into a 3-tuple ? I believe this might improve performance in some situations... Thanks again.
ËÎÓî±ò <[EMAIL PROTECTED]> wrote:
here are three flash demostrate how the rete works£¬hope they will give u a hand to understand how the rete network work better

http://www.ers.com/Graphics/TheReteNetwork.html
http://www.ers.com/Graphics/TheReteNetwork2.html
http://www.ers.com/Graphics/TheReteNetwork3.html

-----ÓʼþÔ&shy;¼þ-----
·¢¼þÈË: sol myr [mailto:[EMAIL PROTECTED] ·¢ËÍʱ¼ä: 2006Äê2ÔÂ24ÈÕ 14:54
ÊÕ¼þÈË: [email protected]
Ö÷Ìâ: [drools-user] drools and Rete-oo
Hi,

The Drools website refers to "Rete-oo", but I'm not sure I understand it correctly ... 
especailly the "Extract Node" (mentioned in the documentation).

Suppose I have a class "Stock" which encapsulates some data
(for simplicity, I use only Objects, eg "java.lang.Double" ):

class Stock{
Double price;
Double expectedProfit;
Double risk;
}

Now, suppose I want to do "assertObject(someStock)"
But I was the stock to enter the Rete as a Tuple of length 3 (price, profit, 
risk) , rather than Tuple of length 1 (just 1 Stock encapsulating everything).
I understand the 3-tuple approach might give better performance, especially if you're 
about to play around with just one of the attributes (e.g. run the same simulation over 
and over again, each time with just a different "risk", while everything else 
remains fixed).

Is that what the Extract Node does ?
If so, how do you cause it to work - what exactly should you put in the < 
parameter > part of the rule ?

Thanks very much.


---------------------------------
Yahoo! Mail
Use Photomail to share photos without annoying attachments.


********************************************************************************************************************************
The information in this email is confidential and may be legally privileged. If 
you have received this email in error or are
not the intended recipient, please immediately notify the sender and delete 
this message from your computer. Any use, distribution,
or copying of this email other than by the intended recipient is strictly prohibited. All messages sent to and from us may be monitored to ensure compliance with internal policies and to protect our business. Emails are not secure and cannot be guaranteed to be error free as they can be intercepted, amended, lost or destroyed, or contain viruses. Anyone who communicates with us by email is taken to accept these risks.
ÊÕ·¢ÓʼþÕßÇë×¢Ò⣺
±¾Óʼþº¬±£ÃÜÐÅÏ¢£¬ÈôÎóÊÕ±¾Óʼþ£¬ÇëÎñ±ØÍ¨Öª·¢ËÍÈ˲¢Ö±½Óɾȥ£¬²»µÃʹÓᢴ«²¥»ò¸´ÖƱ¾Óʼþ¡£
½ø³öÓʼþ¾ùÊܵ½±¾¹«Ë¾ºÏ¹æ¼à¿Ø¡£Óʼþ¿ÉÄÜ·¢Éú±»½ØÁô¡¢±»Ð޸ġ¢¶ªÊ§¡¢±»ÆÆ»µ»ò°üº¬¼ÆËã»ú²¡¶¾µÈ²»°²È«Çé¿ö¡£ ********************************************************************************************************************************


                
---------------------------------
 Yahoo! Mail
 Use Photomail to share photos without annoying attachments.

Reply via email to