Package statechum

Examples of statechum.Configuration


  /** Unexpected tag. */
  @Test
  public void testSerialisationFailure2()
  {
    final org.w3c.dom.Element cnf = new Configuration().writeXML(doc);
    cnf.appendChild(doc.createElement("junk"));
    statechum.Helper.checkForCorrectException(new whatToRun() { public void run() {
      new Configuration().readXML(cnf);
    }},IllegalArgumentException.class,"unexpected element");
  }
View Full Code Here


   
  /** Text elements are ignored. */
  @Test
  public void testSerialisationFailure3a()
  {
    final org.w3c.dom.Element cnf = new Configuration().writeXML(doc);
    cnf.appendChild(doc.createTextNode(Configuration.configVarTag));
    Configuration c = new Configuration();c.readXML(cnf);
    Assert.assertEquals(new Configuration(),c);
  }
View Full Code Here

 
  /** Unexpected type of an element. */
  @Test
  public void testSerialisationFailure3b()
  {
    final org.w3c.dom.Element cnf = new Configuration().writeXML(doc);
    cnf.appendChild(doc.createComment(Configuration.configVarTag));
    statechum.Helper.checkForCorrectException(new statechum.Helper.whatToRun() { public void run() {
      new Configuration().readXML(cnf);
    }},IllegalArgumentException.class,"unexpected element");
  }
View Full Code Here

  /** Unexpected element. */
  @Test
  public void testSerialisationFailure4()
  {
    statechum.Helper.checkForCorrectException(new statechum.Helper.whatToRun() { public void run() {
      new Configuration().readXML(doc.createTextNode(Configuration.configXMLTag));
    }},IllegalArgumentException.class,"invalid node type passed to readXML");
  }
View Full Code Here

  /** Unexpected type of an element. */
  @Test
  public void testSerialisationFailure5()
  {
    statechum.Helper.checkForCorrectException(new statechum.Helper.whatToRun() { public void run() {
      new Configuration().readXML(doc.createElement("junk"));
    }},IllegalArgumentException.class,"configuration cannot be loaded from element");
  }
View Full Code Here

        }
      };
 
      RecordProgressDecorator recorder = null;
      java.io.FileOutputStream out = null;
      Configuration progressRecorderConfig = evalData.config.copy();progressRecorderConfig.setCompressLogs(false);
        out = new java.io.FileOutputStream("resources/tmp.xml");
        recorder = new RecordProgressDecorator(learner2,out,1,progressRecorderConfig,true);
      recorder.writeLearnerEvaluationData(evalData);
      learner2.setTopLevelListener(recorder);
      recorder.learnMachine(initial.plus, initial.minus);
View Full Code Here

   
  @SuppressWarnings("null")
  public static void runExperiment() throws Exception
  {
    DrawGraphs gr = new DrawGraphs();
    Configuration config = Configuration.getDefaultConfiguration().copy();config.setAskQuestions(false);config.setDebugMode(false);config.setGdLowToHighRatio(0.7);config.setRandomPathAttemptFudgeThreshold(1000);
    config.setTransitionMatrixImplType(STATETREE.STATETREE_LINKEDHASH);config.setLearnerScoreMode(ScoreMode.COMPATIBILITY);
    ConvertALabel converter = new Transform.InternStringLabel();
    GlobalConfiguration.getConfiguration().setProperty(G_PROPERTIES.LINEARWARNINGS, "false");
    final int ThreadNumber = ExperimentRunner.getCpuNumber()
    ExecutorService executorService = Executors.newFixedThreadPool(ThreadNumber);
    final int minStateNumber = 20;
View Full Code Here

   * @param reference all of the transitions.
   * @return trimmed reference graph
   */
  public static LearnerGraph trimUncoveredTransitions(LearnerGraph pta,LearnerGraph reference)
  {
    Configuration shallowCopy = reference.config.copy();shallowCopy.setLearnerCloneGraph(false);
    LearnerGraph outcome = new LearnerGraph(shallowCopy);AbstractLearnerGraph.copyGraphs(reference, outcome);

    for(Entry<CmpVertex,Set<Label>> entry:identifyUncoveredTransitions(pta, reference).entrySet())
    {
      Map<Label,CmpVertex> map = outcome.transitionMatrix.get(entry.getKey());
View Full Code Here

 
  @SuppressWarnings("null")
  public static void runExperiment() throws Exception
  {
    DrawGraphs gr = new DrawGraphs();
    Configuration config = Configuration.getDefaultConfiguration().copy();config.setAskQuestions(false);config.setDebugMode(false);config.setGdLowToHighRatio(0.7);config.setRandomPathAttemptFudgeThreshold(1000);
    config.setTransitionMatrixImplType(STATETREE.STATETREE_LINKEDHASH);config.setLearnerScoreMode(ScoreMode.COMPATIBILITY);//ONLYOVERRIDE);
    ConvertALabel converter = new Transform.InternStringLabel();
    GlobalConfiguration.getConfiguration().setProperty(G_PROPERTIES.LINEARWARNINGS, "false");
    final int ThreadNumber = ExperimentRunner.getCpuNumber()
    ExecutorService executorService = Executors.newFixedThreadPool(ThreadNumber);
    final int minStateNumber = 20;
View Full Code Here

          assert pta.getStateNumber() == pta.getAcceptStateNumber() : "graph with negatives but onlyUsePositives is set";
       
        LearnerMarkovPassive learnerOfPairs = null;
        LearnerGraph actualAutomaton = null;
       
        final Configuration deepCopy = pta.config.copy();deepCopy.setLearnerCloneGraph(true);
        LearnerGraph ptaCopy = new LearnerGraph(deepCopy);LearnerGraph.copyGraphs(pta, ptaCopy);

        LearnerGraph trimmedReference = MarkovPassivePairSelection.trimUncoveredTransitions(pta,referenceGraph);
       
        final ConsistencyChecker checker = new MarkovClassifier.DifferentPredictionsInconsistencyNoBlacklisting();
View Full Code Here

TOP

Related Classes of statechum.Configuration

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.