Examples of PairScore


Examples of statechum.analysis.learning.PairScore

       public static Stack<PairScore> getChoices(Stack<PairScore> stack)
       {
           if (stack.isEmpty())
                   return null;
           Stack<PairScore> outcome = new Stack<PairScore>();
           PairScore top = stack.peek();
           outcome.add(top);
           int i=stack.size()-2;
           while(i>=0)
           {
                   PairScore curr = stack.get(i);--i;
                   if (curr.getScore() != top.getScore())
                           break;
                   outcome.add(curr);
           }
           return outcome;
       }
View Full Code Here

Examples of statechum.analysis.learning.PairScore

       public static Stack<PairScore> getChoicesother(Stack<PairScore> stack)
       {
           if (stack.isEmpty())
                   return null;
           Stack<PairScore> outcome = new Stack<PairScore>();
           PairScore top = stack.peek();
           outcome.add(top);
           int i=stack.size()-2;
           while(i>=0)
           {
                   PairScore curr = stack.get(i);--i;
                   if (curr.getAnotherScore() != top.getAnotherScore())
                           break;
                   outcome.add(curr);
           }
           return outcome;
       }
View Full Code Here

Examples of statechum.analysis.learning.PairScore

           return outcome;
       }
      
       public static Stack<PairScore> getChoicesother_improved(ArrayList<PairScore> possibleResults)
       {
         PairScore bestPair=null;
       for(PairScore P:possibleResults)
       {
        if(bestPair == null || P.getAnotherScore() > bestPair.getAnotherScore())
          bestPair=P;
       
//        if(bestPair == null || P.getDistanceScore() > bestPair.getDistanceScore())
//          bestPair=P;
       }
           Stack<PairScore> outcome = new Stack<PairScore>();
           PairScore top = bestPair;
           outcome.add(top);
           int i=possibleResults.size()-2;
           while(i>=0)
           {
                 PairScore curr = possibleResults.get(i);--i;
                 if (curr.getAnotherScore() == top.getAnotherScore() && !outcome.contains(curr))
                   outcome.add(curr);
//                 if (curr.getDistanceScore() == top.getDistanceScore())
//                   outcome.add(curr);
           }
           return outcome;
View Full Code Here

Examples of statechum.analysis.learning.PairScore

           return outcome;
       }
      
       public static Stack<PairScore> getChoicesother_Score(ArrayList<PairScore> possibleResults)
       {
         PairScore bestPair=null;
       for(PairScore P:possibleResults)
       {       
        if(bestPair == null || P.getScore() > bestPair.getScore())
          bestPair=P;
       }
           Stack<PairScore> outcome = new Stack<PairScore>();
           PairScore top = bestPair;
           outcome.add(top);
           int i=possibleResults.size()-2;
           while(i>=0)
           {
                 PairScore curr = possibleResults.get(i);--i;
                 if (curr.getScore() == top.getScore() && !outcome.contains(curr))
                   outcome.add(curr);
           }
           return outcome;
       }
View Full Code Here

Examples of statechum.analysis.learning.PairScore

       public static int countChoices_new(Stack<PairScore> stack)
       {
           if (stack.isEmpty())
                   return 0;
           int outcome = 1;
           PairScore top = stack.peek();
          
          int i=stack.size()-2;
           while(i>=0)
           {
                   PairScore curr = stack.get(i);--i;
                   if (curr.getScore() != top.getScore())
                           break;
                   ++outcome;
           }
           return outcome;
       }
View Full Code Here

Examples of statechum.analysis.learning.PairScore

       }
      
       public static Stack<PairScore> possibleAtTop(Stack<PairScore> stack)
       {
         Stack<PairScore> toptop = new Stack<PairScore>();
           PairScore top = stack.peek();        
           int i=stack.size()-1;
           while(i>=0)
           {
             PairScore curr = stack.get(i);--i;
                 if (curr.getScore() == top.getScore())
                toptop.addElement(curr);                      
           }
          
           return toptop;
       }
View Full Code Here

Examples of statechum.analysis.learning.PairScore

      

       /** Returns the pair corresponding to the smallest or largest machine for one of the pairs with the same score at the top of the stack. */
        public static PairScore selectPairMinMax(LearnerGraph graph, Stack<PairScore> stack, int pairChoice)
        {
            PairScore top = stack.peek();
            int value = MergeStates.mergeAndDeterminize(graph, top).getStateNumber();
            int i=stack.size()-2;
            while(i>=0)
            {
                    PairScore pair = stack.get(i);--i;
                    if (pair.getScore() != top.getScore()) break;
                    int stateNumber = MergeStates.mergeAndDeterminize(graph, pair).getStateNumber();
                    switch(pairChoice)
                    {
                    case pairchoiceMIN:
                            if (stateNumber < value)
View Full Code Here

Examples of statechum.analysis.learning.PairScore

        }
   
       /** Picks a pair at the top of the stack at random. */
        public static PairScore selectPairAtRandom(Stack<PairScore> stack, Random rnd)
        {
            PairScore top = stack.get(stack.size()-1-rnd.nextInt(countChoices(stack)));
            assert top.getScore() == stack.peek().getScore();
            return top;
        }
View Full Code Here

Examples of statechum.analysis.learning.PairScore

            CmpVertex currentBlueState = BlueEntry.getValue();
                       
            int numberOfCompatiblePairs = 0;
            for(CmpVertex oldRed:reds)
            {
              PairScore pair = coregraph.pairscores.obtainPair(currentBlueState,oldRed,null);
              if (pair.getScore() >= coregraph.config.getGeneralisationThreshold())
              {
                coregraph.pairsAndScores.add(pair);
                ++numberOfCompatiblePairs;
              }
            }
           
            if (numberOfCompatiblePairs == 0)
            {// mark this blue node as red.
              CmpVertex newRedNode = currentBlueState;
              newRedNode.setColour(JUConstants.RED);
              reds.add(newRedNode);currentExplorationBoundary.add(newRedNode);
              BlueStatesConsideredSoFar.remove(newRedNode);
             
              // All future blue nodes will use this revised set of red states; the fact that
              // it is added to the exploration boundary ensures that it is considered when looking for more blue states.
              // Note that previously-considered blue states were not compared to this one (because it was blue before),
              // however previously-introduced red were - we're using the up-to-date reds set above.
              // For this reason, all we have to do is iterate over the old blue states and compare them to the
              // current one; none of those states may become red as a consequence since they are not
              // red already, i.e. there is an entry about them in PairsAndScores
              for(CmpVertex oldBlue:BlueStatesConsideredSoFar)
              {
                PairScore pair = coregraph.pairscores.obtainPair(oldBlue,newRedNode,null);
                if (pair.getScore() >= coregraph.config.getGeneralisationThreshold())
                {
                  coregraph.pairsAndScores.add(pair);
                }
              }
            }
View Full Code Here

Examples of statechum.analysis.learning.PairScore

            score = -1;
          return score;
        }});
      if (!outcome.isEmpty())
      {
        PairScore chosenPair = pickPairQSMLike(outcome);
        updateStatistics(pairQuality, graph,referenceGraph, outcome);
        outcome.clear();outcome.push(chosenPair);
      }
     
      return outcome;
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.