Hi Lauren,
I'm sorry, but your first match-by-pump-name rule works for me both
under Jess 5.0a6 and Jess 4.4. If you're using an older version,
perhaps it's an old bug that's since been fixed.
I think Lauren Blau Halverson x1285 wrote:
>
> From the documentation:
>
> public class Pump
> {
> public String getName() { ... }
> public int getFlow() { ... }
> public void setFlow(int f) { ... }
> }
>
> then:
> (defrule decrease-pump-flow-if-high-1
> "If a pump's flow rate is over 20, decrease it by 5 units."
> (pump (flow ?f&:(> ?f 20)) (OBJECT ?pump))
> =>
> (set ?pump flow (- ?f 5)))
>
> If we wanted to match on the name slot of Pumpinstead of flow:
> (defrule match-by-pump-name
> "Try to find a specific pump"
> (pump (name "MAIN") (OBJECT ?pump))
> =>
> (printout t "the main pump " ?pump crlf))
>
> it does not match. I have to write the rule explicity calling equals
> on name as such:
> (defrule match-by-pump-name
> "Try to find a specific pump"
> (pump (name ?name&:(call ?name equals "MAIN")) (OBJECT ?pump))
> =>
> (printout t "the main pump " ?pump crlf))
>
> This gets very messy when I have a slot match such as
> (name ~"NONAME"&~"GENERICNAME"&~"FOONAME")
>
> Is there same way we can get JESS to match java.lang.Strings against
> string primitives in rules without having to explicitly call the equals
> method?
>
> Thanks,
> Lauren
> ---------------------------------------------------------------------
> 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]
> ---------------------------------------------------------------------
>
>
---------------------------------------------------------
Ernest Friedman-Hill
Distributed Systems Research Phone: (925) 294-2154
Sandia National Labs FAX: (925) 294-2234
Org. 8920, MS 9214 [EMAIL PROTECTED]
PO Box 969 http://herzberg.ca.sandia.gov
Livermore, CA 94550
---------------------------------------------------------------------
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]
---------------------------------------------------------------------