If you have a series of facts
  (fact (name a) (value 123))
  (fact (name b) (value 456))

and write a query like

  (defquery find-value
        (declare (variables ?name))
        (fact (name ?name)))

Then Jess will make an index on the "name" slot, so that looking up
these facts by name will be fast (using a hashtable, so basically
constant time.)

Does this answer your question?

I think Raji Sridar wrote:
> Hi,
> 
> I am a new user of JESS and would like your inputs on implementing enumeration
> and lookup tables in JESS.
> The requirement is for a straight forward indexing mechanism to store and
> retrieve static data as:
> 1. Enumeration - To convert a codified value to its description
> 2. Table - To retrieve a set of attributes based on a key value
> I can have these as facts and use them directly in the rules or implement them
> through a java extension to JESS.
> If RETE is optimized for this, I would prefer to use them as facts.
> If not, based on your experience, I would like to know, which way is better for
> small number of facts ( say,  < 20 ) and a larger number (say, 500) and for
> small sizes ( say 80 byte enumeration ) and larger sizes ( say, the total size
> of all attributes in the table is 1024 bytes ).
> Your input will help me decide on the better technique.
> 
> Thanks
> Raji
> 
> --------------------------------------------------------------------
> 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]
> --------------------------------------------------------------------
> 



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

Reply via email to