Package statechum.analysis.learning.observers.ProgressDecorator

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


  /** Success. */
  @Test
  public final void testLearnerEvaluation1()
  {
    LearnerSimulator loader = new LearnerSimulator(new ByteArrayInputStream(xmlData.getBytes()),false);
    LearnerEvaluationConfiguration cnf=ProgressDecorator.readLearnerEvaluationConfiguration(loader.expectNextElement(StatechumXML.ELEM_EVALUATIONDATA.name()));
    WMethod.checkM(cnf.graph, graph);
    Assert.assertEquals(testData, cnf.testSet);
    Assert.assertEquals(config, cnf.config);
    Assert.assertEquals(cnf.config, cnf.graph.config);
    Assert.assertEquals(ltl,cnf.ifthenSequences);
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,labels));
    Element configToRemove = (Element)StatechumXML.getChildWithTag(learnerConfig,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(StatechumXML.ELEM_EVALUATIONDATA.name()));
    WMethod.checkM(cnf.graph, graph);
    Assert.assertEquals(testData, cnf.testSet);Assert.assertEquals(anotherconfig, cnf.config);Assert.assertEquals(cnf.config, cnf.graph.config);
    Assert.assertEquals(ltl,cnf.ifthenSequences);
    Assert.assertEquals(labels,cnf.labelDetails);
  }
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,labels));
    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(StatechumXML.ELEM_EVALUATIONDATA.name()));
    WMethod.checkM(cnf.graph, graph);
    Assert.assertEquals(testData, cnf.testSet);
    Assert.assertEquals(config, cnf.config);
    Assert.assertEquals(cnf.config, cnf.graph.config);
    Assert.assertEquals(ltl,cnf.ifthenSequences);
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,labels));
      Element configToRemove = (Element)StatechumXML.getChildWithTag(learnerConfig,StatechumXML.ELEM_CONSTRAINTS.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,labels));
      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(StatechumXML.ELEM_EVALUATIONDATA.name()));
    WMethod.checkM(cnf.graph, graph);
    Assert.assertEquals(testData, cnf.testSet);Assert.assertEquals(anotherconfig, cnf.config);Assert.assertEquals(cnf.config, cnf.graph.config);
    Assert.assertEquals(labels,cnf.labelDetails);
    Assert.assertNull(cnf.ifthenSequences);
  }
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,labels));
      Element configToRemove = (Element)StatechumXML.getChildWithTag(learnerConfig,StatechumXML.ELEM_LABELDETAILS.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,ltl,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(StatechumXML.ELEM_EVALUATIONDATA.name()));
    WMethod.checkM(cnf.graph, graph);
    Assert.assertEquals(testData, cnf.testSet);Assert.assertEquals(anotherconfig, cnf.config);Assert.assertEquals(cnf.config, cnf.graph.config);
    Assert.assertEquals(ltl,cnf.ifthenSequences);
    Assert.assertNull(cnf.labelDetails);
  }
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,labels));
    Element graphToRemove = (Element)StatechumXML.getChildWithTag(learnerConfig,StatechumXML.graphmlNodeNameNS.toString()).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,labels));
    learnerConfig.appendChild(new LearnerGraph(FsmParser.buildGraph("A-a->A", "testLoadInit_fail7"),Configuration.getDefaultConfiguration())
    .storage.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,labels));
    Element graphToRemove = (Element)StatechumXML.getChildWithTag(learnerConfig,StatechumXML.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,labels));
    learnerConfig.appendChild(dumper.writeSequenceList(StatechumXML.ATTR_POSITIVE_SEQUENCES.name(),
        TestFSMAlgo.buildList(new String[][]{
            new String[]{ "t","some test data"},
            new String[]{},
            new String[]{"4","46"}})));
View Full Code Here

  @Test
  public final void testLearnerEvaluation8()
  {
    ByteArrayOutputStream output = new ByteArrayOutputStream();
    RecordProgressDecorator dumper = new RecordProgressDecorator(null,output,1,Configuration.getDefaultConfiguration(),false);
    Element learnerConfig = dumper.writeLearnerEvaluationConfiguration(new LearnerEvaluationConfiguration(graph,testData,anotherconfig,ltl,labels));
    learnerConfig.appendChild(anotherconfig.writeXML(dumper.doc));
    dumper.topElement.appendChild(learnerConfig);dumper.close();xmlData = output.toString();
   
    final LearnerSimulator loader = new LearnerSimulator(new ByteArrayInputStream(xmlData.getBytes()),false);
    checkForCorrectException(new whatToRun() { public @Override void run() {
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.