Package statechum

Examples of statechum.StringVertex


  /** test for correct data being added when an empty collection is passed. */
  @Test
  public final void testCreateLabelToStateMap6()
  {
    Map<Label,List<CmpVertex>> trans = new HashMap<Label,List<CmpVertex>>();
    List<CmpVertex> A=Arrays.asList(new CmpVertex[]{new StringVertex("A")});
    Map<Label,List<CmpVertex>> expected = new HashMap<Label,List<CmpVertex>>();expected.put(lb("e"),A);expected.put(lb("b"),A);
    assertSame(trans,createLabelToStateMap(labelList(new String[] {"b","e"}), new StringVertex("A"),trans));
    assertEquals(expected,trans);
  }
View Full Code Here


  /** test for correct data being added when null is passed. */
  @Test
  public final void testCreateLabelToStateMap7()
  {
    List<CmpVertex> A=Arrays.asList(new CmpVertex[]{new StringVertex("A")});
    Map<Label,List<CmpVertex>> expected = new HashMap<Label,List<CmpVertex>>();expected.put(lb("e"),A);expected.put(lb("b"),A);
    assertEquals(expected,createLabelToStateMap(labelList(new String[] {"b","e"}), new StringVertex("A"),null));
  }
View Full Code Here

   */
  @Test
  public final void testCreateLabelToStateMap8()
  {
    final Map<Label,List<CmpVertex>> trans = new HashMap<Label,List<CmpVertex>>();
    List<CmpVertex> A=Arrays.asList(new CmpVertex[]{new StringVertex("A")}),
      B=Arrays.asList(new CmpVertex[]{new StringVertex("B")});
    trans.put(lb("a"), A);trans.put(lb("b"), A);trans.put(lb("c"), B);
    checkForCorrectException(new whatToRun() { public @Override void run() {
      createLabelToStateMap(labelList(new String[] {"b","e"}), new StringVertex("A"),trans);
    }},IllegalArgumentException.class,"duplicate");
  }
View Full Code Here

   */
  @Test
  public final void testCreateLabelToStateMap9() // test for correct detection of nondeterminism
  {
    checkForCorrectException(new whatToRun() { public @Override void run() {
      createLabelToStateMap(labelList(new String[] {"b","b"}), new StringVertex("A"),null);
    }},IllegalArgumentException.class,"duplicate");
  }
View Full Code Here

 
  /** test for correct data being added in the case of nondeterminism. */
  @Test
  public final void testCreateLabelToStateMap_nondet1()
  {
    Map<Label,List<CmpVertex>> trans = createLabelToStateMap(labelList(new String[] {"t"}), new StringVertex("A"),
      createLabelToStateMap(AbstractLearnerGraph.buildList(Arrays.asList(new String[] {"b","e"}),config,converter), new StringVertex("A"),
        createLabelToStateMap(AbstractLearnerGraph.buildList(Arrays.asList(new String[] {"f"}),config,converter), new StringVertex("C"),null)));
    List<CmpVertex>
      A=Arrays.asList(new CmpVertex[]{new StringVertex("A")}),
      C=Arrays.asList(new CmpVertex[]{new StringVertex("C")}),
      AC=Arrays.asList(new CmpVertex[]{new StringVertex("A"),new StringVertex("C")});
      Map<Label,List<CmpVertex>> expected = new HashMap<Label,List<CmpVertex>>();
      expected.put(lb("e"),AC);expected.put(lb("b"),AC);expected.put(lb("f"), C);expected.put(lb("t"), A);
    assertSame(trans,createLabelToStateMap(labelList(new String[] {"b","e"}), new StringVertex("C"),trans));
    assertEquals(expected,trans);
  }
View Full Code Here

  /** Empty row. */
  @Test
  public final void testRowConversion0()
  {
    CmpVertex A = new StringVertex("A");
    LearnerGraph graph = new LearnerGraph(confString);
    @SuppressWarnings("unchecked")
    Map<Label,CmpVertex> actual=convertRowToDet(graph,Collections.EMPTY_MAP, null, A),
      expected = graph.createNewRow();
    assertEquals(expected,actual);
View Full Code Here

  /** Row with a single entry. */
  @Test
  public final void testRowConversion1()
  {
    CmpVertex A = new StringVertex("A"), B = new StringVertex("B");
    LearnerGraph graph = new LearnerGraph(confString);
    Map<Label,CmpVertex> actual=convertRowToDet(graph,createLabelToStateMap(labelList(new String[] {"a"}),B,null), null, A),
      expected = graph.createNewRow();
    expected.put(lb("a"), B);
    assertEquals(expected,actual);
View Full Code Here

  /** Row with a number of entries including a loop. */
  @Test
  public final void testRowConversion2()
  {
    CmpVertex A = new StringVertex("A"), B = new StringVertex("B"), C = new StringVertex("C");
    LearnerGraph graph = new LearnerGraph(confString);
    Map<Label,CmpVertex> actual=convertRowToDet(graph,
            createLabelToStateMap(labelList(new String[] {"a","b"}),B,
                createLabelToStateMap(labelList(new String[] {"e"}),A,
                    createLabelToStateMap(labelList(new String[] {"c","d"}),C,null))), null, A),
View Full Code Here

  /** Row with multiple entries and a map for renumbering of vertices. */
  @Test
  public final void testRowConversion2_renumbered()
  {
    CmpVertex A = new StringVertex("A"), B = new StringVertex("B"), C = new StringVertex("C"),
      newA = new StringVertex("newA"),newB = new StringVertex("newB"), newC = new StringVertex("newC");
    Map<CmpVertex,CmpVertex> oldToNew = new TreeMap<CmpVertex,CmpVertex>();oldToNew.put(A,newA);oldToNew.put(B,newB);oldToNew.put(C,newC);
    LearnerGraph graph = new LearnerGraph(confString);
    Map<Label,CmpVertex> actual=convertRowToDet(graph,
            createLabelToStateMap(labelList(new String[] {"a","b"}),B,
                createLabelToStateMap(labelList(new String[] {"e"}),A,
View Full Code Here

  /** Non-determinism on transition a. */
  @Test
  public final void testRowConversion_nondet1()
  {
    final CmpVertex A = new StringVertex("A"), B = new StringVertex("B"), C = new StringVertex("C");
    final LearnerGraph graph = new LearnerGraph(confString);
   
    checkForCorrectException(new whatToRun() { public @Override void run() {
      convertRowToDet(graph,createLabelToStateMap(labelList(new String[] {"a","b"}),B,createLabelToStateMap(labelList(new String[] {"a"}),C,null)), null,A);
    }},IllegalArgumentException.class,"non-deterministic");
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.