Re: JESS: Use deffacts in assert object in slot value

2008-10-31 Thread Nopphadol Chalortham
Thank you very much. My opinion, I don't dislike Ernest's way. But I like your way. I have a problem, help me please. If I have templates and facts as below: (deftemplate person (slot name)(slot age)) (deftemplate family (slot father)(slot mother)(multislot children)) (deffacts families

Re: JESS: Use deffacts in assert object in slot value

2008-10-31 Thread Nopphadol Chalortham
Sorry Sorry , my deffacts and rules are error. I edit it as below: (deftemplate person (slot name)(slot age)) (deftemplate family (slot father)(slot mother)(multislot children)) (deffacts families (person (name John)(age 36)) (person (name Mary)(age 32)) (person (name Paul)(age 55))

JESS: no initial-fact causes rule not to fire

2008-10-31 Thread Wolfgang Laun
This Jess program works correctly if executed with the initial reset, but the rule does not fire if there is not initial-fact. ;; (reset) (deftemplate Pair (slot a)(slot b)) (assert (Pair (a a)(b b))) (defrule noabeq (not (Pair (a ?x)(b ?x))) = (printout t no a=b! crlf)) (run) If the presence

Re: JESS: Defrule Pattern Matching and Shadow Facts

2008-10-31 Thread John Chrysakis
How can I combine slots (shadow facts) from different deftemplates in the same clp file. I need a rule of the form: (defrule Test-rule (Beanclass1 {slot1 == stringvalue }) AND (Beanclass2 {slot2 == closed}) = (printout t FIRE!! crlf) I am running runUntilHalt through api

Re: JESS: Use deffacts in assert object in slot value

2008-10-31 Thread Wolfgang Laun
Since the slot children is a multislot (you may want to consult Jess manual section 6.4) you cannot replace all child names at the same time. But you can do it one by one. (defrule l2rc ?c - (couple (children $? ?x $? ~: (java-objectp ?x))) ?p - (person (name ?x)) = (bind ?kids

Re: JESS: no initial-fact causes rule not to fire

2008-10-31 Thread Ernest Friedman-Hill
Hi Wolfgang, I'm surprised you would bring this up; it's very well-documented behavior duplicated exactly from CLIPS. FOr example, in section 6.5 of the Jess 7.1 manual: A not CE is evaluated only when either a fact matching it exists, or when the pattern immediately before the not

Re: JESS: Defrule Pattern Matching and Shadow Facts

2008-10-31 Thread Ernest Friedman-Hill
Nothing you've shown us is the least bit unusual, and it should work perfectly well. The problem must be in something you're *not* showing us, either in the JavaBeans somehow (although I can't imagine how) or in some other Jess code. If you can send me, personally, by email, a COMPLETE,

JESS: Re: My Code for the problem of Defrule Pattern Matching

2008-10-31 Thread Ernest Friedman-Hill
John -- After looking at your code, I see that your class JessHandler's add() method looks like this: public void add(Object obj)throws JessException { /* Remove any previous data */ engine.resetToMark(marker); /* Add user instance */ engine.add(obj); //Mporw

Re: JESS: Defrule Pattern Matching and Shadow Facts

2008-10-31 Thread Robert Kirby
JavaBeans may need correct capitalization. For variables mainDoorState and userLocation, which both follow the standard convention of beginning with lower case and internal capitalization of words, the access methods should capitalize the first letter after get or set such as getMainDoorState

Re: JESS: no initial-fact causes rule not to fire

2008-10-31 Thread Wolfgang Laun
On Fri, Oct 31, 2008 at 2:59 PM, Ernest Friedman-Hill [EMAIL PROTECTED]wrote: Hi Wolfgang, I'm surprised you would bring this up; Thanks for the sweet coating! it's very well-documented behavior duplicated exactly from CLIPS. FOr example, in section 6.5 of the Jess 7.1 manual: Suitably

Re: JESS: no initial-fact causes rule not to fire

2008-10-31 Thread Ernest Friedman-Hill
On Oct 31, 2008, at 12:11 PM, Wolfgang Laun wrote: it's very well-documented behavior duplicated exactly from CLIPS. FOr example, in section 6.5 of the Jess 7.1 manual: Suitably touché'd, I seize the (admittedly petty) opportunity to correct you: it's section 6.10 ;-) So it is... :)

Re: JESS: Use deffacts in assert object in slot value

2008-10-31 Thread Nopphadol Chalortham
thank you very much. On Fri, Oct 31, 2008 at 8:24 PM, Wolfgang Laun [EMAIL PROTECTED]wrote: Since the slot children is a multislot (you may want to consult Jess manual section 6.4) you cannot replace all child names at the same time. But you can do it one by one. (defrule l2rc ?c -