Package statechum.analysis.learning.rpnicore.Transform

Examples of statechum.analysis.learning.rpnicore.Transform.ConvertALabel


  /** Deterministic case. */
  @Test
  public void testParseAutomataAndComputeDiff1() throws IncompatibleStatesException
  {
    ConvertALabel converter = null;
    Configuration config = Configuration.getDefaultConfiguration().copy();
    Random rnd=new Random(0);
    for(int states=1;states < 100;states++)
    {
      final int alphabet = 2*states;
 
View Full Code Here


 
  /** Non-deterministic case. */
  @Test
  public void testParseAutomataAndComputeDiff2()
  {
    ConvertALabel converter = null;
    Configuration config = Configuration.getDefaultConfiguration().copy();config.setGdFailOnDuplicateNames(false);
    Random rnd=new Random(0);
    LearnerGraphND previous = null;
   
    for(int states=1;states < 100;states++)
View Full Code Here

   */
  public static Set<List<Label>> convertTracesToErl(Set<List<Label>> traces, Configuration config)
  {
    ErlangModule mod = ErlangModule.findModule(config.getErlangModuleName());
    Set<List<Label>> convertedTraces = null;
    ConvertALabel converter = mod.behaviour.new ConverterErlToMod();
    convertedTraces = new HashSet<List<Label>>();
    for(List<Label> list:traces) convertedTraces.add(OTPBehaviour.convertTrace(list, converter));
    return convertedTraces;
  }
View Full Code Here

  }
 
  /** Creates a label from the string of text and a configuration. */
  public static void createLabel(String str, Configuration config)
  {
    ConvertALabel converter = null;
    AbstractLearnerGraph.generateNewLabel("{"+ErlangLabel.missingFunction+","+str+"}", config,converter);
  }
View Full Code Here

  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.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;
    final int samplesPerFSM = 10;
View Full Code Here

  // AbstractLearnerGraph is polymorphic in this context: I can use both deterministic and non-deterministic graphs.
  @Parameters
  public static Collection<Object[]> data()
  {
    Configuration config = Configuration.getDefaultConfiguration().copy();config.setTransitionMatrixImplType(STATETREE.STATETREE_SLOWTREE);
    ConvertALabel converter = new Transform.InternStringLabel();
    final String fsmA = "S-a->S1-b->"+"A-a->A1-a-#AR\nA1-d->A2-d->A3\nA1-c->A2-c->A3"+TestRpniLearner.PTA3;
    final String fsmB = "S-a->S\nA1-a->A2\nS-a->S1-b->"+"A-a->A1-a-#AR\nA1-d->A2-d->A3\nA1-c->A2-c->A3"+TestRpniLearner.PTA3;
    LearnerGraph graphD=FsmParser.buildLearnerGraph(fsmA, "testCopyGraph2",config,converter);
    LearnerGraphND graphND=FsmParser.buildLearnerGraphND(fsmB, "testCopyGraph4",config,converter);
    LearnerGraph graphDNotIntern=FsmParser.buildLearnerGraph(fsmA, "testCopyGraph2",config,null);
View Full Code Here

        }
      }
    }
   

    ConvertALabel converter = new Transform.InternStringLabel();
    LearnerGraph differentGraphA = new LearnerGraph(graphD,graphD.config);differentGraphA.transitionMatrix.get(differentGraphA.findVertex("A2"))
      .put(AbstractLearnerGraph.generateNewLabel("t",differentGraphA.config,converter),
          differentGraphA.findVertex("A3"));
    differentGraphA.setName("differentA");
    LearnerGraphND differentGraphB = new LearnerGraphND(graphND,graphD.config);differentGraphB.transitionMatrix.get(differentGraphB.findVertex("A2"))
View Full Code Here

  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;
    final int samplesPerFSM = 10;
View Full Code Here

      });
    }

    public static <TARGET_TYPE,CACHE_TYPE extends CachedData<TARGET_TYPE,CACHE_TYPE>> void convertLabelsToStrings(AbstractLearnerGraph<TARGET_TYPE,CACHE_TYPE> grFrom, AbstractLearnerGraph<TARGET_TYPE,CACHE_TYPE> grTo)
    {
        AbstractLearnerGraph.interpretLabelsOnGraph(grFrom,grTo,new Transform.ConvertLabel(new ConvertALabel() {
       
        @Override
        public Label convertLabelToLabel(Label label) {
          ErlangLabel lbl = (ErlangLabel)label;
          return new StringLabel(lbl.function.getName()+"/"+lbl.function.getArity()+","+lbl.input+","+lbl.expectedOutput);
View Full Code Here

    public OtpErlangObject computeBCR_and_structuralDifference(LearnerGraph referenceGraph, LearnerGraph learntGraph, Configuration config)
    {
      final int chunkLen = 3;
     
      ConvertALabel converter = new Transform.InternStringLabel();
      LearnerEvaluationConfiguration learnerEval = new LearnerEvaluationConfiguration(config);learnerEval.setLabelConverter(converter);
      int states = referenceGraph.getAcceptStateNumber();
      final Collection<List<Label>> testSet = PaperUAS.computeEvaluationSet(referenceGraph,states,PairQualityLearner.makeEven(states*referenceGraph.pathroutines.computeAlphabet().size()));
     
      DifferenceToReferenceDiff differenceStructural=DifferenceToReferenceDiff.estimationOfDifferenceDiffMeasure(referenceGraph, learntGraph, config, 1);
View Full Code Here

TOP

Related Classes of statechum.analysis.learning.rpnicore.Transform.ConvertALabel

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.