I'm trying to understand how Jess builds its rule base and when it creates
java objects. I have the following piece of code:

(defrule isInList
        ?response <-(Response (s1 ?x))
        (not (test ((new SumObject "c:/dev/data/data.txt") InList ?x))
        )
     => (printout t "It does exist")
        )

SumObject is a java object that reads a list of 50 values from the file
data.txt.  It calls the InList method to check if the slot value in s1 is in
the list. I know there is a member list function, but this is a linear
search and I am looking for better performance.

Q. When is the object created and the text file loaded? When the rule is
built or when it fires?

Q. Is there a way to instantiate SumObject outside the rule and reference it
in the test statement?

Thanks,

Brett.

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