Package edu.uci.ics.jung.graph.impl

Examples of edu.uci.ics.jung.graph.impl.DirectedSparseGraph.addVertex()


          fromVertex = new DeterministicDirectedSparseGraph.DeterministicVertex(from);
          if (existingVertices.isEmpty())
            fromVertex.addUserDatum(JUConstants.INITIAL, true, UserData.SHARED);
          fromVertex.addUserDatum(JUConstants.ACCEPTED, true, UserData.SHARED);
          existingVertices.put(from, fromVertex);
          g.addVertex(fromVertex);
        }
        else
          if (!Boolean.valueOf(fromVertex.getUserDatum(JUConstants.ACCEPTED).toString()))
            throw new IllegalArgumentException("conflicting acceptance assignment on vertex "+from);
View Full Code Here


          {
            toVertex = new DeterministicDirectedSparseGraph.DeterministicVertex(to);
            toVertex.removeUserDatum(JUConstants.ACCEPTED); // in case we've got a reject loop in the same state
            toVertex.addUserDatum(JUConstants.ACCEPTED, accept, UserData.SHARED);
            existingVertices.put(to, toVertex);
            g.addVertex(toVertex);
          }
          else
            if (DeterministicDirectedSparseGraph.isAccept(toVertex) != accept)
              throw new IllegalArgumentException("conflicting acceptance assignment on vertex "+to);
       
View Full Code Here

    DirectedSparseGraph g = new DirectedSparseGraph();
    DirectedSparseVertex init = new DirectedSparseVertex();
    init.addUserDatum(JUConstants.LABEL, "A", UserData.SHARED);
    init.addUserDatum(JUConstants.INITIAL, true, UserData.SHARED);
    init.addUserDatum(JUConstants.ACCEPTED, true, UserData.SHARED);
    g.addVertex(init);
    checkTestGenerationResult(new LearnerGraph(g,config),0, new String[][] {
        new String[] {}
      });
  }
 
View Full Code Here

    DirectedSparseGraph g = new DirectedSparseGraph();
    DirectedSparseVertex init = new DirectedSparseVertex();
    init.addUserDatum(JUConstants.LABEL, "A", UserData.SHARED);
    init.addUserDatum(JUConstants.INITIAL, true, UserData.SHARED);
    init.addUserDatum(JUConstants.ACCEPTED, true, UserData.SHARED);
    g.addVertex(init);
    checkTestGenerationResult(new LearnerGraph(g,config),2, new String[][] {
        new String[] {}
      });
  }
 
View Full Code Here

      {
        CmpVertex source = entry.getKey();
        DeterministicVertex vert = (DeterministicVertex)AbstractLearnerGraph.cloneCmpVertex(source,cloneConfig);
        if (coregraph.getInit() == source)
          vert.addUserDatum(JUConstants.INITIAL, true, UserData.SHARED);
        result.addVertex(vert);
        oldToNew.put(source,vert);
      }
     
      // now add transitions
      for(Entry<CmpVertex,Map<CmpVertex,Set<String>>> entry:coregraph.learnerCache.getFlowgraph().entrySet())
View Full Code Here

  @Test
  public final void testCopyGraph0()
  {
    DirectedSparseGraph g=new DirectedSparseGraph();
    g.addVertex(new DirectedSparseVertex());
    g.addVertex(new DirectedSparseVertex());
    DirectedSparseGraph copy = DeterministicDirectedSparseGraph.copy(g);
    Assert.assertTrue(copy.getEdges().isEmpty() && copy.getVertices().isEmpty());
  }
 
View Full Code Here

  @Test
  public final void testCopyGraph0()
  {
    DirectedSparseGraph g=new DirectedSparseGraph();
    g.addVertex(new DirectedSparseVertex());
    g.addVertex(new DirectedSparseVertex());
    DirectedSparseGraph copy = DeterministicDirectedSparseGraph.copy(g);
    Assert.assertTrue(copy.getEdges().isEmpty() && copy.getVertices().isEmpty());
  }
 
  /** Yet another test that copy works. */
 
View Full Code Here

        if (coregraph.getInit() == source)
          vert.addUserDatum(JUConstants.INITIAL, true, UserData.SHARED);
        vert.setAccept(source.isAccept());
        vert.setColour(source.getColour());
        vert.setHighlight(source.isHighlight());
        result.addVertex(vert);
        oldToNew.put(source,vert);
      }
     
      // now add transitions
      for(Entry<CmpVertex,Map<CmpVertex,Set<Label>>> entry:flowgraph.entrySet())
View Full Code Here

  /** Checks if adding a vertex to a graph causes an exception to be thrown. */
  public void checkWithVertex(Vertex v,String expectedExceptionString, String testName)
  {
    final DirectedSparseGraph g = buildGraph("A--a-->B<-b-CONFL\nA-b->A-c->A\nB-d->B-p->CONFL",testName);
    new LearnerGraph(g,config);// without the vertex being added, everything should be fine.
    g.addVertex(v);// add the vertex

    checkForCorrectException(new whatToRun() { public void run() {
      new LearnerGraph(g,config);// now getGraphData should choke.
    }},IllegalArgumentException.class,expectedExceptionString);
  }
View Full Code Here

          fromVertex = new DeterministicDirectedSparseGraph.DeterministicVertex(from);
          if (existingVertices.isEmpty())
            fromVertex.addUserDatum(JUConstants.INITIAL, true, UserData.SHARED);
          fromVertex.addUserDatum(JUConstants.ACCEPTED, true, UserData.SHARED);
          existingVertices.put(from, fromVertex);
          g.addVertex(fromVertex);
        }
        else
          if (!Boolean.valueOf(fromVertex.getUserDatum(JUConstants.ACCEPTED).toString()))
            throw new IllegalArgumentException("conflicting acceptance assignment on vertex "+from);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.