Makes perfect sense and I got it working.  Thanks.

Now I'm trying to bind a variable to something in the data assertion.
I'm trying to bind ?estSalesImpact to the quotient of (say) the
cw-str-cnt-small slot in "data" and the integer 2:

   (deftemplate data "the data"
      (slot cw-str-cnt-small)
        ...
   )


     (bind ?estSalesImpact (/ (data (cw-str-cnt-small)) 2))

This would work in CLOS I think but I can't get the Jess syntax right....

TIA.


On Thu, Jan 22, 2004 at 09:54:34AM -0800, [EMAIL PROTECTED] wrote:
> I think Udo Dieckmann wrote:
> > Thanks again, and you read my mind, because my next question was
> > going to be how to encapsulate the info into something called "data".
> > I am now using unordered facts with named slots.
> > 
> > Now, I've got to move on to something a little more complicated.
> > 
> 
> The best thing to do with this would be to code it as a deffunction,
> match the four or five arguments on the rule's LHS, and pass them in:
> 
> (deffunction areTenPercentAffected(?a ?b ?c ?d) ...)
> 
> (defrule do-something-if-ten-percent-affected
>   (data (value1 ?v1) (value2 ?v2))
>   (otherdata (value1 ?v3) (value2 ?v4))
>   (test (areTenPercentAffected ?v1 ?v2 ?v3 ?v4))
>   =>
>   (whatever))
> 
> Make sense? This is pretty much what you do in Java, too.
> 
> 
> ---------------------------------------------------------
> Ernest Friedman-Hill  
> Science and Engineering PSEs        Phone: (925) 294-2154
> Sandia National Labs                FAX:   (925) 294-2234
> PO Box 969, MS 9012                 [EMAIL PROTECTED]
> Livermore, CA 94550         http://herzberg.ca.sandia.gov
> 
> --------------------------------------------------------------------
> To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
> in the BODY of a message to [EMAIL PROTECTED], NOT to the list
> (use your own address!) List problems? Notify [EMAIL PROTECTED]
> --------------------------------------------------------------------

--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------

Reply via email to