Package statechum.model.testset.PTASequenceEngine

Examples of statechum.model.testset.PTASequenceEngine.FilterPredicate


  /** Two-thread computation of precision/recall by going through all the sequences. */
  private static final PosNegPrecisionRecall computePrecisionRecall(final LearnerGraph graph, final PTASequenceEngine sequences)
  {
    final Collection<List<Label>> positiveRel = sequences.filter(sequences.getFSM_filterPredicate()).getData(),
      negativeRel = sequences.getData(new FilterPredicate() {
        FilterPredicate origFilter = sequences.getFSM_filterPredicate();
       
        @Override
        public boolean shouldBeReturned(Object name) {
          return !origFilter.shouldBeReturned(name);
View Full Code Here


          });


        if (onlyUsePositives)
        {
          pta.paths.augmentPTA(generator.getAllSequences(0).filter(new FilterPredicate() {
            @Override
            public boolean shouldBeReturned(Object name) {
              return ((statechum.analysis.learning.rpnicore.RandomPathGenerator.StateName)name).accept;
            }
          }));
View Full Code Here

  /** Two-thread computation of precision/recall by going through all the sequences. */
  private static final PosNegPrecisionRecall computePrecisionRecall(final LearnerGraph graph, final PTASequenceEngine sequences)
  {
    final Collection<List<Label>> positiveRel = sequences.filter(sequences.getFSM_filterPredicate()).getData(),
      negativeRel = sequences.getData(new FilterPredicate() {
        FilterPredicate origFilter = sequences.getFSM_filterPredicate();
       
        @Override
        public boolean shouldBeReturned(Object name) {
          return !origFilter.shouldBeReturned(name);
View Full Code Here

  static Map<Integer,Set<List<Label>>> constructCollectionOfTraces(final Map<Integer,PTASequenceEngine> frameToEngine,final boolean positive)
  {
    Map<Integer,Set<List<Label>>> frameToTraces = new TreeMap<Integer,Set<List<Label>>>();
    for(Entry<Integer,PTASequenceEngine> entry:frameToEngine.entrySet())
    {
      final FilterPredicate existingPredicate = entry.getValue().getFSM_filterPredicate();
     
      Set<List<Label>> tracesForFrame = new HashSet<List<Label>>();
      tracesForFrame.addAll(entry.getValue().getData(new FilterPredicate()
      {
 
        @Override
        public boolean shouldBeReturned(Object name) {
          return existingPredicate.shouldBeReturned(name) == positive;
        }
       
      }));
      frameToTraces.put(entry.getKey(),tracesForFrame);
    }
View Full Code Here

  static Map<Integer,Set<List<Label>>> constructCollectionOfTraces(final Map<Integer,PTASequenceEngine> frameToEngine,final boolean positive)
  {
    Map<Integer,Set<List<Label>>> frameToTraces = new TreeMap<Integer,Set<List<Label>>>();
    for(Entry<Integer,PTASequenceEngine> entry:frameToEngine.entrySet())
    {
      final FilterPredicate existingPredicate = entry.getValue().getFSM_filterPredicate();
     
      Set<List<Label>> tracesForFrame = new HashSet<List<Label>>();
      tracesForFrame.addAll(entry.getValue().getData(new FilterPredicate()
      {
 
        @Override
        public boolean shouldBeReturned(Object name) {
          return existingPredicate.shouldBeReturned(name) == positive;
        }
       
      }));
      frameToTraces.put(entry.getKey(),tracesForFrame);
    }
View Full Code Here

            }
          });

        if (onlyUsePositives)
        {
          pta.paths.augmentPTA(generator.getAllSequences(0).filter(new FilterPredicate() {
            @Override
            public boolean shouldBeReturned(Object name) {
              return ((statechum.analysis.learning.rpnicore.RandomPathGenerator.StateName)name).accept;
            }
          }));
        }
        else
          pta.paths.augmentPTA(generator.getAllSequences(0));
   
        List<List<Label>> sPlus = generator.getAllSequences(0).getData(new FilterPredicate() {
          @Override
          public boolean shouldBeReturned(Object name) {
            return ((statechum.analysis.learning.rpnicore.RandomPathGenerator.StateName)name).accept;
          }
        });
        List<List<Label>> sMinus= generator.getAllSequences(0).getData(new FilterPredicate() {
          @Override
          public boolean shouldBeReturned(Object name) {
            return !((statechum.analysis.learning.rpnicore.RandomPathGenerator.StateName)name).accept;
          }
        });
View Full Code Here

            }
          });

        if (onlyUsePositives)
        {
          pta.paths.augmentPTA(generator.getAllSequences(0).filter(new FilterPredicate() {
            @Override
            public boolean shouldBeReturned(Object name) {
              return ((statechum.analysis.learning.rpnicore.RandomPathGenerator.StateName)name).accept;
            }
          }));
View Full Code Here

            }
          });

        if (onlyUsePositives)
        {
          pta.paths.augmentPTA(generator.getAllSequences(0).filter(new FilterPredicate() {
            @Override
            public boolean shouldBeReturned(Object name) {
              return ((statechum.analysis.learning.rpnicore.RandomPathGenerator.StateName)name).accept;
            }
          }));
        }
        else
          pta.paths.augmentPTA(generator.getAllSequences(0));
   
        List<List<Label>> sPlus = generator.getAllSequences(0).getData(new FilterPredicate() {
          @Override
          public boolean shouldBeReturned(Object name) {
            return ((statechum.analysis.learning.rpnicore.RandomPathGenerator.StateName)name).accept;
          }
        });
        List<List<Label>> sMinus= generator.getAllSequences(0).getData(new FilterPredicate() {
          @Override
          public boolean shouldBeReturned(Object name) {
            return !((statechum.analysis.learning.rpnicore.RandomPathGenerator.StateName)name).accept;
          }
        });
View Full Code Here

            }
          });

        if (onlyUsePositives)
        {
          pta.paths.augmentPTA(generator.getAllSequences(0).filter(new FilterPredicate() {
            @Override
            public boolean shouldBeReturned(Object name) {
              return ((statechum.analysis.learning.rpnicore.RandomPathGenerator.StateName)name).accept;
            }
          }));
View Full Code Here

        pta.paths.augmentPTA(seq, referenceGraph.getVertex(seq) != null, false, null);
      }*/
      //pta.paths.augmentPTA(referenceGraph.wmethod.computeNewTestSet(referenceGraph.getInit(),1));// this one will not set any states as rejects because it uses shouldbereturned
      //referenceGraph.pathroutines.completeGraph(referenceGraph.nextID(false));
      if (onlyUsePositives)
        pta.paths.augmentPTA(generator.getAllSequences(0).filter(new FilterPredicate() {
          @Override
          public boolean shouldBeReturned(Object name) {
            return ((statechum.analysis.learning.rpnicore.RandomPathGenerator.StateName)name).accept;
          }
        }));
View Full Code Here

TOP

Related Classes of statechum.model.testset.PTASequenceEngine.FilterPredicate

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.