Examples of DetermineDiagonalAndRightHandSide


Examples of statechum.analysis.learning.rpnicore.GDLearnerGraph.DetermineDiagonalAndRightHandSide

  @Test
  public final void testCountMatchingOutgoing3a()
  {
    LearnerGraph gr=new LearnerGraph(FsmParser.buildGraph("A-a-#B\nA-b->B1\nA-c->C\nQ-a->R-a->R\nQ-b->S", "testCountMatchingOutgoing3a"), Configuration.getDefaultConfiguration());
    GDLearnerGraph ndGraph = new GDLearnerGraph(gr,LearnerGraphND.ignoreRejectStates, false);
    DetermineDiagonalAndRightHandSide matcher = ndGraph.new DDRH_default();
    getMatcherValue(gr,ndGraph,ndGraph.matrixForward, matcher ,"A","Q");
    // A and Q have 3 outgoing transitions, 2 are matched.
    // target pair B1-S has a score of 0, B-R has a score of -1.
    Assert.assertEquals(2,matcher.getRightHandSide(),Configuration.fpAccuracy);
    Assert.assertEquals(3*2,matcher.getDiagonal(),Configuration.fpAccuracy);
    getMatcherValue(gr,ndGraph,ndGraph.matrixForward, matcher ,"B","R");
    Assert.assertEquals(PAIR_INCOMPATIBLE,matcher.getRightHandSide(),Configuration.fpAccuracy);
    Assert.assertEquals(1*2,matcher.getDiagonal(),Configuration.fpAccuracy);
  }
 
View Full Code Here

Examples of statechum.analysis.learning.rpnicore.GDLearnerGraph.DetermineDiagonalAndRightHandSide

  @Test
  public final void testCountMatchingOutgoing3b()
  {
    LearnerGraph gr=new LearnerGraph(FsmParser.buildGraph("A-a-#B\nA-b->B1\nA-c->C\nQ-a->R\nQ-b->S", "testCountMatchingOutgoing3b"), Configuration.getDefaultConfiguration());
    GDLearnerGraph ndGraph = new GDLearnerGraph(gr,LearnerGraphND.ignoreNone, false);
    DetermineDiagonalAndRightHandSide matcher = ndGraph.new DDRH_default();
    getMatcherValue(gr,ndGraph,ndGraph.matrixForward, matcher ,"A","B");
    Assert.assertEquals(matcher.getDiagonal()*PAIR_INCOMPATIBLE,matcher.getRightHandSide()*2,Configuration.fpAccuracy);
    Assert.assertEquals(3*2,matcher.getDiagonal(),Configuration.fpAccuracy);
  }
 
View Full Code Here

Examples of statechum.analysis.learning.rpnicore.GDLearnerGraph.DetermineDiagonalAndRightHandSide

  {
    Configuration config = Configuration.getDefaultConfiguration().copy();
    LearnerGraph gr=new LearnerGraph(FsmParser.buildGraph("A-a-#B\nA-b->B1\nA-c->C\nQ-a->R\nQ-b->S", "testCountMatchingOutgoing3c"), config);
    gr.linear.moveRejectToHighlight();
    GDLearnerGraph ndGraph = new GDLearnerGraph(gr,LearnerGraphND.ignoreRejectStates, false);
    DetermineDiagonalAndRightHandSide matcher = ndGraph.new DDRH_default();
    getMatcherValue(gr,ndGraph,ndGraph.matrixForward, matcher,"A","Q");
    // A and Q have 3 outgoing and 2 matched.
    // the score for the first pair is -1, for another one it is 1, hence the outcome is zero
    Assert.assertEquals(2,matcher.getRightHandSide(),Configuration.fpAccuracy);
    Assert.assertEquals(3*2,matcher.getDiagonal(),Configuration.fpAccuracy);
  }
 
View Full Code Here

Examples of statechum.analysis.learning.rpnicore.GDLearnerGraph.DetermineDiagonalAndRightHandSide

  {
    Configuration config = Configuration.getDefaultConfiguration().copy();
    LearnerGraph gr=new LearnerGraph(FsmParser.buildGraph("A-a->B\nA-b->B1\nA-c->C\nQ-a->R\nQ-b->Q-c->S", "testCountMatchingOutgoing3d"), config);
    gr.linear.moveRejectToHighlight();
    GDLearnerGraph ndGraph = new GDLearnerGraph(gr,LearnerGraphND.ignoreRejectStates, false);
    DetermineDiagonalAndRightHandSide matcher = ndGraph.new DDRH_default();
    getMatcherValue(gr,ndGraph,ndGraph.matrixForward, matcher,"A","Q");
    // A and Q have 3 outgoing and 3 matched.
    // the score for the first pair is -1, for the other ones it is 1, hence the outcome is 1
    Assert.assertEquals(3,matcher.getRightHandSide(),Configuration.fpAccuracy);
    Assert.assertEquals(3*2,matcher.getDiagonal(),Configuration.fpAccuracy);
  }
 
View Full Code Here

Examples of statechum.analysis.learning.rpnicore.GDLearnerGraph.DetermineDiagonalAndRightHandSide

  {
    Configuration config = Configuration.getDefaultConfiguration().copy();
    LearnerGraph gr=new LearnerGraph(FsmParser.buildGraph("A-a-#B\nA-b->B1\nA-c->C\nQ-a->R\nQ-b->S", "testCountMatchingOutgoing3c"), config);
    gr.linear.moveRejectToHighlight();
    GDLearnerGraph ndGraph = new GDLearnerGraph(gr,LearnerGraphND.ignoreRejectStates, false);
    DetermineDiagonalAndRightHandSide matcher = ndGraph.new DDRH_highlight();
    getMatcherValue(gr,ndGraph,ndGraph.matrixForward, matcher,"A","Q");
    // A and Q have 3 outgoing and 2 matched.
    Assert.assertEquals(1,matcher.getRightHandSide(),Configuration.fpAccuracy);
  }
View Full Code Here

Examples of statechum.analysis.learning.rpnicore.GDLearnerGraph.DetermineDiagonalAndRightHandSide

  {
    Configuration config = Configuration.getDefaultConfiguration().copy();
    LearnerGraph gr=new LearnerGraph(FsmParser.buildGraph("A-a->B\nA-b->B1\nA-c->C\nQ-a->R\nQ-b->S", "testCountMatchingOutgoing3d"), config);
    gr.linear.moveRejectToHighlight();
    GDLearnerGraph ndGraph = new GDLearnerGraph(gr,LearnerGraphND.ignoreRejectStates, false);
    DetermineDiagonalAndRightHandSide matcher = ndGraph.new DDRH_highlight();
    getMatcherValue(gr,ndGraph,ndGraph.matrixForward, matcher,"A","Q");
    // A and Q have 3 outgoing and 3 matched.
    // the score for the first pair is -1, for the other ones it is 1, hence the outcome is 1
    Assert.assertEquals(2,matcher.getRightHandSide(),Configuration.fpAccuracy);
  }
View Full Code Here

Examples of statechum.analysis.learning.rpnicore.GDLearnerGraph.DetermineDiagonalAndRightHandSide

  @Test
  public final void testCountMatchingOutgoing4a()
  {
    LearnerGraph gr=new LearnerGraph(FsmParser.buildGraph("A-a-#B\nA-b-#B1\nA-c->C\nQ-a->R\nQ-b->S", "testCountMatchingOutgoing1"), Configuration.getDefaultConfiguration());
    GDLearnerGraph ndGraph = new GDLearnerGraph(gr,LearnerGraphND.ignoreRejectStates, false);
    DetermineDiagonalAndRightHandSide matcher = ndGraph.new DDRH_default();
    // 3 outgoing and 2 matching reject, but we count them as positives
    getMatcherValue(gr,ndGraph,ndGraph.matrixForward, matcher,"A","Q");
    Assert.assertEquals(2,matcher.getRightHandSide(),Configuration.fpAccuracy);
  }
View Full Code Here

Examples of statechum.analysis.learning.rpnicore.GDLearnerGraph.DetermineDiagonalAndRightHandSide

  {
    Configuration config = Configuration.getDefaultConfiguration().copy();
    LearnerGraph gr=new LearnerGraph(FsmParser.buildGraph("A-a-#B\nA-b-#B1\nA-c->C\nQ-a->R\nQ-b->S", "testCountMatchingOutgoing1"), config);
    gr.linear.moveRejectToHighlight();
    GDLearnerGraph ndGraph = new GDLearnerGraph(gr,LearnerGraphND.ignoreRejectStates, false);
    DetermineDiagonalAndRightHandSide matcher = ndGraph.new DDRH_highlight();
    getMatcherValue(gr,ndGraph,ndGraph.matrixForward, matcher,"A","Q");
    Assert.assertEquals(0,matcher.getRightHandSide(),Configuration.fpAccuracy);
  }
View Full Code Here

Examples of statechum.analysis.learning.rpnicore.GDLearnerGraph.DetermineDiagonalAndRightHandSide

  @Test
  public final void testCountMatchingOutgoing5a()
  {
    LearnerGraph gr=new LearnerGraph(FsmParser.buildGraph("A-a-#B\nA-b-#B1\nA-c->C\nQ-a->R\nQ-b->S", "testCountMatchingOutgoing1"), Configuration.getDefaultConfiguration());
    GDLearnerGraph ndGraph = new GDLearnerGraph(gr,LearnerGraphND.ignoreRejectStates, false);
    DetermineDiagonalAndRightHandSide matcher = ndGraph.new DDRH_default();
    getMatcherValue(gr,ndGraph,ndGraph.matrixForward, matcher,"A","C");
    Assert.assertEquals(0,matcher.getRightHandSide(),Configuration.fpAccuracy);
    getMatcherValue(gr,ndGraph,ndGraph.matrixForward, matcher,"S","C");
    Assert.assertEquals(0,matcher.getRightHandSide(),Configuration.fpAccuracy);
  }
View Full Code Here

Examples of statechum.analysis.learning.rpnicore.GDLearnerGraph.DetermineDiagonalAndRightHandSide

  {
    Configuration config = Configuration.getDefaultConfiguration().copy();
    LearnerGraph gr=new LearnerGraph(FsmParser.buildGraph("A-a-#B\nA-b-#B1\nA-c->C\nQ-a->R\nQ-b->S", "testCountMatchingOutgoing1"), config);
    gr.linear.moveRejectToHighlight();
    GDLearnerGraph ndGraph = new GDLearnerGraph(gr,LearnerGraphND.ignoreRejectStates, false);
    DetermineDiagonalAndRightHandSide matcher = ndGraph.new DDRH_highlight();
    getMatcherValue(gr,ndGraph,ndGraph.matrixForward, matcher,"A","C");
    Assert.assertEquals(0,matcher.getRightHandSide(),Configuration.fpAccuracy);
    getMatcherValue(gr,ndGraph,ndGraph.matrixForward, matcher,"S","C");
    Assert.assertEquals(0,matcher.getRightHandSide(),Configuration.fpAccuracy);
  }
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.