Re: JESS: Finding fact the max/min slot value

2006-02-01 Thread Roger Studner
(defrule biggest-number (number ?number) (not (number ?num2 ?num)) = (printout t biggest number: ) (printout t ?number crlf) ) I think? On 2/1/06, erich.oliphant [EMAIL PROTECTED] wrote: Hi, I am trying to figure out the best way to have a rule fire only for a fact whose slot value is

Re: JESS: Goal in each action

2006-01-26 Thread Roger Studner
To jump in.. I suggest that everyone buys that book if they are going to use Jess. It *does* repeat some material available in the online docs and other places, but also includes quite a good bit more code and examples than I found anywhere else. Roger Studner On 1/26/06, Daniela CLARO [EMAIL

JESS: Accumulate Function - LHS

2005-12-02 Thread Roger Studner
Are there situations or usages of (accumulate) that would actually prevent a rule from firing? ?c - (accumulate (bind ?count 0) ;; initializer (bind ?count (+ ?count 1)) ;; action ?count (pattern to look for.. single fact, not even complex) ) If there are *no matches* to this pattern,

Re: JESS: creating an audit trail

2005-12-01 Thread Roger Studner
various 'inferred' pieces of information. Thanks both of you for your help Roger S On 12/1/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I think Roger Studner wrote: Has anyone has success in industry with a pattern or methodology for tracking which rules fires and for what facts through

Re: JESS: Size of an activation record

2005-11-22 Thread Roger Studner
And even an addendum to this question: Is there (I read something 'akin' to this in the mailing archive) a big performance hit as well? I like to use beans/shadow facts for a variety of reasons, but have always been under the impression that when i'm going to assert a 'huge' number of a

Re: JESS: Object to built-in type

2005-11-18 Thread Roger Studner
You can use instance of, do a cast, and then contruct the right Value (or LongValue in the case of a Long/long) and then set a slot with that value. Source code examples help, so here ya go: public static void insertFactFromTemplateNameAndSlotValueMap(Rete engine, Deftemplate t, String

Re: JESS: Accessing the Java object behind a shadow fact in a userfunction

2005-11-14 Thread Roger Studner
Get from the slot OBJECT. something like (bind ?obj (fact-slot-value ?fact OBJECT)) I could be wrong :) On 11/14/05, erich.oliphant [EMAIL PROTECTED] wrote: Hi, I am implementing a convienenice userfunction that takes a bound shadow fact as an argument and returns some of it's deeply

JESS: defquery

2005-11-14 Thread Roger Studner
I am trying to do some 'counting'. I make a defquery to return a fact. I get back the Iterator.. i retreive the token.. I get the fact. When I try to modify the fact.. I get an error that 'the fact is not in working memory'. I mean, I even asserted the fact before using it. I just don't want to

Re: JESS: String to Symbol

2005-11-08 Thread Roger Studner
Fun one with Accumulate: (deftemplate encounter (slot date) (slot code)) (reset) (assert (encounter (date 2005-10-31) (code 440))) (assert (encounter (date 2005-10-31) (code 440))) (assert (encounter (date 2005-10-31) (code 777.1))) (assert (encounter (date 2005-10-31) (code 468.1))) (assert

Re: JESS: String to Symbol

2005-11-08 Thread Roger Studner
prints 0 every time. Thanks again and again, Roger S. On 11/8/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I think Roger Studner wrote: (defrule count-icd9-codes ?c - (accumulate (bind ?count 0) ;; initializer (bind ?count (+ ?count 1)) ;; action ?count ;; result (encounter (code ?c