Package statechum.analysis.learning

Examples of statechum.analysis.learning.MarkovClassifier$FrontLineElem


  public void testBuildVerticesToMergeForPath2()
  {
    LearnerGraph gr=FsmParser.buildLearnerGraph("A-a->B / A-b->A / B-a->C-b->D-a->E / D-c->D / E-d->E","testBuildVerticesToMergeForPath1",config, converter);
    Collection<List<Label>> paths = new LinkedList<List<Label>>();paths.add(Arrays.asList(new Label[]{lblA}));paths.add(Arrays.asList(new Label[]{lblB}));paths.add(Arrays.asList(new Label[]{lblC}));
    //for(LearnerGraph g:grForPaths.values())  System.out.println(g.transitionMatrix);
    Collection<Set<CmpVertex>> collectionOfSets = new MarkovClassifier(new MarkovModel(2,true,true),gr).buildVerticesToMergeForPaths(paths);
    Assert.assertEquals(1,collectionOfSets.size());
    Iterator<Set<CmpVertex>> iterator = collectionOfSets.iterator();
    Set<CmpVertex> partA = new TreeSet<CmpVertex>();partA.addAll(gr.transitionMatrix.keySet());partA.remove(gr.findVertex("E"));
   
    Assert.assertEquals(partA, iterator.next());
View Full Code Here


  public void testBuildVerticesToMergeForPath3()
  {
    LearnerGraph gr=FsmParser.buildLearnerGraph("A-a->B / A-b->A / B-a->C-b->D-a->E / D-c->D / E-d->E","testBuildVerticesToMergeForPath3",config, converter);
    Collection<List<Label>> paths = new LinkedList<List<Label>>();paths.add(Arrays.asList(new Label[]{lblA}));paths.add(Arrays.asList(new Label[]{lblB}));paths.add(Arrays.asList(new Label[]{lblC}));paths.add(Arrays.asList(new Label[]{lblD}));
    //for(LearnerGraph g:grForPaths.values())  System.out.println(g.transitionMatrix);
    Collection<Set<CmpVertex>> collectionOfSets=new MarkovClassifier(new MarkovModel(2,true,true),gr).buildVerticesToMergeForPaths(paths);
    Assert.assertEquals(2,collectionOfSets.size());
    Iterator<Set<CmpVertex>> iterator = collectionOfSets.iterator();
    Set<CmpVertex> partA = new TreeSet<CmpVertex>();partA.addAll(gr.transitionMatrix.keySet());partA.remove(gr.findVertex("E"));
    Set<CmpVertex> partB = new TreeSet<CmpVertex>();partB.add(gr.findVertex("E"));
   
View Full Code Here

  public void testBuildVerticesToMergeForPath4()
  {
    LearnerGraph gr=FsmParser.buildLearnerGraph("A-a->B / A-b->A / B-a->C-d->D-a->E / D-c->D / E-d->E","testBuildVerticesToMergeForPath4",config, converter);
    Collection<List<Label>> paths = new LinkedList<List<Label>>();paths.add(Arrays.asList(new Label[]{lblA}));paths.add(Arrays.asList(new Label[]{lblB}));paths.add(Arrays.asList(new Label[]{lblC}));paths.add(Arrays.asList(new Label[]{lblD}));
    //for(LearnerGraph g:grForPaths.values())  System.out.println(g.transitionMatrix);
    Collection<Set<CmpVertex>> collectionOfSets=new MarkovClassifier(new MarkovModel(2,true,true),gr).buildVerticesToMergeForPaths(paths);
    Assert.assertEquals(2,collectionOfSets.size());
    Iterator<Set<CmpVertex>> iterator = collectionOfSets.iterator();
    Set<CmpVertex> partA = new TreeSet<CmpVertex>();partA.addAll(gr.transitionMatrix.keySet());partA.remove(gr.findVertex("E"));partA.remove(gr.findVertex("C"));
    Set<CmpVertex> partB = new TreeSet<CmpVertex>();partB.add(gr.findVertex("E"));partB.add(gr.findVertex("C"));
   
View Full Code Here

  @Test
  public void testBuildVerticesToMergeForPath5()
  {
    LearnerGraph gr=FsmParser.buildLearnerGraph("A-a->B / A-b->A / B-a->C-b->D-a->E / D-c->D / E-c->E-d->F-d->F-u->G-u->G","testBuildVerticesToMergeForPath5",config, converter);
    Collection<List<Label>> paths = new LinkedList<List<Label>>();paths.add(Arrays.asList(new Label[]{lblA}));paths.add(Arrays.asList(new Label[]{lblB}));paths.add(Arrays.asList(new Label[]{lblC}));paths.add(Arrays.asList(new Label[]{lblD}));paths.add(Arrays.asList(new Label[]{lblU}));
    Collection<Set<CmpVertex>> collectionOfSets=new MarkovClassifier(new MarkovModel(2,true,true),gr).buildVerticesToMergeForPaths(paths);
    Assert.assertEquals(1,collectionOfSets.size());
    Assert.assertEquals(gr.transitionMatrix.keySet(), collectionOfSets.iterator().next());
  }
View Full Code Here

  @Test
  public void testBuildVerticesToMergeForPath6()
  {
    LearnerGraph gr=FsmParser.buildLearnerGraph("B-a->C-b->D-a->E / D-c->D / E-c->E-d->F-d->F-u->G-u->G / Z-a->B / Z-b->Z","testBuildVerticesToMergeForPath6",config, converter);
    Collection<List<Label>> paths = new LinkedList<List<Label>>();paths.add(Arrays.asList(new Label[]{lblA}));paths.add(Arrays.asList(new Label[]{lblB}));paths.add(Arrays.asList(new Label[]{lblC}));paths.add(Arrays.asList(new Label[]{lblD}));paths.add(Arrays.asList(new Label[]{lblU}));
    Collection<Set<CmpVertex>> collectionOfSets=new MarkovClassifier(new MarkovModel(2,true,true),gr).buildVerticesToMergeForPaths(paths);
    Assert.assertEquals(1,collectionOfSets.size());
    Assert.assertEquals(gr.transitionMatrix.keySet(), collectionOfSets.iterator().next());
  }
View Full Code Here

  @Test
  public void testBuildVerticesToMergeForPath7a()
  {
    LearnerGraph gr=FsmParser.buildLearnerGraph("B-a->C-b->D-a->E / D-c->D / E-c->E-d->F-d->F-u->G-u->G / Z-a->B / Z-b->Z","testBuildVerticesToMergeForPath6",config, converter);
    Collection<List<Label>> paths = new LinkedList<List<Label>>();
    Collection<Set<CmpVertex>> collectionOfSets=new MarkovClassifier(new MarkovModel(2,true,true),gr).buildVerticesToMergeForPaths(paths);
    Assert.assertTrue(collectionOfSets.isEmpty());
  }
View Full Code Here

  @Test
  public void testBuildVerticesToMergeForPath7b()
  {
    LearnerGraph gr=new LearnerGraph(config);
    Collection<List<Label>> paths = new LinkedList<List<Label>>();paths.add(Arrays.asList(new Label[]{lblA}));paths.add(Arrays.asList(new Label[]{lblB}));paths.add(Arrays.asList(new Label[]{lblC}));
    Collection<Set<CmpVertex>> collectionOfSets=new MarkovClassifier(new MarkovModel(2,true,true),gr).buildVerticesToMergeForPaths(paths);
    Assert.assertTrue(collectionOfSets.isEmpty());
  }
View Full Code Here

  public void testBuildVerticesToMergeForPath8()
  {
    LearnerGraph gr=FsmParser.buildLearnerGraph("A-a->B / A-b->A / B-a->C-d->D-a->E / D-c->D / E-d->E-e->F-d->F-u->F / G-u->G","testBuildVerticesToMergeForPath8",config, converter);
    Collection<List<Label>> paths = new LinkedList<List<Label>>();paths.add(Arrays.asList(new Label[]{lblA}));paths.add(Arrays.asList(new Label[]{lblB}));paths.add(Arrays.asList(new Label[]{lblC}));paths.add(Arrays.asList(new Label[]{lblD}));paths.add(Arrays.asList(new Label[]{AbstractLearnerGraph.generateNewLabel("e", config, converter)}));paths.add(Arrays.asList(new Label[]{lblU}));
    //for(LearnerGraph g:grForPaths.values())  System.out.println(g.transitionMatrix);
    Collection<Set<CmpVertex>> collectionOfSets=new MarkovClassifier(new MarkovModel(2,true,true),gr).buildVerticesToMergeForPaths(paths);
    Assert.assertEquals(2,collectionOfSets.size());
    Iterator<Set<CmpVertex>> iterator = collectionOfSets.iterator();
    Set<CmpVertex> partA = new TreeSet<CmpVertex>();partA.add(gr.findVertex("A"));partA.add(gr.findVertex("B"));partA.add(gr.findVertex("D"));
    Set<CmpVertex> partB = new TreeSet<CmpVertex>();partB.add(gr.findVertex("C"));partB.add(gr.findVertex("E"));partB.add(gr.findVertex("F"));partB.add(gr.findVertex("G"));
   
View Full Code Here

  public void testBuildVerticesToMergeForPath9()
  {
    LearnerGraph gr=FsmParser.buildLearnerGraph("A-a->B / A-b->A / B-a->C-d->D-a->E / D-c->D / E-d->E-e->F-d->F-u->F / G-e->G","testBuildVerticesToMergeForPath8",config, converter);
    Collection<List<Label>> paths = new LinkedList<List<Label>>();paths.add(Arrays.asList(new Label[]{lblA}));paths.add(Arrays.asList(new Label[]{lblB}));paths.add(Arrays.asList(new Label[]{lblC}));paths.add(Arrays.asList(new Label[]{lblD}));paths.add(Arrays.asList(new Label[]{AbstractLearnerGraph.generateNewLabel("e", config, converter)}));paths.add(Arrays.asList(new Label[]{lblU}));
    //for(LearnerGraph g:grForPaths.values())  System.out.println(g.transitionMatrix);
    Collection<Set<CmpVertex>> collectionOfSets=new MarkovClassifier(new MarkovModel(2,true,true),gr).buildVerticesToMergeForPaths(paths);
    Assert.assertEquals(2,collectionOfSets.size());
    Iterator<Set<CmpVertex>> iterator = collectionOfSets.iterator();
    Set<CmpVertex> partA = new TreeSet<CmpVertex>();partA.add(gr.findVertex("A"));partA.add(gr.findVertex("B"));partA.add(gr.findVertex("D"));
    Set<CmpVertex> partB = new TreeSet<CmpVertex>();partB.add(gr.findVertex("C"));partB.add(gr.findVertex("E"));partB.add(gr.findVertex("F"));partB.add(gr.findVertex("G"));
   
View Full Code Here

  public void testBuildVerticesToMergeForPath10()
  {
    LearnerGraph gr=FsmParser.buildLearnerGraph("A-a->B / A-b->A / B-a->C-d->D-a->E / D-c->D / E-d->E-e->F-d->F-u->F / G-f->G","testBuildVerticesToMergeForPath8",config, converter);
    Collection<List<Label>> paths = new LinkedList<List<Label>>();paths.add(Arrays.asList(new Label[]{lblA}));paths.add(Arrays.asList(new Label[]{lblB}));paths.add(Arrays.asList(new Label[]{lblC}));paths.add(Arrays.asList(new Label[]{lblD}));paths.add(Arrays.asList(new Label[]{AbstractLearnerGraph.generateNewLabel("e", config, converter)}));paths.add(Arrays.asList(new Label[]{AbstractLearnerGraph.generateNewLabel("f", config, converter)}));paths.add(Arrays.asList(new Label[]{lblU}));
    //for(LearnerGraph g:grForPaths.values())  System.out.println(g.transitionMatrix);
    Collection<Set<CmpVertex>> collectionOfSets=new MarkovClassifier(new MarkovModel(2,true,true),gr).buildVerticesToMergeForPaths(paths);
    Assert.assertEquals(3,collectionOfSets.size());
    Iterator<Set<CmpVertex>> iterator = collectionOfSets.iterator();
    Set<CmpVertex> partA = new TreeSet<CmpVertex>();partA.add(gr.findVertex("A"));partA.add(gr.findVertex("B"));partA.add(gr.findVertex("D"));
    Set<CmpVertex> partB = new TreeSet<CmpVertex>();partB.add(gr.findVertex("C"));partB.add(gr.findVertex("E"));partB.add(gr.findVertex("F"));
    Set<CmpVertex> partC = new TreeSet<CmpVertex>();partC.add(gr.findVertex("G"));
View Full Code Here

TOP

Related Classes of statechum.analysis.learning.MarkovClassifier$FrontLineElem

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.