Package statechum.model.testset.PTASequenceEngine

Examples of statechum.model.testset.PTASequenceEngine.SequenceSet


  public final void testPrecisionRecall_ign1() // long test sequence (which exists) which is rejected part-way, but first element of it is ignored.
  {
    LearnerGraph mach = new LearnerGraph(TestFSMAlgo.buildGraph("AM-a->AM-b->AM-c->AM","testPrecisionRecall_ign1"),config);
    PTASequenceEngine engine = new PTA_FSMStructure(mach);

    SequenceSet partialPTA = engine.new SequenceSet();partialPTA.setIdentity();
    partialPTA = partialPTA.cross(TestFSMAlgo.buildSet(new String[][] {
        new String[] {"a"},
      }));
    PTA_computePrecisionRecall precComputer = new PTA_computePrecisionRecall(fsm);
    precComputer.crossWith(engine);
   
    engine = new PTA_FSMStructure(mach);
    partialPTA = engine.new SequenceSet();partialPTA.setIdentity();
    partialPTA = partialPTA.cross(TestFSMAlgo.buildSet(new String[][] {
        new String[] {"a","b","b","c","c"},
      }));
    precComputer.crossWith(engine);
    assertEquals(1, precComputer.pos_relret);assertEquals(0, precComputer.neg_relret);
    assertEquals(4, precComputer.pos_Rel);assertEquals(0, precComputer.neg_Rel);
View Full Code Here


  @Test
  public final void testPrecisionRecall_ign2() // a complex structure, most of which gets ignored.
  {
    LearnerGraph mach = new LearnerGraph(TestFSMAlgo.buildGraph("AM-a->BM-a->AM\nBM-b->CM-a->DM","testPrecisionRecall_ign2"),config);
    PTASequenceEngine engine = new PTA_FSMStructure(mach);
    SequenceSet partialPTA = engine.new SequenceSet();partialPTA.setIdentity();
    partialPTA = partialPTA.cross(TestFSMAlgo.buildSet(new String[][] {
        new String[] {"a","a","a","a","b"}, new String[]{"b"}, new String[]{"a", "b", "c"}, new String[]{"a", "b", "a"}
      }));
    PTA_computePrecisionRecall precComputer = new PTA_computePrecisionRecall(fsm);
    precComputer.crossWith(engine);
    precComputer.crossWith(engine);
View Full Code Here

  @Test
  public final void testPrecisionRecall_ign3() // long test sequence (which does not exist) which is rejected part-way
  {
    LearnerGraph mach = new LearnerGraph(TestFSMAlgo.buildGraph("AM-a->AM-b->AM-c->AM","testPrecisionRecall_ign3"),config);
    PTASequenceEngine engine = new PTA_FSMStructure(mach);
    SequenceSet partialPTA = engine.new SequenceSet();partialPTA.setIdentity();
    partialPTA = partialPTA.cross(TestFSMAlgo.buildSet(new String[][] {
        new String[] {"a","b","b","c","c","d"},
      }));
    PTA_computePrecisionRecall precComputer = new PTA_computePrecisionRecall(fsm);
    precComputer.crossWith(engine);
    precComputer.crossWith(engine);
View Full Code Here

  }
 
  @Test
  public final void test_sequenceSet5_1() // a more complex composition
  {
    SequenceSet seq = en.new SequenceSet();seq.setIdentity();
    seq.cross(TestFSMAlgo.buildList(new String[][] {
        new String[] {"a","b","c"}
    })).crossWithSet(new LinkedList<String>());
    Map<String,String> actual = getDebugDataMap(en,en.new SequenceSet().cross(TestFSMAlgo.buildList(new String[][] {// here the new sequenceSet is empty, hence whatever I do, there should be no changes
        new String[] {"a","b","c","d"},
        new String[] {"c"}
    })));
    vertifyPTA(en, 1, new String[][] {
        new String[] {"a","b","c"}
View Full Code Here

  }

  @Test
  public final void test_sequenceSet5_2() // a more complex composition
  {
    SequenceSet seq = en.new SequenceSet();seq.setIdentity();
    seq.crossWithSequence(Arrays.asList(new String[] {"a","b","c"})).crossWithSet(new LinkedList<String>());
    Map<String,String> actual = getDebugDataMap(en,en.new SequenceSet().cross(TestFSMAlgo.buildList(new String[][] {// here the new sequenceSet is empty, hence whatever I do, there should be no changes
        new String[] {"a","b","c","d"},
        new String[] {"c"}
    })));
    vertifyPTA(en, 1, new String[][] {
        new String[] {"a","b","c"}
View Full Code Here

 
  /** Test for equality of different sequenceSets. */
  @Test
  public final void test_sequenceSet_equality_differentcontainer()
  {
    SequenceSet seqStart1 = en.new SequenceSet();
    SequenceSet seqStart2 = en.new SequenceSet();
    SequenceSet seqDifferent1 = en.new SequenceSet();seqDifferent1.setIdentity();
    PTA_FSMStructure engine2 = new PTA_FSMStructure(fsm);   
    equalityTestingHelper(seqStart1,seqStart2,seqDifferent1,engine2.new SequenceSet());
  }
View Full Code Here

 
  /** Test for equality of different sequenceSets. */
  @Test
  public final void test_sequenceSet_equality0a()
  {
    SequenceSet seqStart1 = en.new SequenceSet();
    SequenceSet seqStart2 = seqStart1.crossWithSequence(Arrays.asList(
        new String[] {"a"}
    ));
    SequenceSet seqDifferent1 = en.new SequenceSet();seqDifferent1.setIdentity();
    SequenceSet seqDifferent2 = en.new SequenceSet();seqDifferent2.setIdentity();seqDifferent2.crossWithSequence(Arrays.asList(
        new String[] {"a"}
    ));
    equalityTestingHelper(seqStart1,seqStart2,seqDifferent1,seqDifferent2);
  }
View Full Code Here

 
  /** Test for equality of different sequenceSets. */
  @Test
  public final void test_sequenceSet_equality0b()
  {
    SequenceSet seqStart1 = en.new SequenceSet();
    SequenceSet seqStart2 = en.new SequenceSet();
    SequenceSet seqDifferent1 = en.new SequenceSet();seqDifferent1.setIdentity();
    SequenceSet seqDifferent2 = en.new SequenceSet();seqDifferent2.setIdentity();seqDifferent2.crossWithSequence(Arrays.asList(
        new String[] {"a"}
    ));
    equalityTestingHelper(seqStart1,seqStart2,seqDifferent1,seqDifferent2);
  }
View Full Code Here

 
  /** Test for equality of different sequenceSets. */
  @Test
  public final void test_sequenceSet_equality0c()
  {
    SequenceSet seqStart1 = en.new SequenceSet();seqStart1.crossWithSequence(Arrays.asList(
        new String[] {"t"}
    ));
    SequenceSet seqStart2 = en.new SequenceSet();seqStart2.crossWithSequence(Arrays.asList(
        new String[] {"t"}
    ));
    SequenceSet seqDifferent1 = en.new SequenceSet();seqDifferent1.setIdentity();
    SequenceSet seqDifferent2 = en.new SequenceSet();seqDifferent2.setIdentity();seqDifferent2.cross(TestFSMAlgo.buildList(new String[][] {
        new String[] {"a"}
       
    }));
    equalityTestingHelper(seqStart1,seqStart2,seqDifferent1,seqDifferent2);
  }
View Full Code Here

 
  /** Test for equality of different sequenceSets. */
  @Test
  public final void test_sequenceSet_equality1()
  {
    SequenceSet seqStart1 = en.new SequenceSet();seqStart1.setIdentity();
    SequenceSet seqStart2 = en.new SequenceSet();seqStart2.setIdentity();
    SequenceSet seqDifferent1 = en.new SequenceSet();
    SequenceSet seqDifferent2 = seqStart1.cross(TestFSMAlgo.buildList(new String[][] {
        new String[] {"a"}
    }));
    equalityTestingHelper(seqStart1,seqStart2,seqDifferent1,seqDifferent2);
  }
View Full Code Here

TOP

Related Classes of statechum.model.testset.PTASequenceEngine.SequenceSet

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.