If you only want to match the "dirty" fact that has the same values as
a given "position" fact, then you have to use the same
variables to represent those values 

(defrule have-dirty
    (position (x-position ?xp) (y-position ?yp)
    (dirty (x-pos ?xp) (y-pos ?yp)
    =>
    ...

Please give the manual a close reading, because there are many small
examples that teach this sort of thing indirectly. For example, see
the first example in section 2.8.6 of the Jess 6.0b1 manual, which is
a perfect example of what you're doing here.



I think Anderson de Rezende Rocha wrote:
> Hi, I need some help!
> 
> I defined two templates
> (deftemplate position(slot x-position)(slot y-position))
> and
> (deftemplate dirty(slot x-pos)(slot y-pos))
> 
> Now, I need compare x-pos and y-pos with x-position and y-position
> to verify DIRTY in one specific region! Then I tried
> 
> (defrule have-dirty
>    (position(x-position ?xp)(y-position ?yp)
>    (dirty(x-pos ?a)(y-pos ?b)
>    =>
>    ; something like "HAVE dirty here"
> )
> 
> But this fires to all cases(all dirties in knowledg-base)! And I need
> for one case for each "position"!
> 
> How to solve this problem? And how to compare the templates "position" and
> "dirty"??
> 
> 
> 
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> 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]
> ---------------------------------------------------------------------
> 



---------------------------------------------------------
Ernest Friedman-Hill  
Distributed Systems Research        Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
Org. 8920, MS 9012                  [EMAIL PROTECTED]
PO Box 969                  http://herzberg.ca.sandia.gov
Livermore, CA 94550

---------------------------------------------------------------------
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