Examples of CmpVertex


Examples of statechum.DeterministicDirectedSparseGraph.CmpVertex

        "G-b->A\nG-a->C\nG-b->F\n"+
        "F-a->A\nF-a->C\nF-a->G\n"
        , "TestGD_MultipleCasesOfRenamingA",config,converter),
      grB = buildLearnerGraphND(
        "B-x->B-a->D-u->D-v->D-b->"+stateC+"-b->D\n"+stateC+"-b->A\n"+stateC+"-b->G\n", "TestGD_MultipleCasesOfRenamingB_"+stateC,config,converter);
    CmpVertex disconnectedA1 = AbstractLearnerGraph.generateNewCmpVertex(VertexID.parseID("T"), config),
      disconnectedA2 = AbstractLearnerGraph.generateNewCmpVertex(VertexID.parseID("U"), config),
      disconnectedB2 = AbstractLearnerGraph.generateNewCmpVertex(VertexID.parseID("U"), config),
      disconnectedB3 = AbstractLearnerGraph.generateNewCmpVertex(VertexID.parseID("E"), config);
    disconnectedA1.setColour(JUConstants.BLUE);disconnectedA2.setColour(JUConstants.AMBER);
    disconnectedB2.setHighlight(true);disconnectedB3.setDepth(5);
    grA.transitionMatrix.put(disconnectedA1,grA.createNewRow());grA.transitionMatrix.put(disconnectedA2,grA.createNewRow());
    grB.transitionMatrix.put(disconnectedB2,grB.createNewRow());grB.transitionMatrix.put(disconnectedB3,grB.createNewRow());
   
    String [] expectedDuplicates = (stateC.equals("C"))? new String[]{ stateC,"A" }:new String[]{"A"};
View Full Code Here

Examples of statechum.DeterministicDirectedSparseGraph.CmpVertex

        new String[]{"A","F"},
        new String[]{"C","G"},
        new String[]{"C","F"}
    })
    {
      CmpVertex a=grA.findVertex(pair[0]),b=grA.findVertex(pair[1]);
      Assert.assertNotNull(a);Assert.assertNotNull(b);
      grA.addToCompatibility(a,b,JUConstants.PAIRCOMPATIBILITY.INCOMPATIBLE);
    }
   
    // add incompatibles for B
    for(String []pair:new String[][]{
        new String[]{"B","D"},
        new String[]{"B","E"},
        new String[]{stateC,"A"},
        new String[]{stateC,"G"},
        new String[]{stateC,"E"}
    })
    {
      CmpVertex a=grB.findVertex(pair[0]),b=grB.findVertex(pair[1]);
      Assert.assertNotNull("cannot find vertex "+pair[0]+" in grB",a);Assert.assertNotNull("cannot find vertex "+pair[1]+" in grB",b);
      if (!a.equals(b))
        grB.addToCompatibility(a,b,JUConstants.PAIRCOMPATIBILITY.INCOMPATIBLE);
    }

    String [] expectedDuplicates = (stateC.equals("C"))? new String[]{ stateC,"A" }:new String[]{"A"};
    runTest(grA,grB, "D",expectedDuplicates);
View Full Code Here

Examples of statechum.DeterministicDirectedSparseGraph.CmpVertex

  {
    assert o != null;
/*    if (!(o instanceof CmpVertex))
      throw new IllegalArgumentException("an attempt to compare "
        + toString() + " with a non-CmpVertex " + o.getName());*/
    CmpVertex v = o;
    if (this == v)
      return 0;
    return vertexId.compareTo(v.getID());
  }
View Full Code Here

Examples of statechum.DeterministicDirectedSparseGraph.CmpVertex

    if (this == obj)
      return true;
    if (!(obj instanceof CmpVertex))
      return false;
   
    final CmpVertex other = (CmpVertex) obj;
   
    if (vertexId == null)
      return other.getID() == null;
   
    return vertexId.equals(other.getID());
  }
View Full Code Here

Examples of statechum.DeterministicDirectedSparseGraph.CmpVertex

  public int compareTo(CmpVertex o) {
    assert o != null;
/*    if (!(o instanceof CmpVertex))
      throw new IllegalArgumentException("an attempt to compare "
        + toString() + " with a non-CmpVertex " + o.getName());*/
    CmpVertex v = o;
    if (this == v)
      return 0;
    return vertexId.compareTo(v.getID());
  }
View Full Code Here

Examples of statechum.DeterministicDirectedSparseGraph.CmpVertex

    if (this == obj)
      return true;
    if (!(obj instanceof CmpVertex))
      return false;
   
    final CmpVertex other = (CmpVertex) obj;
    if (isAccept() != other.isAccept())
      return false;
   
    if (vertexId == null)
      return other.getID() == null;
   
    return vertexId.equals(other.getID());
   
  }
View Full Code Here

Examples of statechum.DeterministicDirectedSparseGraph.CmpVertex

    return tracePath_internal(graph,path,0,startState);
  }
 
  public static <TARGET_TYPE,CACHE_TYPE extends CachedData<TARGET_TYPE,CACHE_TYPE>> boolean tracePath_internal(AbstractLearnerGraph<TARGET_TYPE,CACHE_TYPE> graph, List<Label> path, int startPos, CmpVertex startState)
  {
    CmpVertex current = startState;
    if (current == null)
      return false;// if we start from null (such as not found) state, fail immediately.
    if (startPos >= path.size())
      return startState.isAccept();
    if (!startState.isAccept())
View Full Code Here

Examples of statechum.DeterministicDirectedSparseGraph.CmpVertex

      }

        // in this part the tree is extended depending on what we learnt from traces.
         for(Entry<CmpVertex, Map<Label, UpdatablePairDouble>> outgoing:state_outgoing.entrySet())
         {
           CmpVertex currrent_state_to_explore_outgoing= outgoing.getKey();
           Map<Label, UpdatablePairDouble> list_of_outgoing = outgoing.getValue();
           for(Entry<Label, UpdatablePairDouble> 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";

             if(!already_outgoing.containsKey(out.getKey()))
             {                  
               if(out.getValue().firstElem >  highThreshold && out.getValue().secondElem <= lowThreshold && currrent_state_to_explore_outgoing.isAccept()==true)
               { 
                 if(!outcome.transitionMatrix.get(currrent_state_to_explore_outgoing).keySet().contains(out.getKey()))
                 {
                   extendWithLabel(outcome,currrent_state_to_explore_outgoing, true, out.getKey());
                 }                    
               }

               if(out.getValue().secondElem >  highThreshold && out.getValue().firstElem <= lowThreshold && currrent_state_to_explore_outgoing.isAccept()==true)
               { 
                 if(!outcome.transitionMatrix.get(currrent_state_to_explore_outgoing).keySet().contains(out.getKey()))
                 {
                   extendWithLabel(outcome,currrent_state_to_explore_outgoing, false, out.getKey());
                 }                    
View Full Code Here

Examples of statechum.DeterministicDirectedSparseGraph.CmpVertex

   * @param isAccept
   * @param input
   */
  public void extendWithLabel(LearnerGraph what, CmpVertex prevState, boolean isAccept, Label input)
  {
    CmpVertex newVertex = AbstractLearnerGraph.generateNewCmpVertex(what.nextID(isAccept),what.config);
    assert !what.transitionMatrix.containsKey(newVertex);
    newVertex.setAccept(isAccept);
    what.transitionMatrix.put(newVertex, what.createNewRow());
    what.addTransition(what.transitionMatrix.get(prevState),input,newVertex);
  }
View Full Code Here

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
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.