Hi.
I'm not quite sure if i got you right, but let me suppose following solution:
At first, make a (reset) then enter this:
(deftemplate encodingQualityOrder (slot encoding) (slot qualityRank))
(deftemplate device (slot devicename) (multislot encodinglist))
(defrule find-best-quality
(device
(devicename ?devicename)
(encodinglist $?encodinglist))
(encodingQualityOrder
(encoding ?encoding&:(member$ ?encoding $?encodinglist))
(qualityRank ?qualityRank))
(not (encodingQualityOrder (encoding ?coding&:(member$ ?coding $?encodinglist)) (qualityRank ?qo&:(> ?qo ?qualityRank))))
=>
(printout t "Best encoding for device " ?devicename " is: " ?encoding crlf)
)
;;-------------------------------------------------------
(assert (device (devicename d1) (encodinglist (create$ AVI RM MPG)))) (assert (device (devicename d2) (encodinglist (create$ RM AVI)))) (assert (device (devicename d3) (encodinglist (create$ RM)))) (assert (encodingQualityOrder (encoding AVI) (qualityRank 1))) (assert (encodingQualityOrder (encoding RM) (qualityRank 2))) (assert (encodingQualityOrder (encoding MPG) (qualityRank 3)))
Finally (run) the engine.
Output is: Best encoding for device d3 is: RM Best encoding for device d2 is: RM Best encoding for device d1 is: MPG
I hope this helps a bit though again i am not sure if this exactly is what you need and as I am still a Jess-Newbie I guess that this problem could be solved in a better way. :-)
Greetings, Johannes Echterhoff
-------------------------------------------------------------------- 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] --------------------------------------------------------------------