Examples of PTASequenceSet


Examples of statechum.model.testset.PTASequenceSet

  }
 
  @Test
  public final void testPrefixRemovingCollection7a()
  {
    PTASequenceSet c = new PTASequenceSet();
    c.addSequence(new LinkedList<Label>());
    c.addSequence(labelList(new String[]{"a"}));
    c.addSequence(labelList(new String[]{}));
    c.addSequence(labelList(new String[]{"a","b"}));
    c.addSequence(labelList(new String[]{"a"}));
    c.addSequence(labelList(new String[]{"a"}));
    Set<List<Label>> expected = buildSet(new String[][]{
        new String[]{"a","b"},
    },config,converter),actual = new HashSet<List<Label>>();actual.addAll(c.getData());
    Assert.assertEquals(1, c.getData().size());
    Assert.assertTrue(expected.equals(actual));
    Assert.assertFalse(c.getData().isEmpty());

    Assert.assertTrue(c.contains(new LinkedList<Label>()));
    Assert.assertTrue(c.contains(labelList(new String[]{"a"})));
    Assert.assertTrue(c.contains(labelList(new String[]{"a","b"})));
    Assert.assertFalse(c.contains(labelList(new String[]{"a","b","a"})));
   
    Assert.assertTrue(c.containsAll(expected));
    Assert.assertTrue(c.containsAll(c));
  }
View Full Code Here

Examples of statechum.model.testset.PTASequenceSet

  }
 
  @Test
  public final void testPrefixRemovingCollection7b()
  {
    PTASequenceSet c = new PTASequenceSet();
    c.addSequence(new LinkedList<Label>());
    c.addSequence(labelList(new String[]{"a"}));
    c.addSequence(labelList(new String[]{}));
    c.addSequence(labelList(new String[]{"a","b"}));
    c.addSequence(labelList(new String[]{"a"}));
    c.addSequence(labelList(new String[]{"a"}));
    Set<List<Label>> expected = buildSet(new String[][]{
        new String[]{"a","b"},
    },config,converter),actual = new HashSet<List<Label>>();actual.addAll(c.getData());
    Assert.assertEquals(1, c.getData().size());
    Assert.assertTrue(expected.equals(actual));
    Assert.assertFalse(c.getData().isEmpty());

    Assert.assertTrue(c.contains(new LinkedList<Label>()));
    Assert.assertTrue(c.contains(labelList(new String[]{"a"})));
    Assert.assertTrue(c.contains(labelList(new String[]{"a","b"})));
    Assert.assertFalse(c.contains(labelList(new String[]{"a","b","a"})));
   
    Assert.assertTrue(c.containsAll(expected));
    Assert.assertTrue(c.containsAll(c));
  }
View Full Code Here

Examples of statechum.model.testset.PTASequenceSet

  }
 
  @Test
  public final void testPrefixRemovingCollection8()
  {
    PTASequenceSet c = new PTASequenceSet();
    c.addSequence(new LinkedList<Label>());
    c.addSequence(labelList(new String[]{"a"}));
    c.addSequence(labelList(new String[]{}));
    c.addSequence(labelList(new String[]{"a","b"}));
    c.addSequence(labelList(new String[]{"a","c","d"}));
    c.addSequence(labelList(new String[]{"a"}));
    c.addSequence(labelList(new String[]{"a"}));
    Set<List<Label>> expected = buildSet(new String[][]{
        new String[]{"a","b"},
        new String[]{"a","c","d"}
    },config,converter),actual = new HashSet<List<Label>>();actual.addAll(c.getData());
    Assert.assertEquals(2, c.getData().size());
    Assert.assertTrue(expected.equals(actual));
    Assert.assertFalse(c.getData().isEmpty());

    Assert.assertTrue(c.contains(new LinkedList<Label>()));
    Assert.assertTrue(c.contains(labelList(new String[]{"a"})));
    Assert.assertTrue(c.contains(labelList(new String[]{"a","b"})));
    Assert.assertTrue(c.contains(labelList(new String[]{"a","c"})));
    Assert.assertTrue(c.contains(labelList(new String[]{"a","c","d"})));
    Assert.assertFalse(c.contains(labelList(new String[]{"a","b","a"})));
   
    Assert.assertTrue(c.containsAll(expected));
    Assert.assertTrue(c.containsAll(c));
  }
View Full Code Here

Examples of statechum.model.testset.PTASequenceSet

  }
 
  @Test
  public final void testPrefixRemovingCollection9()
  {
    PTASequenceSet c = new PTASequenceSet();
    c.addAll(buildSet(new String[][] {
      new String[]{"a"},
      new String[]{},
      new String[]{"a","b"},
      new String[]{"a","c","d"},
      new String[]{"a"},
      new String[]{"a"}},config,converter));
    Set<List<Label>> expected = buildSet(new String[][]{
        new String[]{"a","b"},
        new String[]{"a","c","d"}
    },config,converter),actual = new HashSet<List<Label>>();actual.addAll(c.getData());
    Assert.assertEquals(2, c.getData().size());
    Assert.assertTrue(expected.equals(actual));
    Assert.assertFalse(c.getData().isEmpty());

    Assert.assertTrue(c.contains(new LinkedList<Label>()));
    Assert.assertTrue(c.contains(labelList(new String[]{"a"})));
    Assert.assertTrue(c.contains(labelList(new String[]{"a","b"})));
    Assert.assertTrue(c.contains(labelList(new String[]{"a","c"})));
    Assert.assertTrue(c.contains(labelList(new String[]{"a","c","d"})));
    Assert.assertFalse(c.contains(labelList(new String[]{"a","b","a"})));
   
    Assert.assertTrue(c.containsAll(expected));
    Assert.assertTrue(c.containsAll(c));
  }
View Full Code Here

Examples of statechum.model.testset.PTASequenceSet

  }
 
  @Test
  public final void testPrefixRemovingCollection10()
  {
    PTASequenceSet c = new PTASequenceSet();
    c.addAll(buildSet(new String[][] {
      new String[]{"a"},
      new String[]{},
      new String[]{"a","b"}},config,converter));
   
    PTASequenceSet d = new PTASequenceSet();
    d.addAll(buildSet(new String[][] {   
      new String[]{"a","c","d"},
      new String[]{"a"},
      new String[]{"a"}},config,converter));
    c.addAll(d);
    Set<List<Label>> expected = buildSet(new String[][]{
View Full Code Here

Examples of statechum.model.testset.PTASequenceSet

  }
 
  @Test
  public final void testPrefixRemovingCollection11()
  {
    PTASequenceSet c = new PTASequenceSet();
    c.addAll(buildSet(new String[][] {
      new String[]{"a"},
      new String[]{},
      new String[]{"a","b"},
      new String[]{"a","c","d"},
      new String[]{"a"},
      new String[]{"a"}},config,converter));
    Set<List<Label>> expected = buildSet(new String[][]{
        new String[]{"a","b"},
        new String[]{"a","c","d"}
    },config,converter),actual = new HashSet<List<Label>>();actual.addAll(c);
    Assert.assertEquals(2, c.getData().size());
    Assert.assertTrue(expected.equals(actual));
    Assert.assertFalse(c.getData().isEmpty());

    Assert.assertTrue(c.contains(new LinkedList<Label>()));
    Assert.assertTrue(c.contains(labelList(new String[]{"a"})));
    Assert.assertTrue(c.contains(labelList(new String[]{"a","b"})));
    Assert.assertTrue(c.contains(labelList(new String[]{"a","c"})));
    Assert.assertTrue(c.contains(labelList(new String[]{"a","c","d"})));
    Assert.assertFalse(c.contains(labelList(new String[]{"a","b","a"})));
   
    Assert.assertTrue(c.containsAll(expected));
    Assert.assertTrue(c.containsAll(c));
  }
View Full Code Here

Examples of statechum.model.testset.PTASequenceSet

   * generating walks.
   */
  protected void initAllSequences()
  {
    tag = new StateName(0,false);
    allSequences = new PTASequenceSet(new PercentLabelledPTA());extraSequences = new PTASequenceSet(new PercentLabelledPTA());
  }
View Full Code Here

Examples of statechum.xmachine.model.testset.PTASequenceSet

    DirectedSparseGraph learningOutcomeA = l.learnMachine();
    //updateFrame(learningOutcome,g);
    FSMStructure learntStructureA = WMethod.getGraphData(learningOutcomeA);

    // Now do the same with ptasets instead of real sets
    PTASequenceSet plusPTA = new PTASequenceSet();plusPTA.addAll(buildSet(plus));PTASequenceSet minusPTA = new PTASequenceSet();minusPTA.addAll(buildSet(minus));
    l.init(plusPTA, minusPTA);
    DirectedSparseGraph learningOutcomeB = l.learnMachine();
    FSMStructure learntStructureB = WMethod.getGraphData(learningOutcomeB);
   
    TestFSMAlgo.checkMBoolean(learntStructureA, learntStructureB, learntStructureA.init, learntStructureB.init);
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.