Package statechum.analysis.learning.experiments.PaperUAS

Examples of statechum.analysis.learning.experiments.PaperUAS.TracesForSeed


  @Test
  public void testLoad3d()
  {
    Assert.assertTrue(paper.collectionOfTraces.isEmpty());
    paper.loadData(new StringReader("0,AA,4,  "));
    TracesForSeed tr = paper.collectionOfTraces.get("4");
   
    // two special UAVs, collecting all traces in a specific seed and the one collecting traces across seeds.
    Assert.assertEquals(3,tr.tracesForUAVandFrame.size());
    Assert.assertEquals(3,tr.tracesForUAVandFrame.size());
    Assert.assertEquals(1,constructCollectionOfTraces(tr.tracesForUAVandFrame.get("AA"),true).size());
View Full Code Here


  @Test
  public void testLoad3g()
  {
    Assert.assertTrue(paper.collectionOfTraces.isEmpty());
    paper.loadData(new StringReader("0,UAV3,4, + [[aa]]"));
    TracesForSeed tr = paper.collectionOfTraces.get("4");
    Map<Integer,Set<List<Label>>> uav3Positive = constructCollectionOfTraces(tr.tracesForUAVandFrame.get("UAV3"),true);
    Assert.assertEquals(1,uav3Positive.size());
    Assert.assertTrue(TestFSMAlgo.buildSet(new String[][]{new String[]{"aa"}}, mainConfiguration,converter).equals(
        uav3Positive.get(0)));
    Map<Integer,Set<List<Label>>> uav3Negative= constructCollectionOfTraces(tr.tracesForUAVandFrame.get("UAV3"),false);
View Full Code Here

  /** Both positive and negative traces. */
  @Test
  public void testLoad4()
  {
    paper.loadData(new StringReader("0,UAV3,4, + [[aa],[bb,cc]] - [[zz]]"));
    TracesForSeed tr = paper.collectionOfTraces.get("4");
    Map<Integer,Set<List<Label>>> uav3Positive = constructCollectionOfTraces(tr.tracesForUAVandFrame.get("UAV3"),true);
    Assert.assertEquals(1,uav3Positive.size());
    Assert.assertTrue(TestFSMAlgo.buildSet(new String[][]{new String[]{"aa"},new String[]{"bb","cc"}}, mainConfiguration,converter).equals(
        uav3Positive.get(0)));
    Map<Integer,Set<List<Label>>> uav3Negative = constructCollectionOfTraces(tr.tracesForUAVandFrame.get("UAV3"),false);
View Full Code Here

  {
    paper.loadData(new StringReader("0,UAV3,4, + [[aa],[bb,cc]] - [[zz]]\n"+
        "0,UAV55,4, - [[Faa],[bb,Fcc]]\n"+
        "1,UAV3,4, + [[Taa],[bb,cc]] - [[Tzz]]\n"
    ));
    TracesForSeed tr = paper.collectionOfTraces.get("4");
    Map<Integer,Set<List<Label>>> uav3Positive = constructCollectionOfTraces(tr.tracesForUAVandFrame.get("UAV3"),true);
    Assert.assertEquals(2,uav3Positive.size());
    Assert.assertTrue(TestFSMAlgo.buildSet(new String[][]{new String[]{"aa"},new String[]{"bb","cc"}}, mainConfiguration,converter).equals(
        uav3Positive.get(0)));
    Assert.assertTrue(TestFSMAlgo.buildSet(new String[][]{new String[]{"aa"},new String[]{"Taa"},new String[]{"bb","cc"}}, mainConfiguration,converter).equals(
View Full Code Here

    paper.loadData(new StringReader("0,UAV3,4, + [[aa],[bb,cc]] - [[zz]]\n"+
        "0,UAV55,4, - [[Faa],[bb,Fcc]]\n"+
        "1,UAV3,4, + [[Taa],[bb,cc]] - [[Tzz]]\n"+
        "0,UAV55,4, + [[qq]]\n"
    ));
    TracesForSeed tr = paper.collectionOfTraces.get("4");
    Map<Integer,Set<List<Label>>> uav55Positive = constructCollectionOfTraces(tr.tracesForUAVandFrame.get("UAV55"),true);
    Map<Integer,Set<List<Label>>> uav55Negative = constructCollectionOfTraces(tr.tracesForUAVandFrame.get("UAV55"),false);
    Assert.assertEquals(2,uav55Negative.size());
    Assert.assertEquals(2,uav55Positive.size());
    Assert.assertTrue(TestFSMAlgo.buildSet(new String[][]{new String[]{"qq"}}, mainConfiguration,converter).equals(
View Full Code Here

        "0,UAV55,4, - [[Faa],[bb,Fcc]]\n"+
        "1,UAV3,4, + [[Taa],[bb,cc]] - [[Tzz]]\n"+
        "0,UAV55,4, + [[qq]]\n"+
        "2,UAV3,4, + [[anotherOne]]"
    ));
    TracesForSeed tr = paper.collectionOfTraces.get("4");
    Map<Integer,Set<List<Label>>> uav55Positive = constructCollectionOfTraces(tr.tracesForUAVandFrame.get("UAV55"),true);
    Map<Integer,Set<List<Label>>> uav55Negative = constructCollectionOfTraces(tr.tracesForUAVandFrame.get("UAV55"),false);
    Assert.assertEquals(3,uav55Negative.size());
    Assert.assertEquals(3,uav55Positive.size());
    Assert.assertTrue(TestFSMAlgo.buildSet(new String[][]{new String[]{"qq"}}, mainConfiguration,converter).equals(
View Full Code Here

        "0,UAV55,4, - [[Faa],[bb]]\n"+
        "0,UAV3,SEED2, + [[Taa]]\n"+
        "1,UAV55,4, + [[qq]]\n"+
        "1,UAV3,SEED2, + [[anotherOne]]"
    ));
    TracesForSeed tr4 = paper.collectionOfTraces.get("4");
    Map<Integer,Set<List<Label>>> uav3Positive4 = constructCollectionOfTraces(tr4.tracesForUAVandFrame.get("UAV3"),true);
    Map<Integer,Set<List<Label>>> uav3Negative4 = constructCollectionOfTraces(tr4.tracesForUAVandFrame.get("UAV3"),false);
    Assert.assertTrue(TestFSMAlgo.buildSet(new String[][]{new String[]{"aa"}}, mainConfiguration,converter).equals(
        uav3Positive4.get(0)));
    Assert.assertTrue(TestFSMAlgo.buildSet(new String[][]{new String[]{"aa"}}, mainConfiguration,converter).equals(
        uav3Positive4.get(1)));
    Assert.assertTrue(uav3Negative4.get(0).isEmpty());
    Assert.assertTrue(uav3Negative4.get(1).isEmpty());
    Map<Integer,Set<List<Label>>> uav55Positive4 = constructCollectionOfTraces(tr4.tracesForUAVandFrame.get("UAV55"),true);
    Map<Integer,Set<List<Label>>> uav55Negative4 = constructCollectionOfTraces(tr4.tracesForUAVandFrame.get("UAV55"),false);
    Assert.assertTrue(uav55Positive4.get(0).isEmpty());
    Assert.assertTrue(TestFSMAlgo.buildSet(new String[][]{new String[]{"qq"}}, mainConfiguration,converter).equals(
        uav55Positive4.get(1)));
    Assert.assertTrue(TestFSMAlgo.buildSet(new String[][]{new String[]{"Faa"},new String[]{"bb"}}, mainConfiguration,converter).equals(
        uav55Negative4.get(0)));
    Assert.assertTrue(TestFSMAlgo.buildSet(new String[][]{new String[]{"Faa"},new String[]{"bb"}}, mainConfiguration,converter).equals(
        uav55Negative4.get(1)));
 
    TracesForSeed tr2 = paper.collectionOfTraces.get("SEED2");
    Map<Integer,Set<List<Label>>> uav3Positive2 = constructCollectionOfTraces(tr2.tracesForUAVandFrame.get("UAV3"),true);
    Map<Integer,Set<List<Label>>> uav3Negative2 = constructCollectionOfTraces(tr2.tracesForUAVandFrame.get("UAV3"),false);
    Assert.assertTrue(TestFSMAlgo.buildSet(new String[][]{new String[]{"Taa"}}, mainConfiguration,converter).equals(
        uav3Positive2.get(0)));
    Assert.assertTrue(TestFSMAlgo.buildSet(new String[][]{new String[]{"Taa"},new String[]{"anotherOne"}}, mainConfiguration,converter).equals(
        uav3Positive2.get(1)));
    Assert.assertTrue(uav3Negative2.get(0).isEmpty());
    Assert.assertTrue(uav3Negative2.get(1).isEmpty());
   
    Map<Integer,Set<List<Label>>> uav55Positive2 = constructCollectionOfTraces(tr2.tracesForUAVandFrame.get("UAV55"),true);
    Map<Integer,Set<List<Label>>> uav55Negative2 = constructCollectionOfTraces(tr2.tracesForUAVandFrame.get("UAV55"),false);
    Assert.assertTrue(TestFSMAlgo.buildSet(new String[][]{new String[]{}}, mainConfiguration,converter).equals(uav55Positive2.get(0)));
    Assert.assertTrue(TestFSMAlgo.buildSet(new String[][]{new String[]{}}, mainConfiguration,converter).equals(uav55Positive2.get(1)));
    Assert.assertTrue(uav55Negative2.get(0).isEmpty());
    Assert.assertTrue(uav55Negative2.get(1).isEmpty());
   
    TracesForSeed trAll = paper.collectionOfTraces.get(PaperUAS.UAVAllSeeds);
    Assert.assertEquals(4,trAll.tracesForUAVandFrame.size());
    Map<Integer,Set<List<Label>>> uavAllPositiveAll = constructCollectionOfTraces(trAll.tracesForUAVandFrame.get(PaperUAS.UAVAllSeeds),true);
    Map<Integer,Set<List<Label>>> uavAllNegativeAll = constructCollectionOfTraces(trAll.tracesForUAVandFrame.get(PaperUAS.UAVAllSeeds),false);
    Assert.assertTrue(TestFSMAlgo.buildSet(new String[][]{new String[]{"aa"},new String[]{"Taa"}}, mainConfiguration,converter).equals(
        uavAllPositiveAll.get(0)));
View Full Code Here

  @Test
  public void testLoadByConcatenationFail5()
  {
    paper.loadDataByConcatenation(new Reader[]{new StringReader("0,UAV55,4, - [[Faa],[bb]]\n"
      )});
    TracesForSeed tr4 = paper.collectionOfTraces.get("4");
    Map<Integer,Set<List<Label>>> uav55Positive4 = constructCollectionOfTraces(tr4.tracesForUAVandFrame.get("UAV55"),true);
    Map<Integer,Set<List<Label>>> uav55Negative4 = constructCollectionOfTraces(tr4.tracesForUAVandFrame.get("UAV55"),false);
    Assert.assertTrue(TestFSMAlgo.buildSet(new String[][]{}, mainConfiguration,converter).equals(
        uav55Positive4.get(0)));// since there are no positive traces at all, this set is empty. It would usually contain an empty sequence.
    Assert.assertTrue(TestFSMAlgo.buildSet(new String[][]{new String[]{"Faa"},new String[]{"bb"}}, mainConfiguration,converter).equals(
View Full Code Here

        "0,UAV55,4, - [[Faa],[bb]]\n"+
        "0,UAV3,SEED2, + [[aa,bb,cc,aa]]\n"+
        "1,UAV55,4, + [[qq,aa,qq]]\n"+
        "1,UAV3,SEED2, + [[aa,gg,aa]]"
    )});
    TracesForSeed tr4 = paper.collectionOfTraces.get("4");
    {
      Map<Integer,Set<List<Label>>> uav3Positive4 = constructCollectionOfTraces(tr4.tracesForUAVandFrame.get("UAV3"),true);
      Map<Integer,Set<List<Label>>> uav3Negative4 = constructCollectionOfTraces(tr4.tracesForUAVandFrame.get("UAV3"),false);
      Assert.assertTrue(TestFSMAlgo.buildSet(new String[][]{new String[]{"aa","aa"}}, mainConfiguration,converter).equals(
          uav3Positive4.get(0)));
      Assert.assertTrue(TestFSMAlgo.buildSet(new String[][]{new String[]{"aa","aa"}}, mainConfiguration,converter).equals(
          uav3Positive4.get(1)));
      Assert.assertTrue(TestFSMAlgo.buildSet(new String[][]{}, mainConfiguration,converter).equals(
          uav3Negative4.get(0)));
      Assert.assertTrue(TestFSMAlgo.buildSet(new String[][]{}, mainConfiguration,converter).equals(
          uav3Negative4.get(1)));
    }
    {
      Map<Integer,Set<List<Label>>> uav55Positive4 = constructCollectionOfTraces(tr4.tracesForUAVandFrame.get("UAV55"),true);
      Map<Integer,Set<List<Label>>> uav55Negative4 = constructCollectionOfTraces(tr4.tracesForUAVandFrame.get("UAV55"),false);
      Assert.assertTrue(TestFSMAlgo.buildSet(new String[][]{}, mainConfiguration,converter).equals(
          uav55Positive4.get(0)));
      Assert.assertTrue(TestFSMAlgo.buildSet(new String[][]{new String[]{"qq","aa","qq"}}, mainConfiguration,converter).equals(
          uav55Positive4.get(1)));
      Assert.assertTrue(TestFSMAlgo.buildSet(new String[][]{new String[]{"Faa"}, new String[]{"bb"}}, mainConfiguration,converter).equals(
          uav55Negative4.get(0)));
      Assert.assertTrue(TestFSMAlgo.buildSet(new String[][]{new String[]{"Faa"}, new String[]{"bb"}}, mainConfiguration,converter).equals(
          uav55Negative4.get(1)));
    }
   
    TracesForSeed tr2 = paper.collectionOfTraces.get("SEED2");
    {
      Map<Integer,Set<List<Label>>> uav3Positive2 = constructCollectionOfTraces(tr2.tracesForUAVandFrame.get("UAV3"),true);
      Map<Integer,Set<List<Label>>> uav3Negative2 = constructCollectionOfTraces(tr2.tracesForUAVandFrame.get("UAV3"),false);
      Assert.assertTrue(TestFSMAlgo.buildSet(new String[][]{new String[]{"aa","bb","cc","aa"}}, mainConfiguration,converter).equals(
          uav3Positive2.get(0)));
View Full Code Here

        "0,UAV3,4, + [[aa,bb,cc,aa]]\n"+
        "0,UAV3,4, - [[nn,rr]]\n"+
        "1,UAV3,4, + [[aa,gg,aa]]\n"+
        "1,UAV3,4, - [[Rnn,Rrr]]\n"
    )});
    TracesForSeed tr4 = paper.collectionOfTraces.get("4");
    {
      Map<Integer,Set<List<Label>>> uav3Positive4 = constructCollectionOfTraces(tr4.tracesForUAVandFrame.get("UAV3"),true);
      Map<Integer,Set<List<Label>>> uav3Negative4 = constructCollectionOfTraces(tr4.tracesForUAVandFrame.get("UAV3"),false);
      Assert.assertTrue(TestFSMAlgo.buildSet(new String[][]{new String[]{"aa", "aa", "bb", "cc", "aa"}}, mainConfiguration,converter).equals(// positive traces are not prefixes of negatives and are thus are included
          uav3Positive4.get(0)));
View Full Code Here

TOP

Related Classes of statechum.analysis.learning.experiments.PaperUAS.TracesForSeed

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.