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

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


    DirectedSparseGraph g = new DirectedSparseGraph();
    DirectedSparseVertex init = new DirectedSparseVertex();
    init.addUserDatum(JUConstants.INITIAL, true, UserData.SHARED);
    init.addUserDatum(JUConstants.ACCEPTED, false, UserData.SHARED);
    init.addUserDatum(JUConstants.LABEL, "A", UserData.SHARED);
    g.addVertex(init);
    final LearnerGraph machine = new LearnerGraph(g,mainConfiguration);
    en = new PTA_FSMStructure(machine,null) {
      {
        init(machine.new FSMImplementation(){
          @Override
View Full Code Here


    DirectedSparseGraph g = new DirectedSparseGraph();
    DirectedSparseVertex init = new DirectedSparseVertex();
    init.addUserDatum(JUConstants.INITIAL, true, UserData.SHARED);
    init.addUserDatum(JUConstants.ACCEPTED, false, UserData.SHARED);
    init.addUserDatum(JUConstants.LABEL, "A", UserData.SHARED);
    g.addVertex(init);
    PTASequenceEngine engine = new PTA_FSMStructure(new LearnerGraph(g,mainConfiguration),null);
    engine.containsSequence(new ArrayList<Label>());
  }
 
  /** Tests containsSequence. */
 
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

  @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

      {
        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<Label>>> entry:coregraph.learnerCache.getFlowgraph().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 @Override void run() {
      new LearnerGraph(g,config);// now getGraphData should choke.
    }},IllegalArgumentException.class,expectedExceptionString);
  }
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.