I'm not sitting in front of Jess, so please excuse syntax errors.
I want to write rules whose conditions include inequalities, and am
wondering
about the most efficient way to do so. My first attempt looked something
like
(deftemplate foo (slot d))
(defrule r-1
(foo (d ?d&:(>= ?d 123.45)))
=>
(printout t ?d crlf))
where I have many different rules of this form with different values of
the
constant in the comparison, but performance degraded rapidly as the
number of
distinct constant values increased.
I was able to get good performance by moving the inequality to the
right-hand-side
of the rule like
(defrule r-1
(foo (d ?d))
=>
(if (>= ?d 123.45) then (printout t ?d crlf)))
but I would rather have the inequalities as part of the pattern
matching. Is there
something I'm missing here?
Incidentally, the examples above are of course toys. In my real case,
there are
other slots being matched directly, in addition to the slot with the
inequality.
Perhaps ordering of the conditional elements is relevant as well?
--------------------------------------------------------------------
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]
--------------------------------------------------------------------