|
Java 2 Platform v1.3 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.umich.visualsoar.datamap.SoarWorkingMemoryModel
This is a model of Soar's Working Memory represented by a directed graph structure
Field Summary | |
private java.util.LinkedList |
listeners
|
private java.util.Map |
properties
|
private edu.umich.visualsoar.graph.DirectedGraph |
rep
|
Constructor Summary | |
SoarWorkingMemoryModel(boolean isNew,
java.lang.String name)
Creates a default model of working memory |
Method Summary | |
void |
addProperty(java.lang.String name,
edu.umich.visualsoar.graph.SoarVertex sv)
|
void |
addTriple(edu.umich.visualsoar.graph.SoarVertex v0,
java.lang.String attribute,
edu.umich.visualsoar.graph.SoarVertex v1)
Adds a triple to working memory |
void |
addTriple(edu.umich.visualsoar.graph.SoarVertex v0,
java.lang.String attribute,
edu.umich.visualsoar.graph.SoarVertex v1,
boolean generated,
edu.umich.visualsoar.operatorwindow.OperatorNode current,
int lineNumber)
Adds a triple to working memory Also denotes that this triple was created by the automatic DataMap generator. |
void |
addTriple(edu.umich.visualsoar.graph.SoarVertex v0,
java.lang.String attribute,
edu.umich.visualsoar.graph.SoarVertex v1,
int generated,
java.lang.String comment)
Adds a triple to working memory Also sets a comment to the edge that the triple creates. |
void |
addVertex(edu.umich.visualsoar.graph.Vertex v)
This is only needed by the reader, in the future this will only be package accessible regular users should go through the factory create methods |
void |
addWorkingMemoryListener(edu.umich.visualsoar.datamap.WorkingMemoryListener l)
Adds a listener to working memory, to receive working memory events |
void |
changeProperty(java.lang.String name,
edu.umich.visualsoar.graph.SoarVertex value)
|
java.util.List |
checkGenerateProduction(edu.umich.visualsoar.graph.SoarIdentifierVertex sv,
edu.umich.visualsoar.parser.SoarProduction sp,
edu.umich.visualsoar.operatorwindow.OperatorNode current)
Used by the Generate Productions actions to look for holes in Working Memory and fix those holes. |
java.util.List |
checkProduction(edu.umich.visualsoar.graph.SoarIdentifierVertex sv,
edu.umich.visualsoar.parser.SoarProduction sp)
Used to determine if a soar production matches Working Memory |
java.util.List |
checkProductionLog(edu.umich.visualsoar.graph.SoarIdentifierVertex sv,
edu.umich.visualsoar.parser.SoarProduction sp,
java.io.FileWriter fw)
Used to determine if a soar production matches Working Memory This function will also generate a log file to keep track of production checking |
edu.umich.visualsoar.graph.EnumerationVertex |
createNewEnumeration(java.lang.String s)
Create a new EnumerationVertex with a string that represents the only acceptable value for that enumeration |
edu.umich.visualsoar.graph.EnumerationVertex |
createNewEnumeration(java.util.Vector s)
Create a new EnumerationVertex with a vector of strings that represent possible values for that enumeration |
edu.umich.visualsoar.graph.FloatRangeVertex |
createNewFloat()
Create Float Vertex with default (unbounded) range |
edu.umich.visualsoar.graph.FloatRangeVertex |
createNewFloatRange(float low,
float high)
Create Float Vertex with specified range |
edu.umich.visualsoar.graph.IntegerRangeVertex |
createNewInteger()
Create Integer Vertex with default (unbounded) range |
edu.umich.visualsoar.graph.IntegerRangeVertex |
createNewIntegerRange(int low,
int high)
Create Integer Vertex with specified range |
edu.umich.visualsoar.graph.SoarIdentifierVertex |
createNewSoarId()
Create a basic soar Identifier Vertex |
edu.umich.visualsoar.graph.SoarIdentifierVertex |
createNewStateId(edu.umich.visualsoar.graph.SoarIdentifierVertex superstate,
java.lang.String name)
Called to create the Vertex and appropriate identifiers for a high-level operator |
edu.umich.visualsoar.graph.StringVertex |
createNewString()
Create a StringVertex attribute |
edu.umich.visualsoar.graph.SoarVertex |
createVertexCopy(edu.umich.visualsoar.graph.SoarVertex orig)
Returns an exact copy of a SoarVertex with a new id |
java.util.Enumeration |
emanatingEdges(edu.umich.visualsoar.graph.Vertex v)
Returns an enumeration of all the edges that are emanating/leaving from a particular vertex. |
java.util.Set |
getEntrySet()
|
java.util.Enumeration |
getIncidentEdges(edu.umich.visualsoar.graph.Vertex v)
|
edu.umich.visualsoar.graph.SoarVertex |
getMatchingParent(edu.umich.visualsoar.graph.SoarVertex sv)
|
protected int |
getNextVertexId()
Each Vertex in Working Memory has a unique ID, function returns the next available Vertex ID |
int |
getNumberOfVertices()
Returns the number of vertices in Working Memory |
java.util.List |
getParents(edu.umich.visualsoar.graph.SoarVertex sv)
Return all parents of a vertex |
edu.umich.visualsoar.graph.SoarVertex |
getProperty(java.lang.String name)
|
edu.umich.visualsoar.graph.SoarIdentifierVertex |
getTopstate()
|
edu.umich.visualsoar.graph.SoarVertex |
getVertexForId(int i)
For a particular id, returns the corresponding soar vertex |
java.util.List |
matches(edu.umich.visualsoar.graph.SoarIdentifierVertex sv,
edu.umich.visualsoar.parser.SoarProduction sp,
java.lang.String variable)
Function finds the set of variables within a productions that matches a given string |
protected void |
notifyListenersOfAdd(edu.umich.visualsoar.graph.NamedEdge ne)
Notifies the listeners to refresh the screen |
protected void |
notifyListenersOfRemove(edu.umich.visualsoar.graph.NamedEdge ne)
Notifies the listeners to refresh the screen |
int |
numberOfEdges()
Returns the total number of edges contained in working memory |
int |
numberOfVertices()
Returns the number of vertices contained in working memory |
void |
reduce(java.util.List startVertices)
|
void |
removeProperty(java.lang.String name)
|
void |
removeTriple(edu.umich.visualsoar.graph.SoarVertex v0,
java.lang.String attribute,
edu.umich.visualsoar.graph.SoarVertex v1)
Removes the requested triple from Working Memory |
void |
removeWorkingMemoryListener(edu.umich.visualsoar.datamap.WorkingMemoryListener l)
removes a listener from working memory, to make it stop receiving working memory events |
void |
resolve()
|
void |
setTopstate(edu.umich.visualsoar.graph.SoarIdentifierVertex siv)
This sets the topstate, this should only be called by trusted members |
void |
write(java.io.Writer graphWriter)
Writes out information for the datamap file (.dm file) .dm datamap file is in the format of: number of vertices write out all vertices: |vertex type| |vertex id int| |number of enumerations| |enumeration strings .....| number of edges write out all edges: | left vertex | |name of edge| |right vertex| |
void |
writeComments(java.io.Writer commentWriter)
Writes all of the edge comments to the writer to create the comment file and whether a datamap entry is generated or not. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private edu.umich.visualsoar.graph.DirectedGraph rep
private java.util.LinkedList listeners
private java.util.Map properties
Constructor Detail |
public SoarWorkingMemoryModel(boolean isNew, java.lang.String name)
isNew
- only create if model is newname
- name used for the topstateaddTriple(SoarVertex,String,SoarVertex)
,
addProperty(String,SoarVertex)
Method Detail |
public void addProperty(java.lang.String name, edu.umich.visualsoar.graph.SoarVertex sv)
public void changeProperty(java.lang.String name, edu.umich.visualsoar.graph.SoarVertex value)
public edu.umich.visualsoar.graph.SoarVertex getProperty(java.lang.String name)
public void removeProperty(java.lang.String name)
public java.util.Set getEntrySet()
public void setTopstate(edu.umich.visualsoar.graph.SoarIdentifierVertex siv)
public edu.umich.visualsoar.graph.SoarVertex getVertexForId(int i)
public void addWorkingMemoryListener(edu.umich.visualsoar.datamap.WorkingMemoryListener l)
public void removeWorkingMemoryListener(edu.umich.visualsoar.datamap.WorkingMemoryListener l)
public void addTriple(edu.umich.visualsoar.graph.SoarVertex v0, java.lang.String attribute, edu.umich.visualsoar.graph.SoarVertex v1)
public void addTriple(edu.umich.visualsoar.graph.SoarVertex v0, java.lang.String attribute, edu.umich.visualsoar.graph.SoarVertex v1, int generated, java.lang.String comment)
public void addTriple(edu.umich.visualsoar.graph.SoarVertex v0, java.lang.String attribute, edu.umich.visualsoar.graph.SoarVertex v1, boolean generated, edu.umich.visualsoar.operatorwindow.OperatorNode current, int lineNumber)
public edu.umich.visualsoar.graph.SoarIdentifierVertex getTopstate()
public java.util.Enumeration emanatingEdges(edu.umich.visualsoar.graph.Vertex v)
NamedEdge
public java.util.Enumeration getIncidentEdges(edu.umich.visualsoar.graph.Vertex v)
public int numberOfVertices()
SoarVertex
public int numberOfEdges()
NamedEdge
public void addVertex(edu.umich.visualsoar.graph.Vertex v)
public void reduce(java.util.List startVertices)
public void removeTriple(edu.umich.visualsoar.graph.SoarVertex v0, java.lang.String attribute, edu.umich.visualsoar.graph.SoarVertex v1)
public edu.umich.visualsoar.graph.SoarVertex createVertexCopy(edu.umich.visualsoar.graph.SoarVertex orig)
public edu.umich.visualsoar.graph.EnumerationVertex createNewEnumeration(java.util.Vector s)
s
- the vector of strings that represent valuesEnumerationVertex
public edu.umich.visualsoar.graph.EnumerationVertex createNewEnumeration(java.lang.String s)
s
- string representing the value for that enumeration attributeEnumerationVertex
public edu.umich.visualsoar.graph.IntegerRangeVertex createNewInteger()
IntegerRangeVertex
public edu.umich.visualsoar.graph.IntegerRangeVertex createNewIntegerRange(int low, int high)
low
- the minimum limit of the integer attributehigh
- the maximum limit of the integer attributeIntegerRangeVertex
public edu.umich.visualsoar.graph.StringVertex createNewString()
StringVertex
public edu.umich.visualsoar.graph.FloatRangeVertex createNewFloat()
FloatRangeVertex
public edu.umich.visualsoar.graph.FloatRangeVertex createNewFloatRange(float low, float high)
low
- the minimum limit of the float attributehigh
- the maximum limit of the float attributeFloatRangeVertex
public edu.umich.visualsoar.graph.SoarIdentifierVertex createNewSoarId()
SoarIdentifierVertex
public edu.umich.visualsoar.graph.SoarIdentifierVertex createNewStateId(edu.umich.visualsoar.graph.SoarIdentifierVertex superstate, java.lang.String name)
superstate
- the parent operator of the operatorname
- the name of the high-level operator
SoarIdentifierVertex
protected int getNextVertexId()
protected void notifyListenersOfAdd(edu.umich.visualsoar.graph.NamedEdge ne)
ne
- the edge that was addedprotected void notifyListenersOfRemove(edu.umich.visualsoar.graph.NamedEdge ne)
ne
- the edge that has been removedpublic void write(java.io.Writer graphWriter) throws java.io.IOException
graphWriter
- the file to be written too - .dm file
java.io.IOException
public void writeComments(java.io.Writer commentWriter) throws java.io.IOException
java.io.IOException
public java.util.List matches(edu.umich.visualsoar.graph.SoarIdentifierVertex sv, edu.umich.visualsoar.parser.SoarProduction sp, java.lang.String variable)
sv
- the SoarIdentifierVertex currently checkingsp
- the SoarProduction to check for matching variablesvariable
- the string that function tries to match
public java.util.List checkProduction(edu.umich.visualsoar.graph.SoarIdentifierVertex sv, edu.umich.visualsoar.parser.SoarProduction sp)
sv
- the SoarIdentifierVertex in WorkingMemory currently checkingsp
- the Soar Production to check
DefaultCheckerErrorHandler
,
DataMapChecker#check(SoarWorkingMemoryModel,SoarIdentifierVertex,TriplesExtractor,DefaultCheckerErrorHandler)
public java.util.List checkProductionLog(edu.umich.visualsoar.graph.SoarIdentifierVertex sv, edu.umich.visualsoar.parser.SoarProduction sp, java.io.FileWriter fw)
sv
- the SoarIdentifierVertex in WorkingMemory currently checkingsp
- the Soar Production to checkfw
- the log file that is being written too - "CheckingProductions.log"
DefaultCheckerErrorHandler
,
DataMapChecker#check(SoarWorkingMemoryModel,SoarIdentifierVertex,TriplesExtractor,DefaultCheckerErrorHandler)
public java.util.List checkGenerateProduction(edu.umich.visualsoar.graph.SoarIdentifierVertex sv, edu.umich.visualsoar.parser.SoarProduction sp, edu.umich.visualsoar.operatorwindow.OperatorNode current)
sv
- the SoarIdentifierVertex in WorkingMemory currently checkingsp
- the Soar Production to checkcurrent
- the node being examined
DefaultCheckerErrorHandler
,
DataMapChecker#complete(SoarWorkingMemoryModel,SoarIdentifierVertex,TriplesExtractor,DefaultCheckerErrorHandler,OperatorNode)
public java.util.List getParents(edu.umich.visualsoar.graph.SoarVertex sv)
sv
- the source vertex
public edu.umich.visualsoar.graph.SoarVertex getMatchingParent(edu.umich.visualsoar.graph.SoarVertex sv)
DirectedGraph.getMatchingParent(SoarWorkingMemoryModel, SoarVertex)
public void resolve()
public int getNumberOfVertices()
|
Java 2 Platform v1.3 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |