Examples of CmpVertex


Examples of statechum.DeterministicDirectedSparseGraph.CmpVertex

    LearnerGraph.copyGraphs(graph, graphWithPredictedTransitions);

    // in this part the tree is extended depend on their outgoing transition probabilities
     for(Entry<CmpVertex, Map<Label, MarkovOutcome>> outgoing:state_outgoing.entrySet())
     {
       CmpVertex currrent_state_to_explore_outgoing= outgoing.getKey();
       Map<Label, MarkovOutcome> list_of_outgoing = outgoing.getValue();
       for(Entry<Label, MarkovOutcome> out:list_of_outgoing.entrySet())
       {
         Map<Label, CmpVertex> already_outgoing = graph.transitionMatrix.get(currrent_state_to_explore_outgoing);
         assert already_outgoing!=null : "state "+currrent_state_to_explore_outgoing+" is not mentioned in the transition diagram";
View Full Code Here

Examples of statechum.DeterministicDirectedSparseGraph.CmpVertex

  public static List<StatePair> collectionOfSetsToPairs(Collection<Set<CmpVertex>> collectionOfSets)
  {
    List<StatePair> pairsList = new LinkedList<StatePair>();
    for(Collection<CmpVertex> vertices:collectionOfSets)
    {
      CmpVertex prevVertex = null;
      for(CmpVertex v:vertices)
      {
        if (prevVertex != null)
          pairsList.add(new StatePair(prevVertex,v));
        prevVertex = v;
View Full Code Here

Examples of statechum.DeterministicDirectedSparseGraph.CmpVertex

    assert graphToPath != null;
    boolean valid = true;
    MarkovClassifier cl = new MarkovClassifier(model,graph);
    for(Set<CmpVertex> set:cl.buildVerticesToMergeForPaths(whatToMerge))
    {
      CmpVertex expected = trimmedReference.getVertex(graphToPath.get(set.iterator().next()));
      for(CmpVertex v:set)
        if (trimmedReference.getVertex(graphToPath.get(v)) != expected)
        {
          valid = false;//System.out.println("INVALID MERGE: "+set);
          break;
View Full Code Here

Examples of statechum.DeterministicDirectedSparseGraph.CmpVertex

   
    Set<CmpVertex> uniquelyIdentifiableVertices = new TreeSet<CmpVertex>();
   
    for(Label l:referenceGraph.getCache().getAlphabet())
    {
      CmpVertex vertexIdentified = MarkovPassivePairSelection.checkSeqUniqueOutgoing(referenceGraph,Arrays.asList(new Label[]{l}));
      if(vertexIdentified != null)
        uniquelyIdentifiableVertices.add(vertexIdentified);
    }
   
    return (double)uniquelyIdentifiableVertices.size()/referenceGraph.getStateNumber();
View Full Code Here

Examples of statechum.DeterministicDirectedSparseGraph.CmpVertex

   
    Set<CmpVertex> identifiedVertices = new TreeSet<CmpVertex>();
   
    for(List<Label> l:whatToMerge)
    {
      CmpVertex vertexIdentified = MarkovPassivePairSelection.checkSeqUniqueOutgoing(referenceGraph,l);
      if (vertexIdentified != null)
        identifiedVertices.add(vertexIdentified);
    }
   
    return (double)identifiedVertices.size()/referenceGraph.getStateNumber();
View Full Code Here

Examples of statechum.DeterministicDirectedSparseGraph.CmpVertex

      if (entry.getKey().isAccept())
      {
        Map<Label, MarkovOutcome> predictions = predictTransitionsFromState(entry.getKey(), null, model.getChunkLen(), null);
        for(Entry<Label,MarkovOutcome> prediction:predictions.entrySet())
        {
          CmpVertex target = entry.getValue().get(prediction.getKey());
          assert prediction.getValue() != MarkovOutcome.failure;
          ++numberOfPredictions;
 
          if (prediction.getValue() == MarkovOutcome.positive)
          {
            if(target != null && target.isAccept())
              ++correctPredictions;
          }
          if (prediction.getValue() == MarkovOutcome.negative)
          {
            if (target == null || !target.isAccept())
              ++correctPredictions;
          }
        }
       
       
View Full Code Here

Examples of statechum.DeterministicDirectedSparseGraph.CmpVertex

  }
 
  @Test
  public final void testAM_colour2a()
  {
    CmpVertex vertB = new StringVertex("B");vertB.setColour(JUConstants.RED);
    CmpVertex vertC = new StringVertex("C");
    AMEquivalenceClass eq =new AMEquivalenceClass(Arrays.asList(new CmpVertex[]{
        new StringVertex("A"),vertB,vertC}));
    eq.computeMergedColour();
    Assert.assertTrue(eq.getMergedVertex().getColour() == JUConstants.RED);
  }
View Full Code Here

Examples of statechum.DeterministicDirectedSparseGraph.CmpVertex

  }

  @Test
  public final void testAM_colour2b()
  {
    CmpVertex vertB = new StringVertex("B");vertB.setColour(JUConstants.BLUE);
    CmpVertex vertC = new StringVertex("C");
    AMEquivalenceClass eq =new AMEquivalenceClass(Arrays.asList(new CmpVertex[]{
        new StringVertex("A"),vertB,vertC}));
    eq.computeMergedColour();
    Assert.assertTrue(eq.getMergedVertex().getColour() == JUConstants.BLUE);
  }
View Full Code Here

Examples of statechum.DeterministicDirectedSparseGraph.CmpVertex

  }

  @Test
  public final void testAM_colour2c()
  {
    CmpVertex vertB = new StringVertex("B");vertB.setColour(JUConstants.AMBER);
    CmpVertex vertC = new StringVertex("C");vertC.setColour(JUConstants.BLUE);
    AMEquivalenceClass eq =new AMEquivalenceClass(Arrays.asList(new CmpVertex[]{
        new StringVertex("A"),vertB,vertC}));
    eq.computeMergedColour();
    Assert.assertTrue(eq.getMergedVertex().getColour() == JUConstants.BLUE);
  }
View Full Code Here

Examples of statechum.DeterministicDirectedSparseGraph.CmpVertex

  }

  @Test
  public final void testAM_colour2d()
  {
    CmpVertex vertA = new StringVertex("A");vertA.setColour(JUConstants.AMBER);
    CmpVertex vertB = new StringVertex("B");
    CmpVertex vertC = new StringVertex("C");vertC.setColour(JUConstants.BLUE);
    AMEquivalenceClass eq =new AMEquivalenceClass(Arrays.asList(new CmpVertex[]{
        vertA,vertB,vertC}));
    eq.computeMergedColour();
    Assert.assertTrue(eq.getMergedVertex().getColour() == JUConstants.BLUE);
  }
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.