Package statechum

Examples of statechum.StringVertex


  /** Transition with an empty target state list. */
  @Test
  public final void testRowConversion_nondet2()
  {
    final CmpVertex A = new StringVertex("A");
    final LearnerGraph graph = new LearnerGraph(confString);
   
    checkForCorrectException(new whatToRun() { public @Override void run() {
      Map<Label,List<CmpVertex>> nondetRow = new TreeMap<Label,List<CmpVertex>>();nondetRow.put(lb("a"), new LinkedList<CmpVertex>());
      convertRowToDet(graph,nondetRow, null,A);
View Full Code Here


  public final void testGraphConstruction1a()
  {
    confString.setUseOrderedEntrySet(true);config.setUseOrderedEntrySet(true);
    LearnerGraph expected = new LearnerGraph(confString);expected.initEmpty();
    LearnerGraph graph = buildLearnerGraph("A--a-->B-b->C-c->A","testConstruction1",config,converter);
    CmpVertex A = new StringVertex("A"), B = new StringVertex("B"), C = new StringVertex("C");
    expected.transitionMatrix.put(A, convertRowToDet(expected,createLabelToStateMap(labelList(new String[] {"a"}),B,null), null, A));
    expected.transitionMatrix.put(B, convertRowToDet(expected,createLabelToStateMap(labelList(new String[] {"b"}),C,null), null, B));
    expected.transitionMatrix.put(C, convertRowToDet(expected,createLabelToStateMap(labelList(new String[] {"c"}),A,null), null, C));
    expected.setInit(expected.findVertex("A"));
   
View Full Code Here

  public final void testGraphConstruction1b()
  {
    confString.setUseOrderedEntrySet(true);config.setUseOrderedEntrySet(true);
    LearnerGraph expected = new LearnerGraph(confString);expected.initEmpty();
    LearnerGraph graph = buildLearnerGraph("A--a-->B-b->C-c->A","testConstruction1",config,converter);
    CmpVertex A = new StringVertex("A"), B = new StringVertex("B"), C = new StringVertex("C");
    expected.transitionMatrix.put(A, convertRowToDet(expected,createLabelToStateMap(labelList(new String[] {"a"}),B,null), null, A));
    expected.transitionMatrix.put(B, convertRowToDet(expected,createLabelToStateMap(labelList(new String[] {"b"}),C,null), null, B));
    expected.transitionMatrix.put(C, convertRowToDet(expected,createLabelToStateMap(labelList(new String[] {"c"}),A,null), null, C));
    expected.setInit(expected.findVertex("A"));
   
View Full Code Here

  public final void testGraphConstruction2()
  {
    confString.setUseOrderedEntrySet(true);config.setUseOrderedEntrySet(true);
    LearnerGraph expected = new LearnerGraph(confString);expected.initEmpty();
    LearnerGraph graph = buildLearnerGraph("A--a-->B-b->C-c->A-b->B-a-#D","testConstruction2",config,converter);
    CmpVertex A = new StringVertex("A"), B = new StringVertex("B"), C = new StringVertex("C");
    CmpVertex D = new StringVertex("D");D.setAccept(false);
    expected.transitionMatrix.put(A, convertRowToDet(expected,createLabelToStateMap(labelList(new String[] {"a","b"}),
        new StringVertex("B"),null), null, A));
    expected.transitionMatrix.put(B, convertRowToDet(expected,createLabelToStateMap(labelList(new String[] {"b"}),
        new StringVertex("C"),createLabelToStateMap(labelList(new String[] {"a"}),D,null)), null, B));
    expected.transitionMatrix.put(C, convertRowToDet(expected,createLabelToStateMap(labelList(new String[] {"c"}),
        new StringVertex("A"),null), null, C));
    expected.transitionMatrix.put(D, convertRowToDet(expected,createLabelToStateMap(emptyCollectionOfLabels,null,null), null, D));
    expected.setInit(expected.findVertex("A"));
   
    assertEquals("A", graph.getInit().getStringId());
    assertEquals("incorrect transition set",true,expected.transitionMatrix.equals(graph.transitionMatrix));
View Full Code Here

  public final void testGraphConstruction3()
  {
    confString.setUseOrderedEntrySet(true);config.setUseOrderedEntrySet(true);
    LearnerGraph expected = new LearnerGraph(confString);expected.initEmpty();
    LearnerGraph graph = buildLearnerGraph("A--a-->B<-b--C-c->A-b->A-c->A\nB-d->B-p->C\nB-q->C\nB-r->C\n","testConstruction3",config,converter);
    CmpVertex A = new StringVertex("A"), B = new StringVertex("B"), C = new StringVertex("C");
    expected.transitionMatrix.put(A, convertRowToDet(expected,createLabelToStateMap(labelList(new String[] {"b","c"}),
        new StringVertex("A"),createLabelToStateMap(labelList(new String[] {"a"}),B,null)), null, A));
    expected.transitionMatrix.put(B, convertRowToDet(expected,createLabelToStateMap(labelList(new String[] {"d"}),B,
        createLabelToStateMap(labelList(new String[] {"r","p","q"}),C,null)), null, B));
    expected.transitionMatrix.put(C, convertRowToDet(expected,createLabelToStateMap(labelList(new String[] {"b"}),B,
        createLabelToStateMap(labelList(new String[] {"c"}),A,null)), null, C));
    expected.setInit(expected.findVertex("A"));
View Full Code Here

  public final void testGraphConstruction4()
  {
    confString.setUseOrderedEntrySet(true);config.setUseOrderedEntrySet(true);
    LearnerGraph expected = new LearnerGraph(confString);expected.initEmpty();
    LearnerGraph graph = buildLearnerGraph("A--a-->B<-b--D-c->A-b->A-c->A\nB-d->B-p-#C\nB-q-#C\nB-r-#C\n","testConstruction4",config,converter);
    CmpVertex A = new StringVertex("A"), B = new StringVertex("B"), C = new StringVertex("C"),D = new StringVertex("D");
    C.setAccept(false);
    expected.transitionMatrix.put(A, convertRowToDet(expected,createLabelToStateMap(labelList(new String[] {"b","c"}),
        new StringVertex("A"),createLabelToStateMap(labelList(new String[] {"a"}),B,null)), null, A));
    expected.transitionMatrix.put(B, convertRowToDet(expected,createLabelToStateMap(labelList(new String[] {"d"}),B,
        createLabelToStateMap(labelList(new String[] {"r","p","q"}),C,null)), null, B));
    expected.transitionMatrix.put(D, convertRowToDet(expected,createLabelToStateMap(labelList(new String[] {"b"}),B,
        createLabelToStateMap(labelList(new String[] {"c"}),A,null)), null, D));
    expected.transitionMatrix.put(C, convertRowToDet(expected,createLabelToStateMap(emptyCollectionOfLabels,null,null), null, C));
View Full Code Here

  public final void testGraphConstruction5()
  {
    confString.setUseOrderedEntrySet(true);config.setUseOrderedEntrySet(true);
    LearnerGraph expected = new LearnerGraph(confString);expected.initEmpty();
    LearnerGraph graph = buildLearnerGraph("A--a-->B-b-#C\nA-b->A-c->A\nB-d->B-p-#C\nB-q-#C\nB-r-#C\n","testConstruction5",config,converter);
    CmpVertex A = new StringVertex("A"), B = new StringVertex("B"), C = new StringVertex("C");
    C.setAccept(false);
    expected.transitionMatrix.put(A, convertRowToDet(expected,createLabelToStateMap(labelList(new String[] {"b","c"}),A,
        createLabelToStateMap(labelList(new String[] {"a"}),B,null)), null, A));
    expected.transitionMatrix.put(B, convertRowToDet(expected,createLabelToStateMap(labelList(new String[] {"d"}),B,
        createLabelToStateMap(labelList(new String[] {"b","r","p","q"}),C,null)), null, B));
    expected.transitionMatrix.put(C, convertRowToDet(expected,createLabelToStateMap(emptyCollectionOfLabels,null,null), null, C));
View Full Code Here

  public final void testGraphConstruction6()
  {
    confString.setUseOrderedEntrySet(true);config.setUseOrderedEntrySet(true);
    LearnerGraph expected = new LearnerGraph(confString);expected.initEmpty();
    LearnerGraph graph = buildLearnerGraph("P-c->P<-b-Q_St<-a-P-b->P\nQ_St-a->Q_St","testConstruction6",config,converter);
    CmpVertex P = new StringVertex("P"), Q_State = new StringVertex("Q_St");
    expected.transitionMatrix.put(P, convertRowToDet(expected,createLabelToStateMap(labelList(new String[] {"b","c"}),P,
        createLabelToStateMap(labelList(new String[] {"a"}),Q_State,null)), null, P));
    expected.transitionMatrix.put(Q_State, convertRowToDet(expected,createLabelToStateMap(labelList(new String[] {"a"}),Q_State,
        createLabelToStateMap(labelList(new String[] {"b"}),P,null)), null, Q_State));
    expected.setInit(expected.findVertex("P"));
View Full Code Here

 
  /** Tests that I can assign colours meaningfully on Deterministic and String vertices. */
  @Test
  public final void testColourSetting2()
  {
    testColourHelper(new StringVertex("testB"));
  }
View Full Code Here

  @Test
  public final void testFSMStructureEquals1()
  {
    LearnerGraph a=new LearnerGraph(config),b=new LearnerGraph(config);
    a.init = new StringVertex("A");b.init = new StringVertex("A");
    Assert.assertTrue(a.equals(a));
    Assert.assertTrue(a.equals(b));

    Assert.assertFalse(a.equals(null));
    Assert.assertFalse(a.equals("hello"));
    b.init = new StringVertex("B");Assert.assertFalse(a.equals(b));
  }
View Full Code Here

TOP

Related Classes of statechum.StringVertex

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.