Check your 'not' pattern. It does not restrict the matching to the 
same encoding as the one matched in the previous patters. so it requires
that the
ranking be better than ANY encoding. Change as follows:


(defrule find-best-quality
        (device
                (encoding ?encoding))
        (encodingQualityOrder
                (encoding ?encoding)
                (qualityRank ?qualityRank))
        (not (encodingQualityOrder 
                   (encoding ?encoding)
               (qualityRank ?qo&:(> ?qo ?qualityRank))))
        
        =>
        
        (printout t "Encoding: " ?encoding crlf)
)


Bob Orchard
National Research Council Canada      Conseil national de recherches Canada
Institute for Information Technology  Institut de technologie de
l'information
1200 Montreal Road, Building M-50     M50, 1200 chemin Montrial
Ottawa, ON, Canada K1A 0R6            Ottawa (Ontario) Canada K1A 0R6
(613) 993-8557 
(613) 952-0215 Fax / tilicopieur
[EMAIL PROTECTED] 
Government of Canada | Gouvernement du Canada



-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Behalf Of [EMAIL PROTECTED]
Sent: Tuesday, August 24, 2004 11:36 AM
To: [EMAIL PROTECTED]
Subject: JESS: Defining an order


Hello, 

i'm new to jess. I try to define an order with the following template:

(deftemplate encodingQualityOrder
        (slot encoding)
        (slot qualityRank))

Example Facts look like this:

(encodingQualityOrder
        (encoding AVI)
        (qualityRank 1))
                
(encodingQualityOrder
        (encoding RM)
        (qualityRank 2))


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