Package statechum.analysis.learning.observers.ProgressDecorator

Examples of statechum.analysis.learning.observers.ProgressDecorator.LearnerEvaluationConfiguration


          }
        }
      }
      while(pickUniqueFromInitial && uniqueFromInitial == null);
     
      LearnerEvaluationConfiguration learnerEval = new LearnerEvaluationConfiguration(config);learnerEval.setLabelConverter(converter);
      final Collection<List<Label>> testSet = null;//PaperUAS.computeEvaluationSet(referenceGraph,states*3,states*alphabet);
     
      for(int attempt=0;attempt<2;++attempt)
      {// try learning the same machine a few times
        LearnerGraph pta = new LearnerGraph(config);
View Full Code Here


        "ltl ![]((initialise) -> X(connect))",
        "ltl !(XX(initialise))" });
    ByteArrayOutputStream output = new ByteArrayOutputStream();
    RecordProgressDecorator dumper = new RecordProgressDecorator(null,output,1,Configuration.getDefaultConfiguration(),false);
    dumper.topElement.appendChild(dumper.writeLearnerEvaluationConfiguration(
        new LearnerEvaluationConfiguration(graph,testData,config,ltl)));dumper.close();
   
    xmlData = output.toString();
  }
View Full Code Here

  /** Success. */
  @Test
  public final void testLearnerEvaluation1()
  {
    LearnerSimulator loader = new LearnerSimulator(new ByteArrayInputStream(xmlData.getBytes()),false);
    LearnerEvaluationConfiguration cnf=ProgressDecorator.readLearnerEvaluationConfiguration(loader.expectNextElement(ELEM_KINDS.ELEM_EVALUATIONDATA.name()));
    TestFSMAlgo.checkM(new FSMStructure(cnf.graph,null), new FSMStructure(graph,null));
    Assert.assertEquals(testData, cnf.testSet);
    Assert.assertEquals(config, cnf.config);
    Assert.assertEquals(ltl,cnf.ltlSequences);
  }
View Full Code Here

  @Test
  public final void testLearnerEvaluation2()
  {
    ByteArrayOutputStream output = new ByteArrayOutputStream();
    RecordProgressDecorator dumper = new RecordProgressDecorator(null,output,1,Configuration.getDefaultConfiguration(),false);
    Element learnerConfig = dumper.writeLearnerEvaluationConfiguration(new LearnerEvaluationConfiguration(graph,testData,anotherconfig,ltl));
    Element configToRemove = (Element)learnerConfig.getElementsByTagName(Configuration.configXMLTag).item(0);
    learnerConfig.removeChild(configToRemove);
   
    dumper.topElement.appendChild(learnerConfig);dumper.close();xmlData = output.toString();
   
    LearnerSimulator loader = new LearnerSimulator(new ByteArrayInputStream(xmlData.getBytes()),false);
    LearnerEvaluationConfiguration cnf=ProgressDecorator.readLearnerEvaluationConfiguration(loader.expectNextElement(ELEM_KINDS.ELEM_EVALUATIONDATA.name()));
    TestFSMAlgo.checkM(new FSMStructure(cnf.graph,null), new FSMStructure(graph,null));
    Assert.assertEquals(testData, cnf.testSet);Assert.assertEquals(anotherconfig, cnf.config);
    Assert.assertEquals(ltl,cnf.ltlSequences);
  }
View Full Code Here

  @Test
  public final void testLearnerEvaluation9()
  {
    ByteArrayOutputStream output = new ByteArrayOutputStream();
    RecordProgressDecorator dumper = new RecordProgressDecorator(null,output,1,Configuration.getDefaultConfiguration(),false);
    Element learnerConfig = dumper.writeLearnerEvaluationConfiguration(new LearnerEvaluationConfiguration(graph,testData,config,ltl));
    learnerConfig.appendChild(dumper.doc.createElement("junk"));
    dumper.topElement.appendChild(learnerConfig);dumper.close();xmlData = output.toString();
   
    final LearnerSimulator loader = new LearnerSimulator(new ByteArrayInputStream(xmlData.getBytes()),false);
    LearnerEvaluationConfiguration cnf=ProgressDecorator.readLearnerEvaluationConfiguration(loader.expectNextElement(ELEM_KINDS.ELEM_EVALUATIONDATA.name()));
    TestFSMAlgo.checkM(new FSMStructure(cnf.graph,null), new FSMStructure(graph,null));
    Assert.assertEquals(testData, cnf.testSet);
    Assert.assertEquals(config, cnf.config);
    Assert.assertEquals(ltl,cnf.ltlSequences);
 
View Full Code Here

  {
    String anotherXML = null;
    {
      ByteArrayOutputStream output = new ByteArrayOutputStream();
      RecordProgressDecorator dumper = new RecordProgressDecorator(null,output,1,Configuration.getDefaultConfiguration(),false);
      Element learnerConfig = dumper.writeLearnerEvaluationConfiguration(new LearnerEvaluationConfiguration(graph,testData,anotherconfig,ltl));
      Element configToRemove = (Element)learnerConfig.getElementsByTagName(ELEM_KINDS.ELEM_LTL.name()).item(0);
      org.w3c.dom.Node crlf = configToRemove.getNextSibling();
      learnerConfig.removeChild(configToRemove);learnerConfig.removeChild(crlf);
     
      dumper.topElement.appendChild(learnerConfig);dumper.close();xmlData = output.toString();
    }

    {
      ByteArrayOutputStream output = new ByteArrayOutputStream();
      RecordProgressDecorator dumper = new RecordProgressDecorator(null,output,1,Configuration.getDefaultConfiguration(),false);
      Element learnerConfig = dumper.writeLearnerEvaluationConfiguration(new LearnerEvaluationConfiguration(graph,testData,anotherconfig,null));
      dumper.topElement.appendChild(learnerConfig);dumper.close();anotherXML = output.toString();
    }
    Assert.assertEquals(anotherXML,xmlData);
   
    LearnerSimulator loader = new LearnerSimulator(new ByteArrayInputStream(xmlData.getBytes()),false);
    LearnerEvaluationConfiguration cnf=ProgressDecorator.readLearnerEvaluationConfiguration(loader.expectNextElement(ELEM_KINDS.ELEM_EVALUATIONDATA.name()));
    TestFSMAlgo.checkM(new FSMStructure(cnf.graph,null), new FSMStructure(graph,null));
    Assert.assertEquals(testData, cnf.testSet);Assert.assertEquals(anotherconfig, cnf.config);
    Assert.assertNull(cnf.ltlSequences);
  }
View Full Code Here

  @Test
  public final void testLearnerEvaluation4()
  {
    ByteArrayOutputStream output = new ByteArrayOutputStream();
    RecordProgressDecorator dumper = new RecordProgressDecorator(null,output,1,Configuration.getDefaultConfiguration(),false);
    Element learnerConfig = dumper.writeLearnerEvaluationConfiguration(new LearnerEvaluationConfiguration(graph,testData,anotherconfig,ltl));
    Element graphToRemove = (Element)learnerConfig.getElementsByTagName(Transform322.graphmlNodeName).item(0);
    learnerConfig.removeChild(graphToRemove);
   
    dumper.topElement.appendChild(learnerConfig);dumper.close();xmlData = output.toString();
   
View Full Code Here

  @Test
  public final void testLearnerEvaluation5()
  {
    ByteArrayOutputStream output = new ByteArrayOutputStream();
    RecordProgressDecorator dumper = new RecordProgressDecorator(null,output,1,Configuration.getDefaultConfiguration(),false);
    Element learnerConfig = dumper.writeLearnerEvaluationConfiguration(new LearnerEvaluationConfiguration(graph,testData,anotherconfig,ltl));
    learnerConfig.appendChild(new FSMStructure(TestFSMAlgo.buildGraph("A-a->A", "testLoadInit_fail7"),Configuration.getDefaultConfiguration())
    .transform322.createGraphMLNode(dumper.doc));
    dumper.topElement.appendChild(learnerConfig);dumper.close();xmlData = output.toString();
   
    final LearnerSimulator loader = new LearnerSimulator(new ByteArrayInputStream(xmlData.getBytes()),false);
View Full Code Here

  @Test
  public final void testLearnerEvaluation6()
  {
    ByteArrayOutputStream output = new ByteArrayOutputStream();
    RecordProgressDecorator dumper = new RecordProgressDecorator(null,output,1,Configuration.getDefaultConfiguration(),false);
    Element learnerConfig = dumper.writeLearnerEvaluationConfiguration(new LearnerEvaluationConfiguration(graph,testData,anotherconfig,ltl));
    Element graphToRemove = (Element)learnerConfig.getElementsByTagName(ELEM_KINDS.ELEM_SEQ.name()).item(0);
    learnerConfig.removeChild(graphToRemove);
   
    dumper.topElement.appendChild(learnerConfig);dumper.close();xmlData = output.toString();
   
View Full Code Here

  @Test
  public final void testLearnerEvaluation7()
  {
    ByteArrayOutputStream output = new ByteArrayOutputStream();
    RecordProgressDecorator dumper = new RecordProgressDecorator(null,output,1,Configuration.getDefaultConfiguration(),false);
    Element learnerConfig = dumper.writeLearnerEvaluationConfiguration(new LearnerEvaluationConfiguration(graph,testData,anotherconfig,ltl));
    learnerConfig.appendChild(dumper.writeSequenceList(ELEM_KINDS.ATTR_POSITIVE_SEQUENCES.name(),
        TestFSMAlgo.buildList(new String[][]{
            new String[]{ "t","some test data"},
            new String[]{},
            new String[]{"4","46"}})));
View Full Code Here

TOP

Related Classes of statechum.analysis.learning.observers.ProgressDecorator.LearnerEvaluationConfiguration

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.