I think =?iso-8859-4?Q?Raoul_J=E4rvis?= wrote:
[Charset iso-8859-4 unsupported, filtering to ASCII...]
> Thank you for your quick reply.
> 
> For loading the Jess constructs, is it faster to create all rules and facts during 
> runtime (using addDefrule and assertFact) or parsing a batch file where all rules 
> and facts have been written into beforehand? 
> 
> In my case, all rules and facts are generated during runtime, so entering them 
> directly into Rete object (using addDefrule and assertFact) would be quite easy. The 
> other option would be to write them into a batch file and then parsing it into Jess.
> 

You can use assertFact() to assert fact objects if you're going to
generate facts dynamically. Creating them as Java object yourself
would be a little cheaper than creating a string, then parsing it (of
course.) 

The public API of Defrule and its related classes is insufficient to
actually create Defrules from Java yourself. The only way to create a
defrule is to parse the textual representation. This has been
discussed on this list many times -- for example, see
http://www.mail-archive.com/[EMAIL PROTECTED]/msg04099.html .
Therefore, reading them from a file or composing them as a String,
then parsing them using Rete.executeCommand() or a StringReader and
Jesp.parse()) is the only option. 

---------------------------------------------------------
Ernest Friedman-Hill  
Distributed Systems Research        Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
PO Box 969, MS 9012                 [EMAIL PROTECTED]
Livermore, CA 94550         http://herzberg.ca.sandia.gov

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