|
||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |
See:
Description
Class Summary | |
---|---|
Bag<Type extends Item> | A Bag is a storage with a constant capacity and maintains an internal priority distribution for retrieval. |
ConceptBag | Contains Concepts. |
Distributor | A pseudo-random number generator, used in Bag. |
TaskBuffer | New tasks that contain new Term. |
TaskLinkBag | TaskLinkBag contains links to tasks. |
TermLinkBag | Contains TermLinks to relevant (compound or component) Terms. |
Storage management
A bag supports three major operations:
The "take out by priority" operation takes an item out probablistically, with the probability proportional to the priority value.
The probability distribution is generated from a deterministic table.
All classes in package nars.storage extend Bag.
In NARS, the memory consists of a bag of concepts. Each concept uniquely corresponds to a term, which uniquely corresponds to a String served as its name. It is necessary to separate a term and the corresponding concept, because a concept may be deleted due to space competition, and a term is removed only when no other term is linked to it. In the system, there may be multiple terms refer to the same concept, though the concept just refer to one of them. NARS does not follow a "one term, one concept" policy and use a hash table in memory to maps names into terms, because the system needs to remove a concept without removing the term that naming it.
Variable terms correspond to no concept, and their meaning is local to the "smallest" term that contains all occurences of the variable.
From name to term, call Term.nameToTerm(String). From name to concept, call Concept.nameToConcept(String). Both use the name as key to get the concept from the concept hashtable in memory.
The main memory also contains buffers for new tasks. One buffer contains tasks to be processed immediately (to be finished in constant time), and the other, a bag, for the tasks to be processed later.
|
||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |