Hello Bob.

> I may have misinterpreted your problem with my last response. I assumed
> that there
> can be many of the same encodings with different qualities and you need the
> best of
> these.  Correct?
No, it is a 1 to 1 relationship between the encoding and the quality rank. 
That means there are no equal encodings with different qualities. I just 
wanted to model the trivial relationship "encoding A is better than encoding
B". I'm not sure if that's really a good solution...

> (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)
> )
I tried that before, but the problem with this approach was that it is firing 
for every single device encoding. There should be more than one
device encodings possible. But the rule then behaves like this:
"Find the best/highest encoding for every seperate device-encoding
asserted". And this is always this single device-encoding, because there is no 
comparison with several encodingQualityOrders. I guess that is the case
here, correct me if i'm wrong...

Thank you for your answers. I just noticed the other solutions from Johannes 
Echterhoff and Jasen Morris, which look like solving the problem. But not as 
short as I thought it could be ;-)


Regards
Sven 

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


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