Examples of generateRandomPosNeg()


Examples of statechum.analysis.learning.rpnicore.RandomPathGenerator.generateRandomPosNeg()

        // 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.generateRandomPosNeg()

      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.generateRandomPosNeg()

      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*alphabet);
            }
 
View Full Code Here

Examples of statechum.analysis.learning.rpnicore.RandomPathGenerator.generateRandomPosNeg()

        // 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.generateRandomPosNeg()

        // 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.generateRandomPosNeg()

    protected void buildSetsHalfNegative()
    {
      loadGraph();
      int size = (graph.getStateNumber()*graph.getStateNumber())/2;
        RandomPathGenerator rpg = new RandomPathGenerator(graph, new Random(100),5);// the seed for Random should be the same for each file
        rpg.generateRandomPosNeg(size/(2*experiment.getStageNumber()), experiment.getStageNumber());
      pta = rpg.getAllSequences(percent);
      tests = new ArrayList<List<String>>();
      for(List<String> test:graph.wmethod.getFullTestSet(0))
        if (!pta.containsSequence(test))
          tests.add(test);
View Full Code Here

Examples of statechum.analysis.learning.rpnicore.RandomPathGenerator.generateRandomPosNeg()

     for(CmpVertex vert:referenceGraph.transitionMatrix.keySet())
       if (!vert.isAccept())
         throw new IllegalArgumentException("test set generation should not be attempted on an automaton with reject-states");
     assert numberOfSeq > 0 && seqLength > 0;
    RandomPathGenerator pathGen = new RandomPathGenerator(referenceGraph,new Random(0),seqLength,referenceGraph.getInit());
    pathGen.generateRandomPosNeg(numberOfSeq, 1, false, null, true,true,null,null);
    return  pathGen.getAllSequences(0).getData(PTASequenceEngine.truePred);
     /*
    Collection<List<Label>> evaluationTestSet = referenceGraph.wmethod.getFullTestSet(1);
   
    RandomPathGenerator pathGen = new RandomPathGenerator(referenceGraph,new Random(0),5,referenceGraph.getInit());
View Full Code Here

Examples of statechum.analysis.learning.rpnicore.RandomPathGenerator.generateRandomPosNeg()

        // 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.generateRandomPosNeg()

        // 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.generateRandomPosNeg()

        // 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
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.