Examples of RandomLengthGenerator


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

      for(int attempt=0;attempt<2;++attempt)
      {// try learning the same machine a few times
        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*states*tracesAlphabet);
            }
 
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);
        generator.generateRandomPosNeg(tracesToGenerate, 1, false, new RandomLengthGenerator() {
                   
            @Override
            public int getLength() {
              return 2*states*alphabet;
            }
 
View Full Code Here

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

    final int attempt=0;
    LearnerGraph pta = new LearnerGraph(config);
    RandomPathGenerator generator = new RandomPathGenerator(referenceGraph,new Random(attempt),5,null);
    final int tracesToGenerate = PairQualityLearner.makeEven(traceQuantity);
    generator.generateRandomPosNeg(tracesToGenerate, 1, false, new RandomLengthGenerator() {
                 
        @Override
        public int getLength() {
          return (int)(traceLengthMultiplier*states*alphabet);

 
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 2*states*alphabet;//(rnd.nextInt(pathLength)+1)*lengthMultiplier;
            }
 
View Full Code Here

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

  @Test
  public void test_generateRandomWalk_tooshort_Random_fail3()
  {
    final RandomPathGenerator generator = new RandomPathGenerator(simpleGraph,new Random(0),0,null);
    checkForCorrectException(new whatToRun() { @Override public void run() {
      generator.generateRandomPosNeg(2, 1, false, new RandomLengthGenerator() {
       
        @Override
        public int getLength() {
          return 1;
        }
View Full Code Here

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

  public void test_generatePathThatEndsAtInitialState1()
  {
    LearnerGraph graph = buildLearnerGraph("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_generatePathThatEndsAtInitialState1",config,converter);
    final RandomPathGenerator generator = new RandomPathGenerator(graph,new Random(0),8,graph.findVertex("B"));
    generator.setWalksShouldLeadToInitialState();
    generator.generateRandomPosNeg(2, 1, false, new RandomLengthGenerator() {
     
      @Override
      public int getLength() {
        return 5;
      }
View Full Code Here

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

  public void test_generatePathThatEndsAtInitialState2a()
  {
    LearnerGraph graph = buildLearnerGraph("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_generatePathThatEndsAtInitialState1",config,converter);
    final RandomPathGenerator generator = new RandomPathGenerator(graph,new Random(0),8,graph.findVertex("B"));
    generator.setWalksShouldLeadToInitialState();
    generator.generateRandomPosNeg(4, 1, false, new RandomLengthGenerator() {
     
      @Override
      public int getLength() {
        return 5;
      }
View Full Code Here

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

  public void test_generatePathThatEndsAtInitialState2b()
  {
    LearnerGraph graph = buildLearnerGraph("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_generatePathThatEndsAtInitialState1",config,converter);
    final RandomPathGenerator generator = new RandomPathGenerator(graph,new Random(0),8,graph.findVertex("B"));
    generator.setWalksShouldLeadToInitialState();
    generator.generateRandomPosNeg(4, 1, false, new RandomLengthGenerator() {
     
      @Override
      public int getLength() {
        return 6;
      }
View Full Code Here

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

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

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

  public void test_generatePathThatEndsAtInitialState3()
  {
    LearnerGraph graph = buildLearnerGraph("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_generatePathThatEndsAtInitialState1",config,converter);
    final RandomPathGenerator generator = new RandomPathGenerator(graph,new Random(0),8,graph.findVertex("B"));
    generator.setWalksShouldLeadToInitialState();
    generator.generateRandomPosNeg(4, 1, false, new RandomLengthGenerator() {
     
      @Override
      public int getLength() {
        return 3;
      }
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.