|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.AbstractSequentialList<E>
java.util.LinkedList<T>
clarion.system.AbstractIntermediateModule<AbstractChunk>
clarion.system.WorkingMemory
public class WorkingMemory
This class implements the working memory within CLARION. It extends the AbstractIntermediateModule class. Conceptually, this system exists between the ACS and the NACS. However, implementationally it is logical to specify it as an intermediate module since it is used by several subsystems. Therefore, in the CLARION Library, the working memory is contained within the CLARION class.
Usage:
This class contains methods for adding and removing items from the working memory. The working memory is used primarily by the ACS, but it can be used to facilitate interactions between the ACS and the NACS.
Working memory can contain specialized chunks that only exist within working memory. Example of such a chunk include the "carry over" digit in addition or the "borrow" digit in subtraction. Unlike a goal, the dimensions of a working memory chunk can have the same IDs the dimensions in the sensory information space. This equates to "remembering" or "visualizing" something within the sensory information space and recalling it for later use.
Currently this is simply a container for the working memory slots. Any manipulations on the chunks in working memory must be manually specified.
It is EXTREMELY important that you only manipulate the working memory using the add and remove methods that have been overridden by this class.
This class contains both global (static) and local constants. The default is to use the local constants. If you want to change any of the global constants, you need to do so before any instances of this class are initialized.
Field Summary | |
---|---|
static int |
GLOBAL_WORKING_MEMORY_CAPACITY
The number of slots in working memory. |
private static long |
serialVersionUID
|
private SpecializedWMChunkCollection |
SpecializedWMChunks
Specialized chunks specific only to working memory. |
int |
WORKING_MEMORY_CAPACITY
The number of slots in working memory. |
Fields inherited from class clarion.system.AbstractIntermediateModule |
---|
InputSpace |
Fields inherited from class java.util.AbstractList |
---|
modCount |
Constructor Summary | |
---|---|
WorkingMemory(CLARION Agent)
Initializes the working memory. |
Method Summary | |
---|---|
boolean |
add(AbstractChunk C)
Adds a chunk to working memory. |
boolean |
addAll(java.util.Collection<? extends AbstractChunk> C)
Adds a collection of chunks to working memory. |
boolean |
addSpecializedWMChunk(AbstractChunk C)
Adds a working memory chunk to the list of specialized working memory chunks. |
boolean |
addSpecializedWMChunks(java.util.Collection<AbstractChunk> Chunks)
Adds a collection of specialized working memory chunks to the list of specialized working memory chunks. |
protected void |
attachSelfToAgent(CLARION Agent)
Attaches the working memory to the specified CLARION agent. |
AbstractChunk |
get(java.lang.Object ID)
Gets the chunk from working memory with the specified ID. |
int |
getNumSpecializedWMChunks()
Gets the number of specialized working memory chunks. |
AbstractChunk |
getSpecializedWMChunk(int Index)
Gets the chunk from the specialized working memory chunk list at the specified Index. |
AbstractChunk |
getSpecializedWMChunk(java.lang.Object ID)
Gets the chunk from the specialized working memory chunk list with the specified ID. |
java.util.Collection<AbstractChunk> |
getSpecializedWMChunks()
Gets a collection of the specialized working memory chunks. |
AbstractChunk |
remove(int Index)
Removes a chunk from working memory. |
boolean |
remove(java.lang.Object C)
Removes the specified chunk object from working memory. |
Methods inherited from class clarion.system.AbstractIntermediateModule |
---|
updateInputSpace |
Methods inherited from class java.util.LinkedList |
---|
add, addAll, addFirst, addLast, clear, clone, contains, element, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, offer, peek, poll, remove, removeFirst, removeLast, set, size, toArray, toArray |
Methods inherited from class java.util.AbstractSequentialList |
---|
iterator |
Methods inherited from class java.util.AbstractList |
---|
equals, hashCode, listIterator, removeRange, subList |
Methods inherited from class java.util.AbstractCollection |
---|
containsAll, isEmpty, removeAll, retainAll, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.List |
---|
containsAll, equals, hashCode, isEmpty, iterator, listIterator, removeAll, retainAll, subList |
Field Detail |
---|
private static final long serialVersionUID
public static int GLOBAL_WORKING_MEMORY_CAPACITY
public int WORKING_MEMORY_CAPACITY
private SpecializedWMChunkCollection SpecializedWMChunks
Constructor Detail |
---|
public WorkingMemory(CLARION Agent)
Agent
- The agent to which the working memory is being attached.Method Detail |
---|
public boolean add(AbstractChunk C) throws FullContainerException, java.lang.IllegalArgumentException
If you want to add a new specialized working memory chunk to the list of specialized working memory chunks, call the addSpecializedWMChunk method.
add
in interface java.util.Collection<AbstractChunk>
add
in interface java.util.List<AbstractChunk>
add
in class java.util.LinkedList<AbstractChunk>
C
- The chunk to add.
FullContainerException
- If working memory is full.
java.lang.IllegalArgumentException
- If the input space does not contain all of the dimension-value
pairs specified in the chunk.public boolean addAll(java.util.Collection<? extends AbstractChunk> C)
addAll
in interface java.util.Collection<AbstractChunk>
addAll
in interface java.util.List<AbstractChunk>
addAll
in class java.util.LinkedList<AbstractChunk>
C
- The chunks to add.
public AbstractChunk remove(int Index)
remove
in interface java.util.List<AbstractChunk>
remove
in class java.util.LinkedList<AbstractChunk>
Index
- The index of the chunk to remove.
public boolean remove(java.lang.Object C)
remove
in interface java.util.Collection<AbstractChunk>
remove
in interface java.util.List<AbstractChunk>
remove
in class java.util.LinkedList<AbstractChunk>
C
- The chunk to remove.
public AbstractChunk get(java.lang.Object ID)
ID
- The ID of the chunk to get from the list of specialized working memory chunks.
public int getNumSpecializedWMChunks()
public AbstractChunk getSpecializedWMChunk(java.lang.Object ID)
This does NOT return a chunk from working memory. To get a chunk from working memory, call the get method.
ID
- The ID of the chunk to get from the list of specialized working memory chunks.
public AbstractChunk getSpecializedWMChunk(int Index)
This does NOT return a chunk from working memory. To get a chunk from working memory, call the get method.
Index
- The index of the chunk to get from the list of specialized working memory chunks.
public java.util.Collection<AbstractChunk> getSpecializedWMChunks()
public boolean addSpecializedWMChunk(AbstractChunk C)
Remember that the input layer of an implicit module or the condition of a rule in the ACS must contain nodes for all dimension-value pairs contained within any of the specialized working memory chunks you wish to have as input into the implicit module or rule condition.
This does NOT add a chunk to working memory. To add a chunk to working memory, call the add method.
C
- The specialized working memory chunk to add.
public boolean addSpecializedWMChunks(java.util.Collection<AbstractChunk> Chunks)
Remember that the input layer of an implicit module or the condition of a rule in the ACS must contain nodes for all dimension-value pairs contained within any of the specialized working memory chunks you wish to have as input into the implicit module or rule condition.
This does NOT add a collection of chunks to working memory. To add a collection of chunks to working memory, call the addAll method.
Chunks
- The collection of specialized working memory chunks to add.
protected void attachSelfToAgent(CLARION Agent)
attachSelfToAgent
in class AbstractIntermediateModule<AbstractChunk>
Agent
- The agent to wish this working memory will be attached.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |