I think Saritha Ventrapragada wrote: [Charset iso-8859-1 unsupported, filtering to ASCII...] > Hi,
> I am new to JESS and I am facing so many problems with it..These are my > queries..Hope to see quick reply for them. > 1. How can u persist Knowledge Base data(Facts). presently I m just > trying this by writing these facts and rules in the command > prompt. how can I persist them. I feel we can write these in .clp > file and run that .clp file each time when I want those facts or > rules..is this best way to do or do we have any alternate solution > for this. See the manual for descriptions of save-facts, load-facts, bsave, and bload functions. But yes, as with most programming systems, writing the code in a file is the standard procedure. > > 2. In syntax of defining Rules. how we can specify else condition. the > syntax says what to do when condition satisfies (RHS ie after =>). how can > we specify the action to be taken when rules doesn't satisfy..do I need to > use other rule with same logic with ~ condition. > Basically, yes. Alternatively, you can match only some of the preconditions on the LHS and then use the if-then-else function on the RHS (see the manual). If your logic is so simple, however, that there are clear-cut if/then/else cases for most of your rules, you might not really need to use rule-based programming in the first place. > 3. The unique command, I am not able to understand its function. I have > tried the example u have given in ur documentation, if I give two person > facts with the same security number, because I have used the unige tag, I > have to get only one name, but I am getting both the names.Please explain me > the full use of Unique and how it will be useful. The unique conditional element is just a small optimization. It's a way of saying to Jess that a given pattern can only possibly match one fact; i.e., there will never be two different facts that match that pattern at the same time. Under those conditions, Jess can avoid some unnecessary calculations. If you use unique when in fact there actually are multiple matches for a pattern, the results are undefined -- i.e., your program won't work as you expect. This is explained pretty well in the manual, in section 2.8.9. > > 4. The set-hash-index function definition is not clear, can u give me an > example and explain it. > Again, it's an optimization. Here, you really have to understand the underlying algorithm to understand what it does in detail. Small numbers will tell Jess to use less memory, possibly at the expense of performance. Larger number will favor performance and use more memory. The default is 101, which is somewhat towards the performance end of the scale. A value of 13 is good for memory conservation. Manual section 8.144 assumes that you know something about the Rete algorithm, and have read chapter 10 of the manual; but given that, it's pretty clear. > with regards > Saritha > --------------------------------------------------------- Ernest Friedman-Hill Distributed Systems Research Phone: (925) 294-2154 Sandia National Labs FAX: (925) 294-2234 Org. 8920, MS 9012 [EMAIL PROTECTED] PO Box 969 http://herzberg.ca.sandia.gov Livermore, CA 94550 -------------------------------------------------------------------- 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] --------------------------------------------------------------------
