Hi,
I'm new to JESS and I have a few question in the pump example (pump.clp) .
My questions might be too easy, but I'm learning JESS now.  So..... :-)

1. (deftemplate machine (slot name) (slot class) (slot OBJECT))
I guess (slot OBJECT) is related to using JavaBeans, but it is not clear
when and how I can use it because some JavaBean object (Pump) used it, but
some others (Tank) did not use it.

2. From the rais-rate-if-low rule in the pump.clp
(defrule raise-rate-if-low
    ?warning <- (warning low ?name)
    (pump (name ?name) (flow ?flow-rate) (OBJECT ?pump))
    (test (< ?flow-rate 25))
    (idle ?n)
    ?a <- (adjust-time ?t&:(< ?t (- ?n 20)))
=>
   ...)

Why do we need (OBJECT ?pump) in the second condition of LHS?
Why do we need (OBJECT ?*) only in the pump instance, not in the tank
instance?
For example, in the warn-if-low rule definition, tank instance did not have
this thing.
(defrule warn-if-low
    (tank (name ?name) (low TRUE) (intact TRUE))     // did not use OBJECT
stuff here
    ...)

3. In the same raise-rate-if-low rule definition, if idle is '0', then what
is the value of '?a'?
Since (adjust-time ?t&:(< ?t (- ?n 20))) cannot be satisfied (?n = 0 in this
case), I think '?a' should not be a valid fact id. Therefore, this rule does
not fire and '?' is not important.
Is it correct?

4. In the notify-if-ok rule definition...
(defrule notify-if-ok
    ?warning <- (warning ? ?name)
                                     --
    ....)
What is the first '?'? I guess it is a wildcard variable which can be
matched to anything, but I'm not sure.

Thanks in advance.

YJ



--------------------------------------------------------------------
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]
--------------------------------------------------------------------

Reply via email to