Package statechum.DeterministicDirectedSparseGraph

Examples of statechum.DeterministicDirectedSparseGraph.DeterministicVertex


  public void testAddEdgeFail1()
  {
    gen = new ForestFireLabelledStateMachineGenerator(0.3,0.2,0.2,0.1,0,0 ,config,converter);
    gen.machine = FsmParser.buildLearnerGraph("A-L0->B / A-L1->C / A-L2->D", "testAddEdgeFail2" ,config,converter).pathroutines.getGraph();
    gen.vertices = new LinkedList<DeterministicVertex>();gen.vertices.addAll(getGenMachineVertices());
    final DeterministicVertex vA = (DeterministicVertex) DeterministicDirectedSparseGraph.findVertex(JUConstants.LABEL,VertexID.parseID("A"),gen.machine),
    vB = (DeterministicVertex) DeterministicDirectedSparseGraph.findVertex(JUConstants.LABEL,VertexID.parseID("B"),gen.machine);
   
    Assert.assertFalse(gen.addEdgeInternal(vA, vB));// this fails to add a label
  }
View Full Code Here


  public void testAddEdgeFail2()
  {
    gen = new ForestFireLabelledStateMachineGenerator(0.3,0.2,0.2,0.1,2,0 ,config,converter);
    gen.machine = FsmParser.buildLearnerGraph("A-L0->B / A-L1->C / A-L2->D", "testAddEdgeFail2" ,config,converter).pathroutines.getGraph();
    gen.vertices = new LinkedList<DeterministicVertex>();gen.vertices.addAll(getGenMachineVertices());
    final DeterministicVertex vA = (DeterministicVertex) DeterministicDirectedSparseGraph.findVertex(JUConstants.LABEL,VertexID.parseID("A"),gen.machine),
    vB = (DeterministicVertex) DeterministicDirectedSparseGraph.findVertex(JUConstants.LABEL,VertexID.parseID("B"),gen.machine);
   
    Assert.assertFalse(gen.addEdgeInternal(vA, vB));// this fails to add a label
  }
View Full Code Here

  @Test
  public void testSelectVertices()
  {
    gen.machine = FsmParser.buildLearnerGraph("A-a->B-a->C\nA-b->B-c->C-a->D-a->E", "testRandomVertexSelection1" ,config,converter).pathroutines.getGraph();
    gen.vertices = new LinkedList<DeterministicVertex>();gen.vertices.addAll(getGenMachineVertices());
    final DeterministicVertex
      vA = (DeterministicVertex) DeterministicDirectedSparseGraph.findVertex(JUConstants.LABEL,VertexID.parseID("A"),gen.machine),
      vB = (DeterministicVertex) DeterministicDirectedSparseGraph.findVertex(JUConstants.LABEL,VertexID.parseID("B"),gen.machine),
      vC = (DeterministicVertex) DeterministicDirectedSparseGraph.findVertex(JUConstants.LABEL,VertexID.parseID("C"),gen.machine),
      vD = (DeterministicVertex) DeterministicDirectedSparseGraph.findVertex(JUConstants.LABEL,VertexID.parseID("D"),gen.machine),
      vE = (DeterministicVertex) DeterministicDirectedSparseGraph.findVertex(JUConstants.LABEL,VertexID.parseID("E"),gen.machine);
View Full Code Here

 
  /** Tests that types are correctly converted. */
  @Test
  public final void testAddUserData_name1()
  {
    DeterministicVertex vA=new DeterministicVertex("a");
   
    // here I cannot add, only set since the ID has already been set.
    vA.setUserDatum(JUConstants.LABEL, VertexID.parseID("name"), UserData.SHARED);Assert.assertEquals("name", vA.getStringId());
    vA.setUserDatum(JUConstants.LABEL, VertexID.parseID("D"), UserData.SHARED);Assert.assertEquals("D", vA.getStringId());

    DeterministicVertex vS=new DeterministicVertex("a");
    vS.setUserDatum(JUConstants.LABEL, VertexID.parseID("name"), UserData.SHARED);Assert.assertEquals("name", vS.getStringId());
  }
View Full Code Here

 
  /** Tests that types are correctly converted. */
  @Test
  public final void testAddUserData_name2()
  {
    DeterministicVertex vA=new DeterministicVertex("a");

    // here I cannot add, only set since the ID has already been set.
    vA.setUserDatum("lAbel", VertexID.parseID("name"), UserData.SHARED);Assert.assertEquals("name", vA.getStringId());
    vA.setUserDatum("labEl", VertexID.parseID("D"), UserData.SHARED);Assert.assertEquals("D", vA.getStringId());

    DeterministicVertex vS=new DeterministicVertex("a");
    vS.setUserDatum("laBel", VertexID.parseID("name"), UserData.SHARED);Assert.assertEquals("name", vS.getStringId());
  }
View Full Code Here

 
  /** Tests that types are correctly converted. */
  @Test
  public final void testAddUserData_accepted1()
  {
    DeterministicVertex vA=new DeterministicVertex("a");
    vA.addUserDatum(JUConstants.ACCEPTED, "true", UserData.SHARED);Assert.assertTrue(vA.isAccept());
    vA.setUserDatum(JUConstants.ACCEPTED, "false", UserData.SHARED);Assert.assertFalse(vA.isAccept());

    DeterministicVertex vS=new DeterministicVertex("a");
    vS.setUserDatum(JUConstants.ACCEPTED, "false", UserData.SHARED);Assert.assertFalse(vS.isAccept());
  }
View Full Code Here

 
  /** Tests that types are correctly converted. */
  @Test
  public final void testAddUserData_accepted2()
  {
    DeterministicVertex vA=new DeterministicVertex("a");
    vA.addUserDatum("acCepted", "truE", UserData.SHARED);Assert.assertTrue(vA.isAccept());
    vA.setUserDatum("accePted", "faLse", UserData.SHARED);Assert.assertFalse(vA.isAccept());

    DeterministicVertex vS=new DeterministicVertex("a");
    vS.setUserDatum("acceptEd", "fAlse", UserData.SHARED);Assert.assertFalse(vS.isAccept());
  }
View Full Code Here

  }
 
  @Test(expected=IllegalUserDataException.class)
  public final void testAddUserData_accepted_fail1()
  {
    DeterministicVertex vA=new DeterministicVertex("a");
    vA.addUserDatum("accePted", "junk", UserData.SHARED);
  }
View Full Code Here

  }

  @Test(expected=IllegalUserDataException.class)
  public final void testAddUserData_accepted_fail2()
  {
    DeterministicVertex vA=new DeterministicVertex("a");
    vA.addUserDatum("accePted", new Object(), UserData.SHARED);
  }
View Full Code Here

  /** Tests that types are correctly converted. */
  @Test
  public final void testAddUserData_highlight1()
  {
    DeterministicVertex vA=new DeterministicVertex("a");
    Assert.assertFalse(vA.isHighlight());
    vA.addUserDatum(JUConstants.HIGHLIGHT, "true", UserData.SHARED);Assert.assertTrue(vA.isHighlight());
    vA.setUserDatum(JUConstants.HIGHLIGHT, "false", UserData.SHARED);
    Assert.assertFalse(vA.isHighlight());

    DeterministicVertex vS=new DeterministicVertex("a");
    vS.setUserDatum(JUConstants.HIGHLIGHT, "false", UserData.SHARED);Assert.assertFalse(vS.isHighlight());
  }
View Full Code Here

TOP

Related Classes of statechum.DeterministicDirectedSparseGraph.DeterministicVertex

Copyright © 2018 www.massapicom. 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.