Examples of RandomLengthGenerator


Examples of statechum.analysis.learning.rpnicore.RandomPathGenerator.RandomLengthGenerator

  public void test_generatePathThatEndsAtInitialState4()
  {
    LearnerGraph graph = buildLearnerGraph("A-a->A-a1->B-a2->C-a3->D-c1->E-c2->F-c3->G-c4->H-c5->A / B-b1->A / C-b2->A / D-b3->A","test_generatePathThatEndsAtInitialState4",config,converter);
    final RandomPathGenerator generator = new RandomPathGenerator(graph,new Random(0),8,null);
    generator.setWalksShouldLeadToInitialState();
    generator.generateRandomPosNeg(4, 1, false, new RandomLengthGenerator() {
     
      @Override
      public int getLength() {
        return 2;
      }
View Full Code Here

Examples of statechum.analysis.learning.rpnicore.RandomPathGenerator.RandomLengthGenerator

  public void test_generationOfRejectsNotEnteringInit1()
  {
    LearnerGraph graph = buildLearnerGraph("F-a->F","test_generationOfRejectsNotEnteringInit1",config,converter);
    final RandomPathGenerator generator = new RandomPathGenerator(graph,new Random(0),8,null);
    generator.setWalksShouldLeadToInitialState();
    generator.generateRandomPosNeg(2, 1, false, new RandomLengthGenerator() {
     
      @Override
      public int getLength() {
        return 2;
      }
View Full Code Here

Examples of statechum.analysis.learning.rpnicore.RandomPathGenerator.RandomLengthGenerator

    LearnerGraph graph = buildLearnerGraph("F-a->F-b->G","test_FSM_withStatesFromWhichInitIsNotReachable",config,converter);
    final RandomPathGenerator generator = new RandomPathGenerator(graph,new Random(0),8,null);
    generator.setWalksShouldLeadToInitialState();
    checkForCorrectException(new whatToRun() { @Override public void run() {
   
      generator.generateRandomPosNeg(2, 1, false, new RandomLengthGenerator() {
       
        @Override
        public int getLength() {
          return 2;
        }
View Full Code Here

Examples of statechum.analysis.learning.rpnicore.RandomPathGenerator.RandomLengthGenerator

  public void test_generationOfRejectsNotEnteringInit2()
  {
    LearnerGraph graph = buildLearnerGraph("F-a->F-b->G-a->F","test_generationOfRejectsNotEnteringInit2",config,converter);
    final RandomPathGenerator generator = new RandomPathGenerator(graph,new Random(0),8,null);
    generator.setWalksShouldLeadToInitialState();
    generator.generateRandomPosNeg(2, 1, false, new RandomLengthGenerator() {
     
      @Override
      public int getLength() {
        return 2;
      }
View Full Code Here

Examples of statechum.analysis.learning.rpnicore.RandomPathGenerator.RandomLengthGenerator

  public void test_generationOfRejectsNotEnteringInit3()
  {
    LearnerGraph graph = buildLearnerGraph("F-a->F-b->G-a->H-a->F","test_generationOfRejectsNotEnteringInit3",config,converter);
    final RandomPathGenerator generator = new RandomPathGenerator(graph,new Random(0),8,null);
    generator.setWalksShouldLeadToInitialState();
    generator.generateRandomPosNeg(2, 1, false, new RandomLengthGenerator() {
     
      @Override
      public int getLength() {
        return 2;
      }
View Full Code Here

Examples of statechum.analysis.learning.rpnicore.RandomPathGenerator.RandomLengthGenerator

     
      // try learning the same machine using a random generator selector passed as a parameter.
      LearnerGraph pta = new LearnerGraph(config);
      RandomPathGenerator generator = new RandomPathGenerator(referenceGraph,new Random(trainingSample),5,null);
      final int tracesToGenerate = makeEven(traceQuantity);
      generator.generateRandomPosNeg(tracesToGenerate, 1, false, new RandomLengthGenerator() {
                 
          @Override
          public int getLength() {
            return (int)(traceLengthMultiplier*states*tracesAlphabet);
          }
 
View Full Code Here

Examples of statechum.analysis.learning.rpnicore.RandomPathGenerator.RandomLengthGenerator

         LearnerGraph pta = new LearnerGraph(config);
        RandomPathGenerator generator = new RandomPathGenerator(referenceGraph,new Random(attempt),5,null);
        final int tracesToGenerate = makeEven(traceQuantity);

        generator.generateRandomPosNeg(tracesToGenerate, 1, false, new RandomLengthGenerator() {
                   
            @Override
            public int getLength() {
              return (int) traceLengthMultiplier*alphabet*states;
            }
 
View Full Code Here

Examples of statechum.analysis.learning.rpnicore.RandomPathGenerator.RandomLengthGenerator

        // The total number of elements in test sequences (alphabet*states*traceQuantity) will be distributed around (random(pathLength)+1). The total size of PTA is a product of these two.
        // For the purpose of generating long traces, we construct as many traces as there are states but these traces have to be rather long,
        // that is, length of traces will be (random(pathLength)+1)*sequencesPerChunk/states and the number of traces generated will be the same as the number of states.
        final int tracesToGenerate = makeEven(traceQuantity);
        final Random rnd = new Random(seed*31+attempt);
        generator.generateRandomPosNeg(tracesToGenerate, 1, false, new RandomLengthGenerator() {
                   
            @Override
            public int getLength() {
              return (rnd.nextInt(pathLength)+1)*lengthMultiplier;
            }
 
View Full Code Here

Examples of statechum.analysis.learning.rpnicore.RandomPathGenerator.RandomLengthGenerator

        // The total number of elements in test sequences (alphabet*states*traceQuantity) will be distributed around (random(pathLength)+1). The total size of PTA is a product of these two.
        // For the purpose of generating long traces, we construct as many traces as there are states but these traces have to be rather long,
        // that is, length of traces will be (random(pathLength)+1)*sequencesPerChunk/states and the number of traces generated will be the same as the number of states.
        final int tracesToGenerate = makeEven(states*traceQuantity);
        final Random rnd = new Random(seed*31+attempt);
        generator.generateRandomPosNeg(tracesToGenerate, 1, false, new RandomLengthGenerator() {
                   
            @Override
            public int getLength() {
              return (rnd.nextInt(pathLength)+1)*lengthMultiplier;
            }
 
View Full Code Here

Examples of statechum.analysis.learning.rpnicore.RandomPathGenerator.RandomLengthGenerator

        RandomPathGenerator generator = new RandomPathGenerator(referenceGraph,new Random(attempt),5,null);
        // The total number of elements in test sequences (alphabet*states*traceQuantity) will be distributed around (random(pathLength)+1). The total size of PTA is a product of these two.
        // For the purpose of generating long traces, we construct as many traces as there are states but these traces have to be rather long,
        // that is, length of traces will be (random(pathLength)+1)*sequencesPerChunk/states and the number of traces generated will be the same as the number of states.
        final int tracesToGenerate = makeEven(traceQuantity);
        generator.generateRandomPosNeg(tracesToGenerate, 1, false, new RandomLengthGenerator() {
                   
            @Override
            public int getLength() {
              return 2*states*alphabet;//(rnd.nextInt(pathLength)+1)*lengthMultiplier;
            }
 
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.