Well, we assumed that JESS should not be used for everything. In this case, we
will always know that the best performance would be a binary tree, so we just wrote
a query that retrieved all of the facts, and then sorted them with the java class
Treemap. I am not sure if it can be a generalization, but (I think) that whenever
you are using order, it goes against the concepts of an expert system. However, in
our case, we need to do this because users of the system are familiar with it, and
we hope to convert the ordering into reasoning.
I would be interested to hear other ideas.
Blaine
Alberto Scipionato wrote:
> (Perhaps) easy solution:
>
> (defrule p1
> ?f <- (fact (number ?n1)(text ?t))
> (and
> (not (fact (number ?n2)(text ?)))
> (test (< ?n2 ?n1))
> )
> =>
> (retract ?f)
> (printout t ?t)
> )
>
> I did not test it, but logically it should work. It retracts all your facts.
> ---------------------------------------------------------------------
> 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]
---------------------------------------------------------------------