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:

  • StringVertex:  An attribute in Working Memory that represents a string.  StringVertex contains no additional information other than it is a StringVertex.
  • FloatRangeVertex:  An attribute in Working Memory that represents a range of float numbers.  FloatRangeVertex contains two type double numbers that hold the high and low range of that attribute.  That range is displayed in the DataMap.
  • IntegerRangeVertex:  Similar to the FloatRangeVertex, but it represents integers instead of decimal numbers.
  • SoarIdentifierVertex:  An attribute in Working Memory that might have several edges emanating from it.  It is the only type of SoarVertex that allows emanating edges and thus is the only attribute in the DataMap that has sub-attributes.  Examples of a SoarIdentifierVertex are the 'io' attribute and the 'operator' attributes.  Notice that the 'operator' attributes also contain the name of the operator in brackets.  This is a special feature of SoarIdentifierVertex's associated with operators.  Normally they just display the name of the edge.
  • EnumerationVertex: This is an attribute in Working Memory that might have several strings associated with it as values.  An EnumerationVertex may have as many strings associated with it as necessary, but must have a minimum of one string.  The strings are displayed in the DataMap window in brackets following the name of the NamedEdge.

back to the top