使用我的比较器的排序功能给我这种排序 (事实57事实58事实59事实60)。
比较器:
(deffunction MAIN::rating-sort (?f1 ?f2)
(if (< (fact-slot-value ?f1 sum-certainties) (fact-slot-value ?f2 sum-certainties)) then return TRUE
else (if (> (fact-slot-value ?f1 sum-certainties) (fact-slot-value ?f2 sum-certainties)) then return FALSE
else (if (> (fact-slot-value ?f1 total-price) (fact-slot-value ?f2 total-price)) then return TRUE
else (if (< (fact-slot-value ?f1 total-price) (fact-slot-value ?f2 total-price)) then return FALSE
else return FALSE)))))
代码:
(bind ?facts (find-all-facts ((?f alternative)) TRUE))
(bind ?facts (sort rating-sort ?facts))
(printout t ?facts crlf)
我不明白为什么不订购它们...
预期结果:(事实57事实59事实58事实60)