Examples of StatesToConsider


Examples of statechum.analysis.learning.rpnicore.AbstractLearnerGraph.StatesToConsider

  {
    LearnerGraphND graph = buildLearnerGraphND("A-a->B-a->C\nA<-c-B-b-#D\nB-d->A-c->C\nU-b->V-a->U",
      "testConvertToND6",config,converter);
   
    LearnerGraphND actual = new LearnerGraphND(Configuration.getDefaultConfiguration());actual.initEmpty();
    AbstractPathRoutines.buildInverse(graph, new StatesToConsider() {

      @Override
      public boolean stateToConsider(@SuppressWarnings("unused") CmpVertex vert) {
        return false;
      }
View Full Code Here

Examples of statechum.analysis.learning.rpnicore.AbstractLearnerGraph.StatesToConsider

    LearnerGraphND graph = buildLearnerGraphND("A-a->B-a->C\nA<-c-B-b-#D\nB-d->A-c->C\nU-b->V-a->U","testConvertToND6",config,converter);
    LearnerGraphND expected = buildLearnerGraphND("A-c->C\nU-b->V-a->U","testBuildForward7",config,converter);
    expected.transitionMatrix.put(AbstractLearnerGraph.generateNewCmpVertex(VertexID.parseID("D"), graph.config), graph.createNewRow());
   
    LearnerGraphND actual = new LearnerGraphND(Configuration.getDefaultConfiguration());actual.initEmpty();
    AbstractPathRoutines.buildForward(graph, new StatesToConsider() {

      @Override
      public boolean stateToConsider(CmpVertex vert) {
        return !vert.getStringId().equals("B");
      }
View Full Code Here

Examples of statechum.analysis.learning.rpnicore.AbstractLearnerGraph.StatesToConsider

  public final void testBuildForward8()
  {
    final LearnerGraphND graph = buildLearnerGraphND("A-a->B-a->C\nA<-c-B-b-#D\nB-d->A-c->C\nU-b->V-a->U","testConvertToND6",config,converter);
    final LearnerGraphND actual = new LearnerGraphND(Configuration.getDefaultConfiguration());actual.initEmpty();
   
    AbstractPathRoutines.buildForward(graph, new StatesToConsider() {
      @Override
      public boolean stateToConsider(@SuppressWarnings("unused") CmpVertex vert) {
        return false;
      }
    },actual);
View Full Code Here

Examples of statechum.analysis.learning.rpnicore.AbstractLearnerGraph.StatesToConsider

   *
   * @return an instance of filter.
   */
  public static StatesToConsider createInstanceOfFilter(Class<? extends StatesToConsider> filterClass,LearnerGraph gr)
  {
    StatesToConsider filter = null;
    try {
      java.lang.reflect.Constructor<? extends StatesToConsider> constructor = filterClass.getConstructor(new Class []{});
      filter = constructor.newInstance(new Object[]{});
    } catch (Exception e) {
      // if we failed, filter stays at null, we'll try again.
View Full Code Here

Examples of statechum.analysis.learning.rpnicore.AbstractLearnerGraph.StatesToConsider

   */
  private final void checkConsideringIgnoredStates(String graph, String graphName, Class<? extends StatesToConsider> filterClass, String [] expectedToRemain)
  {
    Configuration conf = Configuration.getDefaultConfiguration().copy();conf.setTransitionMatrixImplType(STATETREE.STATETREE_SLOWTREE);
    LearnerGraph gr=buildLearnerGraph(graph,graphName,conf,null);
    StatesToConsider filter = createInstanceOfFilter(filterClass, gr);
    for(boolean direction:new boolean[]{false,true})
    {
      GDLearnerGraph ndGraph = new GDLearnerGraph(gr,filter, direction);
      Map<CmpVertex,Integer> state_to_int_map = new TreeMap<CmpVertex,Integer>();
      CmpVertex [] numberToStateNoReject = gr.buildStateToIntegerMap(filter,state_to_int_map);
View Full Code Here

Examples of statechum.analysis.learning.rpnicore.AbstractLearnerGraph.StatesToConsider

           
            // Perhaps I should be numbering states directly here instead of using numberNonNegativeElements afterwards,
            // but this is not simple to do: I have to give numbers in the order in which triangular traversal visits states.
          }
        });
      GDLearnerGraph.performRowTasks(handlerList, ThreadNumber, grCombined.transitionMatrix,new StatesToConsider() {
        @Override public boolean stateToConsider(CmpVertex vert) {
          return statesOfA.contains(vert);
        }
      }, GDLearnerGraph.partitionWorkLoadLinear(ThreadNumber,statesOfA.size()));
      final int numberOfPairs = GDLearnerGraph.numberNonNegativeElements(pairScores);
View Full Code Here

Examples of statechum.analysis.learning.rpnicore.AbstractLearnerGraph.StatesToConsider

            assert highState != null;
            wave.add(new PairScore(entryA.getKey(),highState,(int)(multiplier*scoreHigh),(int)(multiplier*scoreLow)));
          }
        });
      }
      GDLearnerGraph.performRowTasks(handlerList, ThreadNumber, grCombined.transitionMatrix,new StatesToConsider() {
        @Override public boolean stateToConsider(CmpVertex vert) {
          return statesOfA.contains(vert);
        }
      }, GDLearnerGraph.partitionWorkLoadLinear(ThreadNumber,statesOfA.size()));
     
View Full Code Here

Examples of statechum.analysis.learning.rpnicore.AbstractLearnerGraph.StatesToConsider

           
            // Perhaps I should be numbering states directly here instead of using numberNonNegativeElements afterwards,
            // but this is not simple to do: I have to give numbers in the order in which triangular traversal visits states.
          }
        });
      GDLearnerGraph.performRowTasks(handlerList, ThreadNumber, grCombined.transitionMatrix,new StatesToConsider() {
        @Override public boolean stateToConsider(CmpVertex vert) {
          return statesOfA.contains(vert);
        }
      }, GDLearnerGraph.partitionWorkLoadLinear(ThreadNumber,statesOfA.size()));
      final int numberOfPairs = GDLearnerGraph.numberNonNegativeElements(pairScores);
View Full Code Here

Examples of statechum.analysis.learning.rpnicore.AbstractLearnerGraph.StatesToConsider

            assert highState != null;
            wave.add(new PairScore(entryA.getKey(),highState,(int)(multiplier*scoreHigh),(int)(multiplier*scoreLow)));
          }
        });
      }
      GDLearnerGraph.performRowTasks(handlerList, ThreadNumber, grCombined.transitionMatrix,new StatesToConsider() {
        @Override public boolean stateToConsider(CmpVertex vert) {
          return statesOfA.contains(vert);
        }
      }, GDLearnerGraph.partitionWorkLoadLinear(ThreadNumber,statesOfA.size()));
     
View Full Code Here

Examples of statechum.analysis.learning.rpnicore.AbstractLearnerGraph.StatesToConsider

 
  protected DoubleMatrix1D getExpectedMatrix1DSlowly(LearnerGraph gr)
  {
    int size=gr.getStateNumber()*(gr.getStateNumber()+1)/2;
    DoubleMatrix1D result = DoubleFactory1D.dense.make(size);
    StatesToConsider filter = LearnerGraphND.ignoreRejectStates;
    GDLearnerGraph ndGraph = new GDLearnerGraph(gr,filter, false);
    DetermineDiagonalAndRightHandSide ddrhInstance = ndGraph.new DDRH_default();
    for(Entry<CmpVertex,Map<Label,List<CmpVertex>>> entryA:ndGraph.matrixForward.transitionMatrix.entrySet())
    {
      // Now iterate through states
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.