コード例 #1
0
 /**
  * Adds a triple to working memory Also sets a comment to the edge that the triple creates. This
  * comment is read in by the SoarWorkingMemoryReader when the .dm file is loaded
  */
 public void addTriple(
     SoarVertex v0, String attribute, SoarVertex v1, int generated, String comment) {
   if (!v0.allowsEmanatingEdges())
     throw new IllegalArgumentException("The First SoarVertex does not allow emanating edges");
   NamedEdge ne = new NamedEdge(v0, v1, attribute);
   if (comment.length() > 1) ne.setComment(comment);
   if (generated == 1) ne.setAsGenerated();
   rep.addEdge(ne);
   notifyListenersOfAdd(ne);
 }
コード例 #2
0
 /**
  * Adds a triple to working memory Also denotes that this triple was created by the automatic
  * DataMap generator. This will cause the dataMap entry of this triple to show up as colored text
  * until the entry is validated by the user as acceptable.
  */
 public void addTriple(
     SoarVertex v0,
     String attribute,
     SoarVertex v1,
     boolean generated,
     OperatorNode current,
     int lineNumber) {
   if (!v0.allowsEmanatingEdges())
     throw new IllegalArgumentException("The First SoarVertex does not allow emanating edges");
   NamedEdge ne = new NamedEdge(v0, v1, attribute);
   if (generated) {
     ne.setAsGenerated();
     ne.setNode(current);
     ne.setLineNumber(lineNumber);
   }
   rep.addEdge(ne);
   notifyListenersOfAdd(ne);
 }