Package statechum.analysis.learning.TestFSMAlgo

Examples of statechum.analysis.learning.TestFSMAlgo.FSMStructure


    LearnerSimulator loader = new LearnerSimulator(new ByteArrayInputStream(xmlData.getBytes()),false);
    loader.config = Configuration.getDefaultConfiguration();
    InitialData data=loader.readInitialData(loader.expectNextElement(ELEM_KINDS.ELEM_INIT.name()));
    Assert.assertEquals(plus.size(),data.plusSize);Assert.assertEquals(minus.size(), data.minusSize);
    Assert.assertEquals(plus,data.plus);Assert.assertEquals(minus,data.minus);
    TestFSMAlgo.checkM(new FSMStructure(graph,null),new FSMStructure(data.graph,null));
    Assert.assertEquals(graph.getVertices().size(), data.graph.getVertices().size());
  }
View Full Code Here


    loader.config = Configuration.getDefaultConfiguration();
    InitialData data=loader.readInitialData(loader.expectNextElement(ELEM_KINDS.ELEM_INIT.name()));
    loader.config = Configuration.getDefaultConfiguration();
    Assert.assertEquals(plus.size(),data.plusSize);Assert.assertEquals(minus.size(), data.minusSize);
    Assert.assertEquals(plus,data.plus);Assert.assertEquals(minus,data.minus);
    TestFSMAlgo.checkM(new FSMStructure(graph,null),new FSMStructure(data.graph,null));
    Assert.assertEquals(graph.getVertices().size(), data.graph.getVertices().size());
  }
View Full Code Here

  public final void testLoadInit_fail7()
  {
    ByteArrayOutputStream output = new ByteArrayOutputStream();
    RecordProgressDecorator dumper = new RecordProgressDecorator(null,output,1,Configuration.getDefaultConfiguration(),false);
    Element initElement = dumper.writeInitialData(new InitialData(plus,plus.size(),minus,minus.size(),graph));
    initElement.appendChild(new FSMStructure(TestFSMAlgo.buildGraph("A-a->A", "testLoadInit_fail7"),Configuration.getDefaultConfiguration())
      .transform322.createGraphMLNode(dumper.doc));
    dumper.topElement.appendChild(initElement);dumper.close();
    xmlData = output.toString();

    final LearnerSimulator loader = new LearnerSimulator(new ByteArrayInputStream(xmlData.getBytes()),false);
View Full Code Here

      dg.getEdgeConstraints().clear();
      dg = (DirectedSparseGraph)graphmlFile.load(wholePath+args[1]);
      int size = dg.getEdges().size()*4;
    RandomPathGenerator rpg = new RandomPathGenerator(dg, new Random(1),size, 5);
    Collection<List<String>> fullSet = rpg.getAllPaths();
    final FSMStructure expected = getGraphData(dg);
   
    RPNIBlueFringeLearnerTestComponentOpt l = new RPNIBlueFringeLearnerTestComponentOpt(null) // CHOOSE non-Opt for original version
    {
      protected int checkWithEndUser(DirectedSparseGraph model,List<String> question, final Object [] moreOptions)
      {
View Full Code Here

   * @return the class storing transition information.
   */
  public static FSMStructure getGraphData(Graph g)
  {
    Iterator<DirectedSparseEdge> edgeIt = (Iterator<DirectedSparseEdge>)g.getEdges().iterator();
    FSMStructure extractedFSM = new FSMStructure();
    while(edgeIt.hasNext())
    {
      DirectedSparseEdge edge = edgeIt.next();
      Vertex fromVertex = edge.getSource(), toVertex = edge.getDest();
      String from = (String)fromVertex.getUserDatum(JUConstants.LABEL),
View Full Code Here

  }
 
  @Test
  public final void test_1()
  {
    FSMStructure mach = WMethod.getGraphData(TestFSMAlgo.buildGraph("A-a->A-b-#B","tmp graph"));
    PTATestSequenceEngine engine = new PTA_FSMStructure(mach);
    sequenceSet partialPTA = engine.new sequenceSet();partialPTA.setIdentity();
    partialPTA = partialPTA.cross(TestFSMAlgo.buildSet(new String[][] {
        new String[] {"a","a","a"}, new String[]{"b"}
      }));
View Full Code Here

  }

  @Test
  public final void test_2()
  {
    FSMStructure mach = WMethod.getGraphData(TestFSMAlgo.buildGraph("A-a->A-b-#B","tmp graph"));
    PTATestSequenceEngine engine = new PTA_FSMStructure(mach);
    sequenceSet partialPTA = engine.new sequenceSet();partialPTA.setIdentity();
    partialPTA = partialPTA.cross(TestFSMAlgo.buildSet(new String[][] {
        new String[] {"a","a","a"}, new String[]{"b"}, new String[]{"a", "b"}
      }));
View Full Code Here

  }

  @Test
  public final void test_3()
  {
    FSMStructure mach = WMethod.getGraphData(TestFSMAlgo.buildGraph("A-a->A-b-#B","tmp graph"));
    PTATestSequenceEngine 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"}
      }));
View Full Code Here

  }

  @Test
  public final void test_4()
  {
    FSMStructure mach = WMethod.getGraphData(TestFSMAlgo.buildGraph("AM-a->BM-a->AM\nBM-b->CM-a->DM","tmp graph"));
    PTATestSequenceEngine 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"}
      }));
View Full Code Here

  }

  @Test
  public final void test_5() // long test sequence (which exists) which is rejected part-way
  {
    FSMStructure mach = WMethod.getGraphData(TestFSMAlgo.buildGraph("AM-a->AM-b->AM-c->AM","tmp graph"));
    PTATestSequenceEngine 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"},
      }));
View Full Code Here

TOP

Related Classes of statechum.analysis.learning.TestFSMAlgo.FSMStructure

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.