Package statechum.analysis.learning.observers.ProgressDecorator

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


        new String[]{"5"}
    });

    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));
    dumper.topElement.appendChild(initElement);dumper.close();
    xmlData = output.toString();
  }
View Full Code Here


  }

  @Test
  public final void createInitialData()
  {
    InitialData data = new InitialData(plus,5,minus,4,graph);
    Assert.assertEquals(5,data.plusSize);Assert.assertEquals(4, data.minusSize);
    Assert.assertSame(plus,data.plus);Assert.assertSame(minus,data.minus);Assert.assertSame(graph,data.graph);
  }
View Full Code Here

 
  @Test
  public final void createInitialData_fail1()
  {
    checkForCorrectException(new whatToRun() { public void run() {
      new InitialData(new LinkedList<List<String>>(),-1,new LinkedList<List<String>>(),0,null);
    }},IllegalArgumentException.class,"inconsistent positive");
  }
View Full Code Here

 
  @Test
  public final void createInitialData_fail2()
  {
    checkForCorrectException(new whatToRun() { public void run() {
      new InitialData(new LinkedList<List<String>>(),0,new LinkedList<List<String>>(),5,null);
    }},IllegalArgumentException.class,"inconsistent negative");
  }
View Full Code Here

  @Test
  public final void testLoadInit1()
  {
    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

        xmlData
        .replace("<"+ELEM_KINDS.ATTR_POSITIVE_SIZE.name(), "<"+ELEM_KINDS.ATTR_POSITIVE_SIZE.name()+" AA=\"34\" ")
        .replace("<"+ELEM_KINDS.ATTR_NEGATIVE_SIZE.name(), "<"+ELEM_KINDS.ATTR_NEGATIVE_SIZE.name()+" AB=\"TT\" ")
        .getBytes()),false);
    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

  @Test
  public final void testLoadInit_fail2()
  {
    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));
    Element positiveToRemove = (Element)initElement.getElementsByTagName(ELEM_KINDS.ELEM_SEQ.name()).item(0);
    initElement.removeChild(positiveToRemove);
    dumper.topElement.appendChild(initElement);dumper.close();
    xmlData = output.toString();
View Full Code Here

  @Test
  public final void testLoadInit_fail3()
  {
    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(dumper.writeSequenceList(ELEM_KINDS.ATTR_POSITIVE_SEQUENCES.name(), justSomething));
    dumper.topElement.appendChild(initElement);dumper.close();
    xmlData = output.toString();

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

  @Test
  public final void testLoadInit_fail4()
  {
    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));
    Element negativeToRemove = (Element)initElement.getElementsByTagName(ELEM_KINDS.ELEM_SEQ.name()).item(1);// the second one
    initElement.removeChild(negativeToRemove);
    dumper.topElement.appendChild(initElement);dumper.close();
    xmlData = output.toString();
View Full Code Here

  @Test
  public final void testLoadInit_fail5()
  {
    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(dumper.writeSequenceList(ELEM_KINDS.ATTR_NEGATIVE_SEQUENCES.name(), justSomething));
    dumper.topElement.appendChild(initElement);dumper.close();
    xmlData = output.toString();

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

TOP

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

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.