I think David wrote:
> Hi guys,
>
> Anyone knows what is an async error as follows?
>
> Async Error: Jess reported an error in routine Funcall.execute
Jess prints out an AsyncError message if there's an error while
responding to a PropertyChangeEvent. Jess can't throw a JessException,
because the signature of the propertyChanged() method wouldn't allow
it. I'm considering having Jess 7 instead throw an unchecked exception
in this case -- i.e., a new JessRuntimeException type. Any opinions?
> What I did was I changed the ?*set-point* parameter to a bean.
> That is, I want to dynamically change the set point of the simulation
> from the java infrastructure (I thought it would be more realistic that
> way).
You can easily change the value of the defglobal from Java code.
> I made SetPoint as a defclass and subsequently definstance instead.
>
> The error seems to come from
>
> (deffunction too-cold (?t)
> (SetPoint (setpoint ?value))
> (return (< ?t (- ?value 2))))
Any lists that appear directly in the body of a deffunction are
interpreted as function calls. You've written something that looks
like a pattern here -- like you're trying to match a SetPoint fact and
react to it. Deffunctions don't work that way. To get ahold of an
individual fact in a deffunction, you'd have to use a defquery --
definitely overkill for this situation.
One easy fix: just make the ?*set-point* global contain a reference to
the SetPoint bean. Make too-cold look like
(deffunction too-cold (?t)
(return (< ?t (- (?*set-point* getSetpoint) 2))))
---------------------------------------------------------
Ernest Friedman-Hill
Science and Engineering PSEs Phone: (925) 294-2154
Sandia National Labs FAX: (925) 294-2234
PO Box 969, MS 9012 [EMAIL PROTECTED]
Livermore, CA 94550 http://herzberg.ca.sandia.gov
--------------------------------------------------------------------
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]
--------------------------------------------------------------------