SoarWorkingMemoryModel
The SoarWorkingMemoryModel is the class that represents Working Memory in a Visual Soar project.
The Working Memory is represented as a directed graph composed of edges and vertices.
Every edge points to exactly two vertices. A vertex in working memory might have many emanating edges, but a minimum of one edge associated with it.
The Data Map displays a state in Working Memory.
How Working Memory translates to the DataMap window:
The DataMap displays this information
by translating the edges into
FakeTreeNodes and using a class called SoarWMTreeModelWrapper to create a model
that can be displayed as a tree. This is necessary because a Directed
Graph could contain infinite recursion and the FakeTreeNode class enables the
working memory graph to be loaded into a tree form with out running out of
memory.
New entries are added to Working Memory by a method in the Operator Window class called addTriple(SoarVertex, string, Soar Vertex). The string in the method is the name of the edge and the SoarVertex's represent the two soar vertices that the edge will connect. What is displayed on the DataMap is a combination of the NamedEdge and the vertex that the edge points too. For example, the 'input-link' entry on the DataMap is a NamedEdge named, 'input-link' that points to a vertex of class type, SoarIdentifierVertex. Since a SoarIdentifierVertex contains no additional information, all that is displayed is the string "input-link". In another example, below the 'input-link' entry is a NamedEdge that is named, 'fire'. This NamedEdge points to a vertex of class type, EnumerationVertex. An EnumerationVertex contains a List of strings that are associated with that vertex. In this case, the strings are "body" and "shield". Therefore, what is displayed on the DataMap is "damage: [body shield]". Here is some brief information on the different sub classes of SoarVertex:
|