From: crabbe@usna.edu   
      
   Mike writes:   
   >   
   > I am not intentionally vague, but am searching for an   
   > answer to a question I can barely define. Seems like in LISP   
   > you have ists that have attributes and these attributes act   
   > like a hash in that you can query, set, and remove them. I know   
   > that I can implement the same things easily in Java using a either   
   > a Hashtable or a HashMap, but is that the right way? I'm playing   
   > with the idea of using genetic programming to evolve the lists   
   > for the purpose of generating some sort of frame-based knowledge   
   > to play dungeons and dragons.   
   >   
      
   Ah, I see. So the things you are actually evolving are the slots   
   themselves in the frames? Thus you _would_ need a level of   
   flexibility in how you represent the frame. Your analogy to Lisp is   
   apt. In either association lists or property lists, Lisp maintains a   
   list of named pairs. They are actually implemented as linked lists in   
   every version I know of. Thus you could do the exact same thing in   
   java, using a LinkedList or Vector. Of course _any_ implementation of   
   Set would be fine, and as you have already noticed Hashtable is a good   
   way to do it if the number of slots is likely to be large.   
      
   So the short answer is, "Yes, the right way to do it is just the way   
   you were thinking about."   
      
   good luck!   
      
   -ric   
      
   [ comp.ai is moderated. To submit, just post and be patient, or if ]   
   [ that fails mail your article to , and ]   
   [ ask your news administrator to fix the problems with your system. ]   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|