JESS: on creating test harnesses & dev automation with Jess

2004-02-17 Thread Jason Morris
Hi All, I have been experimenting with modifying the Tax Advisor application in "Jess In Action". On pg. 169 Ernest makes the comment "...You should be thinking about putting together a complete test harness now..". I have been structuring my Jess scripting code in modules, placing them in separa

Re: JESS: on creating test harnesses & dev automation with Jess

2004-02-17 Thread ejfried
I think Jason Morris wrote: > I have been structuring my Jess scripting code in modules, placing them in > separate files, and calling them from a master *.clp file like so.. > > ;;=== pat.clp > ;; Application batch script > (clear) > (watch all) > (batch pat_main.clp) > (batch p

Re: JESS: Newbie Question: Poker: deck of cards

2004-02-17 Thread ejfried
I think Peder Jakobsen wrote: > > Now I'm stuck trying to figure out how to deal out two random cards. I'm > not sure if I'm headed in the right direction. Any > help would be greatly appreciated. Well, you have to define what it means to deal out the cards. Do you want to modify the facts tha

Re: JESS: newbie question about integration

2004-02-17 Thread ejfried
I think DE LA CRUZ German GESI wrote: > > Well, in my world I've a lot of domain object (Like Fowler's ideas) and on > the other side there are business rules. Then, my idea is to build all the > static/architectural view in Java and all the business/dynamic view in Jess. > For persistence I use

Re: JESS: java/jess serialization question

2004-02-17 Thread ejfried
Well, I don't know what to tell you. The whole problem description seems to start from a premise that I don't understandq -- that listFacts() will return more facts than have been asserted. This is not true -- it will only return exactly the facts in working memory, not any of the internal "copies"

JESS: Using JESS for a 2 stage multi parallel machines Job Shop Scheduling Problem.

2004-02-17 Thread David
Hi guys,   I would like to know if anyone here have experience or knows if it is feasible to use JESS for scheduling problems – Job Shop scheduling problems. I am working on a real life problem of a 2-stage multi-parallel machines job shop scheduling. Preliminary analysis of the problems

JESS: Answer to one question should eliminate others.

2004-02-17 Thread Peder Jakobsen
Hi, I'm going through the first Tax Advisor example in the Jess in Action. The first question that comes to mind is this: Many systems I can think of would not ask the same list of questions again and again, but rather change the list of remaining questions depending on the answer to former quest

RE: JESS: Answer to one question should eliminate others.

2004-02-17 Thread James Owen
Try a goal-driven approach. Group the rules into what you would ask if you had this goal or that goal or another goal. In your short example the goals might be Determine Food Types (Tofu, meat, fish, veggies only) Determine Tofu Types (meat simulations, non-meat simulations) Determine Meat Types

Re: JESS: Answer to one question should eliminate others.

2004-02-17 Thread ejfried
I think Peder Jakobsen wrote: > > What is the basic strategy for aksing the right questions at the right time > while gathering information from the user? Note that the Tax Advisor already does this. Look, for example, at the rule request-interest-income on page 175: (defrule request-interest-

JESS: Passing nil to user-defined functions

2004-02-17 Thread Mitch Chritensen
I have a user-defined function that processes a list of facts. How can I recognize when one of the passed parameters is nil? For example: (defrule find-names (name (first ?first)(middle-initial ?mi)(last ?last)) => (load-name ?first ?mi ?last)) Where 'load-name' is a user-defined function imple

RE: JESS: Passing nil to user-defined functions

2004-02-17 Thread Mitch Chritensen
Actually, my example is not exactly accurate. The assertion is actually setting the slot values to facts, rather than atoms (Strings). The assertion is actually more like this: (defrule find-name-facts ?firstname <- (word (type FIRSTNAME)) ?middleInitial <- (word (type INITIAL)) ?lastname <- (wo

JESS: No Printout ??!!

2004-02-17 Thread Peder Jakobsen
Can anyone tell me why there is no printout even when a rule is activated? Jess>(watch all) Jess> (assert (Bob)) ==> f-0 (MAIN::Bob) Jess> (defrule a-bob "is there a bob?" (Bob) => (printout t "bob exists!")) ==> Activation: MAIN::a-bob : f-0 MAIN::a-bob: +1+1+1+t TRUE Jess> I'm sure it's a s

Re: JESS: No Printout ??!!

2004-02-17 Thread Dona Mommsen
Hi Peder, the execution of rules is a 2-stage process: Your rule is now only activated (i.e. ready to fire). However, it will not fire (i.e. execute the printout in the RHS of our rule) until the rule engine actually runs. Just add (run) to start the execution. greetings from another newbie D

RE: JESS: Passing nil to user-defined functions

2004-02-17 Thread Mitch Chritensen
Ok...I found it. if(vv.get(2).type() == RU.FACT){...} Sorry for the bandwidth consumption. -Mitch -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Mitch Chritensen Sent: Tuesday, February 17, 2004 2:05 PM To: [EMAIL PROTECTED] Subject: RE: JESS: Passing nil

Re: JESS: Passing nil to user-defined functions

2004-02-17 Thread ejfried
I think Mitch Chritensen wrote: > > If I do vv.get(2).factValue(c) Jess says 'Not a fact: "nil" (type = ATOM).' > If I then try to do vv.get(2).atomValue(c), Jess says 'Message: Not a > string: "" (type = FACT).' Value arg2 = vv.get(2).resolveValue(context); if (arg2.equals(Funcall.NIL) { ... }

JESS: on creating test harnesses & dev automation with Jess

2004-02-17 Thread Jason Morris
Hi All, One of my Outlook rules my have zapped someone's reply, so please forgive me for asking my question again - albeit a shorter version this time: On pg. 169 of JIA, Ernest makes the comment "...You should be thinking about putting together a complete test harness now..", so I have been stru