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

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


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


  /** Checks if adding a vertex to a graph causes an exception to be thrown. */
  public static 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);
    getGraphData(g);// without the vertex being added, everything should be fine.
    g.addVertex(v);// add the vertex
   
    boolean exceptionThrown = false;
    try
    {
      getGraphData(g);// now getGraphData should choke.     
View Full Code Here

  public final void testGraphConstructionFail7() // unlabelled states
  {
    DirectedSparseGraph g = new DirectedSparseGraph();
    DirectedSparseVertex init = new DirectedSparseVertex();
    init.addUserDatum(JUConstants.PROPERTY, JUConstants.INIT, UserData.SHARED);
    init.addUserDatum(JUConstants.ACCEPTED, "true", UserData.SHARED);g.addVertex(init);
    boolean exceptionThrown = false;
    try
    {
      getGraphData(g);// now getGraphData should choke.     
    }
View Full Code Here

    DirectedSparseGraph g = new DirectedSparseGraph();
    DirectedSparseVertex init = new DirectedSparseVertex();
    init.addUserDatum("property", "init", UserData.SHARED);
    init.addUserDatum(JUConstants.ACCEPTED, "false", UserData.SHARED);
    init.addUserDatum(JUConstants.LABEL, "A", UserData.SHARED);
    g.addVertex(init);
    PTATestSequenceEngine enVerySmall = new PTA_FSMStructure(WMethod.getGraphData(g));
    vertifyPTA(enVerySmall, new String[][] {
        new String[] {}
      });
  }
View Full Code Here

    DirectedSparseGraph g = new DirectedSparseGraph();
    DirectedSparseVertex init = new DirectedSparseVertex();
    init.addUserDatum("property", "init", UserData.SHARED);
    init.addUserDatum(JUConstants.ACCEPTED, "true", UserData.SHARED);
    init.addUserDatum(JUConstants.LABEL, "A", UserData.SHARED);
    g.addVertex(init);
    PTATestSequenceEngine enVerySmall = new PTA_FSMStructure(WMethod.getGraphData(g));
    vertifyPTA(enVerySmall, new String[][] {
        new String[] {}
    });
  }
View Full Code Here

  public void checkWithVertex(Vertex v,String expectedExceptionString, String testName)
  {
    LearnerGraph graph = buildLearnerGraph("A--a-->B<-b-CNFL\nA-b->A-c->A\nB-d->B-p->CNFL",testName,config,converter);
    final DirectedSparseGraph g = graph.pathroutines.getGraph();
    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

  @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

  /** 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
   
    try
    {
      new LearnerGraph(g,config);// now getGraphData should choke.
      Assert.fail("exception not thrown");
View Full Code Here

  public final void testGraphConstructionFail7()
  {
    DirectedSparseGraph g = new DirectedSparseGraph();
    DirectedSparseVertex init = new DirectedSparseVertex();
    init.addUserDatum(JUConstants.INITIAL, true, UserData.SHARED);
    init.addUserDatum(JUConstants.ACCEPTED, true, UserData.SHARED);g.addVertex(init);
    boolean exceptionThrown = false;
    try
    {
      new LearnerGraph(new DirectedSparseGraph(),config);// now getGraphData should choke.     
    }
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.