Examples of checkFanoutInconsistency()


Examples of statechum.analysis.learning.MarkovUniversalLearner.checkFanoutInconsistency()

    final LearnerGraph graph = FsmParser.buildLearnerGraph("A-a->B / A-c->B / T-b->T-u->T","testCheckFanoutInconsistency1a",config, converter);
   
    Configuration shallowCopy = graph.config.copy();shallowCopy.setLearnerCloneGraph(false);
    LearnerGraphND Inverse_Graph = new LearnerGraphND(shallowCopy);
    AbstractPathRoutines.buildInverse(graph,LearnerGraphND.ignoreNone,Inverse_Graph)// do the inverse to the tentative graph
    Assert.assertEquals(0,m.checkFanoutInconsistency(Inverse_Graph,true,graph,graph.findVertex("B"),m.getChunkLen(), new MarkovUniversalLearner.DifferentPredictionsInconsistency(graph)));
  }
 
  /** One from B with inconsistent predictions. */
  @Test
  public void testCheckFanoutInconsistency1b1()
View Full Code Here

Examples of statechum.analysis.learning.MarkovUniversalLearner.checkFanoutInconsistency()

    final LearnerGraph graph = FsmParser.buildLearnerGraph("A-a->B / A-c->B / B-u->F / T-b->T-u->T","testCheckFanoutInconsistency1b1",config, converter);
   
    Configuration shallowCopy = graph.config.copy();shallowCopy.setLearnerCloneGraph(false);
    LearnerGraphND Inverse_Graph = new LearnerGraphND(shallowCopy);
    AbstractPathRoutines.buildInverse(graph,LearnerGraphND.ignoreNone,Inverse_Graph)// do the inverse to the tentative graph
    Assert.assertEquals(1,m.checkFanoutInconsistency(Inverse_Graph,true,graph,graph.findVertex("B"),m.getChunkLen(), new MarkovUniversalLearner.DifferentPredictionsInconsistency(graph)));
  }
 
  /** One from B where Markov cannot make up its mind. */
  @Test
  public void testCheckFanoutInconsistency1b2()
View Full Code Here

Examples of statechum.analysis.learning.MarkovUniversalLearner.checkFanoutInconsistency()

    final LearnerGraph graph = FsmParser.buildLearnerGraph("A-a->B / A-c->B / B-u->F / T-b->T-u->T","testCheckFanoutInconsistency1b2",config, converter);
   
    Configuration shallowCopy = graph.config.copy();shallowCopy.setLearnerCloneGraph(false);
    LearnerGraphND Inverse_Graph = new LearnerGraphND(shallowCopy);
    AbstractPathRoutines.buildInverse(graph,LearnerGraphND.ignoreNone,Inverse_Graph)// do the inverse to the tentative graph
    Assert.assertEquals(1,m.checkFanoutInconsistency(Inverse_Graph,true,graph,graph.findVertex("B"),m.getChunkLen(), new MarkovUniversalLearner.DifferentPredictionsInconsistency(graph)));
  }
 
  /** Transition d exists as positive but should be present as negative according to Markov. */
  @Test
  public void testCheckFanoutInconsistency1c()
View Full Code Here

Examples of statechum.analysis.learning.MarkovUniversalLearner.checkFanoutInconsistency()

    final LearnerGraph graph = FsmParser.buildLearnerGraph("A-a->B / A-c->B / B-d->F / T-b->T-u->T-d->T","testCheckFanoutInconsistency1c",config, converter);
   
    Configuration shallowCopy = graph.config.copy();shallowCopy.setLearnerCloneGraph(false);
    LearnerGraphND Inverse_Graph = new LearnerGraphND(shallowCopy);
    AbstractPathRoutines.buildInverse(graph,LearnerGraphND.ignoreNone,Inverse_Graph)// do the inverse to the tentative graph
    Assert.assertEquals(1,m.checkFanoutInconsistency(Inverse_Graph,true,graph,graph.findVertex("B"),m.getChunkLen(), new MarkovUniversalLearner.DifferentPredictionsInconsistency(graph)));
  }
 
  /** Transition d exists as positive but should be absent according to Markov. */
  @Test
  public void testCheckFanoutInconsistency1d()
View Full Code Here

Examples of statechum.analysis.learning.MarkovUniversalLearner.checkFanoutInconsistency()

    final LearnerGraph graph = FsmParser.buildLearnerGraph("A-a->B / A-c->B / B-d->F / T-b->T-u->T-d->T","testCheckFanoutInconsistency1d",config, converter);
   
    Configuration shallowCopy = graph.config.copy();shallowCopy.setLearnerCloneGraph(false);
    LearnerGraphND Inverse_Graph = new LearnerGraphND(shallowCopy);
    AbstractPathRoutines.buildInverse(graph,LearnerGraphND.ignoreNone,Inverse_Graph)// do the inverse to the tentative graph
    Assert.assertEquals(1,m.checkFanoutInconsistency(Inverse_Graph,true,graph,graph.findVertex("B"),m.getChunkLen(), new MarkovUniversalLearner.DifferentPredictionsInconsistency(graph)));
  }
 
  /** Transition b exists as negative but should be present as positive according to Markov. */
  @Test
  public void testCheckFanoutInconsistency1e()
View Full Code Here

Examples of statechum.analysis.learning.MarkovUniversalLearner.checkFanoutInconsistency()

    Assert.assertTrue(m.getMarkov(true).isEmpty());
    Assert.assertEquals(9,m.getMarkov(false).size());
   
    final LearnerGraph graph2 = FsmParser.buildLearnerGraph("A-s->B","testCheckFanoutInconsistencySideways1",config, converter);
    final AtomicInteger counterA=new AtomicInteger(0),counterB=new AtomicInteger(0);
    Assert.assertEquals(0,m.checkFanoutInconsistency(graph2,false,graph2,graph2.getInit(),m.getChunkLen(), new MarkovUniversalLearner.ConsistencyChecker(){

      @Override
      public boolean consistent(MarkovOutcome actual,MarkovOutcome predicted) {
        Assert.assertEquals(MarkovOutcome.positive,actual);Assert.assertNull(predicted);
        counterA.addAndGet(1);
View Full Code Here

Examples of statechum.analysis.learning.MarkovUniversalLearner.checkFanoutInconsistency()

    Assert.assertTrue(m.getMarkov(true).isEmpty());
    Assert.assertEquals(9,m.getMarkov(false).size());
   
    final LearnerGraph graph2 = FsmParser.buildLearnerGraph("A-a->B-a->B-b->B","testCheckFanoutInconsistencySideways2",config, converter);
    graph2.transitionMatrix.get(graph2.getInit()).clear();// make it look like a graph has no transitions
    Assert.assertEquals(0,m.checkFanoutInconsistency(graph2,false,graph2,graph2.getInit(),m.getChunkLen(), new MarkovUniversalLearner.ConsistencyChecker(){

      @SuppressWarnings("unused")
      @Override
      public boolean consistent(MarkovOutcome actual,MarkovOutcome predicted) {
        Assert.fail("should not be called");
View Full Code Here

Examples of statechum.analysis.learning.MarkovUniversalLearner.checkFanoutInconsistency()

    Assert.assertTrue(m.getMarkov(true).isEmpty());
    Assert.assertEquals(9,m.getMarkov(false).size());
   
    final LearnerGraph graph2 = FsmParser.buildLearnerGraph("A-a->B","testCheckFanoutInconsistencySideways3",config, converter);
    final AtomicInteger counterA=new AtomicInteger(0),counterB=new AtomicInteger(0);
    Assert.assertEquals(0,m.checkFanoutInconsistency(graph2,false,graph2,graph2.getInit(),m.getChunkLen(), new MarkovUniversalLearner.ConsistencyChecker(){

      @SuppressWarnings("unused")
      @Override
      public boolean consistent(MarkovOutcome actual,MarkovOutcome predicted) {
        counterA.addAndGet(1);
View Full Code Here

Examples of statechum.analysis.learning.MarkovUniversalLearner.checkFanoutInconsistency()

    Assert.assertTrue(m.getMarkov(true).isEmpty());
    Assert.assertEquals(9,m.getMarkov(false).size());
   
    final LearnerGraph graph2 = FsmParser.buildLearnerGraph("A-a->B / A-c->A","testCheckFanoutInconsistencySideways4",config, converter);
    final AtomicInteger counterA=new AtomicInteger(0),counterB=new AtomicInteger(0);
    Assert.assertEquals(0,m.checkFanoutInconsistency(graph2,false,graph2,graph2.getInit(),m.getChunkLen(), new MarkovUniversalLearner.ConsistencyChecker(){

      @SuppressWarnings("unused")
      @Override
      public boolean consistent(MarkovOutcome actual,MarkovOutcome predicted) {
        counterA.addAndGet(1);
View Full Code Here

Examples of statechum.analysis.learning.MarkovUniversalLearner.checkFanoutInconsistency()

    Assert.assertTrue(m.getMarkov(true).isEmpty());
    Assert.assertEquals(9,m.getMarkov(false).size());
   
    final LearnerGraph graph2 = FsmParser.buildLearnerGraph("A-a->B","testCheckFanoutInconsistencySideways3",config, converter);
    final AtomicInteger counterA=new AtomicInteger(0),counterB=new AtomicInteger(0);
    Assert.assertEquals(0,m.checkFanoutInconsistency(graph2,false,graph2,graph2.getInit(),m.getChunkLen(), new MarkovUniversalLearner.ConsistencyChecker(){

      @SuppressWarnings("unused")
      @Override
      public boolean consistent(MarkovOutcome actual,MarkovOutcome predicted) {
        counterA.addAndGet(1);
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.