Package statechum

Examples of statechum.Configuration


  public final void testChooseStatePairs(String fsm, String [] initialReds, String [][] expectedReds, List<PairScore> expectedPairs, String graphName)
  {
    final DirectedSparseGraph gB = FsmParser.buildGraph(fsm, graphName);
    //Visualiser.updateFrame(new LearnerGraph(gB,Configuration.getDefaultConfiguration()), null);Visualiser.waitForKey();
    // check how the reference pair selection function performs
    Configuration conf = testConfig.copy();conf.setLearnerUseStrings(false);conf.setLearnerCloneGraph(false);
    testChooseStatePairsInternal(gB,new LearnerGraph(gB, conf), initialReds, expectedReds, expectedPairs, new InterfaceChooserToTest() {
      public @Override Stack<StatePair> choosePairs() {// Here I need to convert the old type of pairs to the new one.
        Stack<OrigStatePair> pairs = chooseStatePairs(gB, new HashSet<List<String>>(), new HashSet<List<String>>());
        Stack<StatePair> result = new Stack<StatePair>();
        for(OrigStatePair pair:pairs) result.add(new StatePair((CmpVertex)pair.getQ(),(CmpVertex)pair.getR()));
View Full Code Here


  @Test
  public void testAuto0()
  {
    //Visualiser.updateFrame(new LearnerGraph(FsmParser.buildGraph("A-e->A-c->B-b->C-p->G-e->A\nB-a->D-a->E-a->D\nE-b->F-p->G\n"+
    //"B-e->A\nC-e->A\nD-e->A\nE-e->A\nF-e->A\nG-e->A\n","testAutoAnswers0"),Configuration.getDefaultConfiguration()),null);
    Configuration testConfig = Configuration.getDefaultConfiguration().copy();
    testConfig.setGdFailOnDuplicateNames(false);
    testConfig.setLearnerIdMode(IDMode.POSITIVE_NEGATIVE);

    RPNILearner learner = new RPNIUniversalLearner(null,new LearnerEvaluationConfiguration(null,null,testConfig,null,null))
    {
      @Override
      public Pair<Integer,String> CheckWithEndUser(
View Full Code Here

 
 
  @Test
  public void testAuto1()
  {
    Configuration testConfig = Configuration.getDefaultConfiguration().copy();
    testConfig.setGdFailOnDuplicateNames(false);
    testConfig.setLearnerIdMode(IDMode.POSITIVE_NEGATIVE);

    final AutoAnswers semiUser = new AutoAnswers(null);
    semiUser.loadAnswers(new StringReader(
        partA
    ));
View Full Code Here

  }
 
  @Test
  public void testAuto2()
  {
    Configuration testConfig = Configuration.getDefaultConfiguration().copy();
    testConfig.setGdFailOnDuplicateNames(false);
    testConfig.setLearnerIdMode(IDMode.POSITIVE_NEGATIVE);

    RPNILearner learner = new RPNIUniversalLearner(null,new LearnerEvaluationConfiguration(null,null,testConfig,null,null))
    {
      @Override
      public Pair<Integer,String> CheckWithEndUser(
View Full Code Here

                          if (command.equals(msgDisplayFSM) && message.arity() >= 4)
                          {
                            OtpErlangObject outcome = null;
                            try
                            {
                              Configuration config = Configuration.getDefaultConfiguration().copy();
                              LearnerGraphND machine = new LearnerGraphND(config);Synapse.StatechumProcess.parseStatemachine(message.elementAt(2),machine,null,true);
                              DirectedSparseGraph fsmPicture = machine.pathroutines.getGraph();
                              if (!fsmPicture.containsUserDatumKey(JUConstants.LAYOUTOPTIONS))
                                fsmPicture.addUserDatum(JUConstants.LAYOUTOPTIONS,new LayoutOptions(), UserData.SHARED);
                              int windowNumber = setOptions(message,3,fsmPicture);
View Full Code Here

    assert coregraph.transitionMatrix.containsKey(pair.firstElem);
    assert coregraph.transitionMatrix.containsKey(pair.secondElem);
    Map<CmpVertex,List<CmpVertex>> mergedVertices = coregraph.config.getTransitionMatrixImplType() == STATETREE.STATETREE_ARRAY?
        new ArrayMapWithSearch<CmpVertex,List<CmpVertex>>(coregraph.getStateNumber()):
        new HashMapWithSearch<CmpVertex,List<CmpVertex>>(coregraph.getStateNumber());
    Configuration shallowCopy = coregraph.config.copy();shallowCopy.setLearnerCloneGraph(false);

    long pairScore = coregraph.pairscores.computePairCompatibilityScore_internal(pair,mergedVertices);
    if (pairScore < 0)
      return -1;
View Full Code Here

      else
      {// only create a top-level element if writing pure XML.
        outputStream=outStream;
        topElement = doc.createElement(StatechumXML.ELEM_STATECHUM_TESTTRACE.name());doc.appendChild(topElement);topElement.appendChild(AbstractPersistence.endl(doc));
      }
      Configuration seriesConfiguration = config.copy();seriesConfiguration.setGdMaxNumberOfStatesInCrossProduct(0);
      series = new GraphSeries(doc,threadNumber,seriesConfiguration);
    }
    catch(ParserConfigurationException e)
    {
      statechum.Helper.throwUnchecked("failed to construct DOM document",e);
View Full Code Here

    @SuppressWarnings("rawtypes")
  @Override
    public void update(@SuppressWarnings("unused") final Observable s, Object arg) {
      int graphNumber = graphs.size();// should match the position of the graph in the list of graphs
        if (arg instanceof AbstractLearnerGraph) {
          Configuration cloneConfig = ((AbstractLearnerGraph) arg).config.copy();
          cloneConfig.setLearnerCloneGraph(true);
          LearnerGraphND gr = new LearnerGraphND((AbstractLearnerGraph)arg,cloneConfig);
          gr.config.setLearnerCloneGraph(false);
          graphsOrig.add( gr );
            graphs.add(((AbstractLearnerGraph) arg).pathroutines.getGraph());
            layoutOptions.put(graphNumber,gr.getLayoutOptions());
View Full Code Here

  {
    InitialConfigurationAndData outcome = new InitialConfigurationAndData();
   
    final java.io.FileInputStream inputStream = new java.io.FileInputStream(argPTAFileName);
    final LearnerSimulator simulator = new LearnerSimulator(inputStream,true,converter);
    Configuration defaultConfig = configToUse.copy();
    //defaultConfig.setRejectPositivePairsWithScoresLessThan(1);
    assert converter != null : "we expect this methods to be used with large graphs and Array matrix types hence converter must be set";
    outcome.learnerInitConfiguration = simulator.readLearnerConstructionData(defaultConfig);
    outcome.learnerInitConfiguration.setLabelConverter(converter);
   
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);
    ConvertALabel converter = new Transform.InternStringLabel();
    //gr_NewToOrig.setLimit(7000);
    GlobalConfiguration.getConfiguration().setProperty(G_PROPERTIES.LINEARWARNINGS, "false");
    final int ThreadNumber = ExperimentRunner.getCpuNumber();
   
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.