Package statechum.Helper

Examples of statechum.Helper.whatToRun


    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);
    checkForCorrectException(new whatToRun() { public @Override void run() {
      ProgressDecorator.readLearnerEvaluationConfiguration(loader.expectNextElement(StatechumXML.ELEM_EVALUATIONDATA.name()));
    }}, IllegalArgumentException.class,"duplicate graph");
 
View Full Code Here


    learnerConfig.removeChild(graphToRemove);
   
    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() {
      ProgressDecorator.readLearnerEvaluationConfiguration(loader.expectNextElement(StatechumXML.ELEM_EVALUATIONDATA.name()));
    }}, IllegalArgumentException.class,"missing test set");
 
View Full Code Here

            new String[]{},
            new String[]{"4","46"}})));
    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() {
      ProgressDecorator.readLearnerEvaluationConfiguration(loader.expectNextElement(StatechumXML.ELEM_EVALUATIONDATA.name()));
    }}, IllegalArgumentException.class,"duplicate test set");
 
View Full Code Here

    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() {
      ProgressDecorator.readLearnerEvaluationConfiguration(loader.expectNextElement(StatechumXML.ELEM_EVALUATIONDATA.name()));
    }}, IllegalArgumentException.class,"duplicate configuration");
 
View Full Code Here

    Element learnerConfig = dumper.writeLearnerEvaluationConfiguration(new LearnerEvaluationConfiguration(graph,testData,anotherconfig,ltl,labels));
    learnerConfig.appendChild(labels.storeToXML(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() {
      ProgressDecorator.readLearnerEvaluationConfiguration(loader.expectNextElement(StatechumXML.ELEM_EVALUATIONDATA.name()));
    }}, IllegalArgumentException.class,"duplicate label details");
 
View Full Code Here

 
  @Test
  public void testCreateMarkovMatrixFail()
  {
    Helper.checkForCorrectException(new whatToRun() {
      @SuppressWarnings("unused")
      @Override
      public void run() throws NumberFormatException
      {
        new MarkovModel(1,true,true);
View Full Code Here

  @Test
  public void testCreateMarkovMatrix6()
  {
    final MarkovModel m = new MarkovModel(2,true,true);
    final Set<List<Label>> plusStrings = new HashSet<List<Label>>(), minusStrings = new HashSet<List<Label>>();
    Helper.checkForCorrectException(new whatToRun() {
      @Override
      public void run() throws NumberFormatException
      {
        m.createMarkovLearner(plusStrings, minusStrings,false);
      }
View Full Code Here

  @Test
  public void testCreateMarkovMatrix7()
  {
    final MarkovModel m = new MarkovModel(2,true,true);
    final Set<List<Label>> plusStrings = new HashSet<List<Label>>(), minusStrings = buildSet(new String[][] { new String[]{},new String[]{} },config,converter);
    Helper.checkForCorrectException(new whatToRun() {
      @Override
      public void run() throws NumberFormatException
      {
        m.createMarkovLearner(plusStrings, minusStrings,false);
      }
View Full Code Here

    new MarkovClassifier(m,graph).updateMarkov(false);
    Assert.assertEquals(9+graph.getCache().getAlphabet().size(),m.predictionsMatrix.size());
   
    final LearnerGraph graph2 = FsmParser.buildLearnerGraph("A-a->B","testPredictTransitionsFromStatesWithPathBeyondCurrentState2",config, converter);
   
    Helper.checkForCorrectException(new whatToRun() {
      @Override
      public void run() throws NumberFormatException
      {
        new MarkovClassifier(m, graph2).predictTransitionsFromState(graph2.getInit(),Arrays.asList(new Label[]{lblC}),m.getChunkLen(),null);
      }
View Full Code Here

    final MarkovModel m = new MarkovModel(2,true,true);
    new MarkovClassifier(m,graph).updateMarkov(true);
    Assert.assertEquals(4,m.predictionsMatrix.size());
   
    final LearnerGraph graph2 = FsmParser.buildLearnerGraph("A-d->B / A-c->A/ T-u->T-b->T","testPredictTransitionsFromStatesForward2",config, converter);
    Helper.checkForCorrectException(new whatToRun() {
      @Override
      public void run() throws NumberFormatException
      {
        new MarkovClassifier(m, graph2).predictTransitionsFromState(graph2.findVertex("B"),Arrays.asList(new Label[]{lblA,lblB}),m.getChunkLen(),null);
      }
View Full Code Here

TOP

Related Classes of statechum.Helper.whatToRun

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.