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

That means the encoding "RM" has a better quality than
encoding "AVI". Is this a reasonable way to model such 
an order? 

The real problem now is a rule where I try to find the 
best quality for a certain device, which is capable of 
playing i.e. only one encoding. Here's the simplified 
template for the device:

(device
        (slot encoding))

The following rule should find the best quality for the
device, that is the one with the highest qualityRank 
from the encodingQualityOrder:

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

But the rule is not working like i expected. It is firing
only when the device really has the highest encoding
defined in my encodingQualityOrder. Otherwise it is doing
nothing. 
How can i modify my rule so that it really picks out the right
encoding? What is the trick for these not-constructs ;-)

(The best solution could handle more than one device encoding.)


Hope you can help me and thanks in advance
Sven



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