Package edu.uci.ics.jung.graph.impl

Examples of edu.uci.ics.jung.graph.impl.DirectedSparseVertex


  @Test
  public final void testTestGeneration1a()
  {
    config.setAllowedToCloneNonCmpVertex(true);
    DirectedSparseGraph g = new DirectedSparseGraph();
    DirectedSparseVertex init = new DirectedSparseVertex();
    init.addUserDatum(JUConstants.LABEL, "A", UserData.SHARED);
    init.addUserDatum(JUConstants.INITIAL, true, UserData.SHARED);
    init.addUserDatum(JUConstants.ACCEPTED, true, UserData.SHARED);
    g.addVertex(init);
    checkTestGenerationResult(new LearnerGraph(g,config),0, new String[][] {
        new String[] {}
      });
  }
View Full Code Here


  @Test
  public final void testTestGeneration1b()
  {
    config.setAllowedToCloneNonCmpVertex(true);
    DirectedSparseGraph g = new DirectedSparseGraph();
    DirectedSparseVertex init = new DirectedSparseVertex();
    init.addUserDatum(JUConstants.LABEL, "A", UserData.SHARED);
    init.addUserDatum(JUConstants.INITIAL, true, UserData.SHARED);
    init.addUserDatum(JUConstants.ACCEPTED, true, UserData.SHARED);
    g.addVertex(init);
    checkTestGenerationResult(new LearnerGraph(g,config),2, new String[][] {
        new String[] {}
      });
  }
View Full Code Here

  private static final long serialVersionUID = -7258812066189916399L;
  private Map<String, DirectedSparseVertex> nodeMap;
  private DirectedSparseGraph graph;

  private DirectedSparseVertex getVertex(String node) {
    DirectedSparseVertex v = nodeMap.get(node);
    if (v == null) {
      v = new DirectedSparseVertex();
      v.addUserDatum(JUConstants.LABEL, node, UserData.CLONE);
      v.addUserDatum(JUConstants.COLOUR, JUConstants.BLUE, UserData.SHARED);
      graph.addVertex(v);
      nodeMap.put(node, v);
    }
    return v;
  }
View Full Code Here

        // load the module
        try {
          System.out.println("Loading " + f.getName());
          Configuration config = Configuration.getDefaultConfiguration().copy();ErlangModule.setupErlangConfiguration(config,f);
          ErlangModule mod = ErlangModule.loadModule(config);
          DirectedSparseVertex myVertex = getVertex(mod.name);
          myVertex.setUserDatum(JUConstants.COLOUR, JUConstants.RED, UserData.SHARED);

          for (String d : mod.behaviour.getDependencies()) {
            DirectedSparseVertex v = getVertex(d);
            DirectedSparseEdge e = new DirectedSparseEdge(myVertex, v);
            e.setUserDatum(JUConstants.LABEL, new HashSet<Label>(), UserData.CLONE);
            graph.addEdge(e);
          }
          System.out.println("\tDone.");
View Full Code Here

    queue.add(0,init);
    int i=0;
    int j= queue.size();
    Set<Vertex> done = new HashSet<Vertex>();
    while(i<j){
      DirectedSparseVertex v = (DirectedSparseVertex)queue.get(i);
      done.add(v);
      Iterator succIt = v.getSuccessors().iterator();
      while(succIt.hasNext()){
        Vertex succ = (Vertex)succIt.next();
        if(!done.contains(succ))
          queue.add(succ);
      }
View Full Code Here

 
  @Test
  public final void testGetData_Empty1()
  {
    DirectedSparseGraph g = new DirectedSparseGraph();
    DirectedSparseVertex init = new DirectedSparseVertex();
    init.addUserDatum(JUConstants.INITIAL, true, UserData.SHARED);
    init.addUserDatum(JUConstants.ACCEPTED, false, UserData.SHARED);
    init.addUserDatum(JUConstants.LABEL, "A", UserData.SHARED);
    g.addVertex(init);
    PTASequenceEngine enVerySmall = new PTA_FSMStructure(new LearnerGraph(g,mainConfiguration),null);
    vertifyPTA(enVerySmall, 1, new String[][] {
        new String[] {}
      });
View Full Code Here

  @Test
  public final void testGetData_Empty2()
  {
    DirectedSparseGraph g = new DirectedSparseGraph();
    DirectedSparseVertex init = new DirectedSparseVertex();
    init.addUserDatum(JUConstants.INITIAL, true,UserData.SHARED);
    init.addUserDatum(JUConstants.ACCEPTED, true, UserData.SHARED);
    init.addUserDatum(JUConstants.LABEL, "A", UserData.SHARED);
    g.addVertex(init);
    PTASequenceEngine enVerySmall = new PTA_FSMStructure(new LearnerGraph(g,mainConfiguration),null);
    vertifyPTA(enVerySmall, 1, new String[][] {
        new String[] {}
    });
View Full Code Here

   */
  @Test
  public final void test_sequenceSet_testing_shouldBeReturned4()
  {
    DirectedSparseGraph g = new DirectedSparseGraph();
    DirectedSparseVertex init = new DirectedSparseVertex();
    init.addUserDatum(JUConstants.INITIAL, true, UserData.SHARED);
    init.addUserDatum(JUConstants.ACCEPTED, false, UserData.SHARED);
    init.addUserDatum(JUConstants.LABEL, "A", UserData.SHARED);
    g.addVertex(init);
    final LearnerGraph machine = new LearnerGraph(g,mainConfiguration);
    en = new PTA_FSMStructure(machine,null) {
      {
        init(machine.new FSMImplementation(){
View Full Code Here

  /** Tests that we choke on an empty graph. */
  @Test(expected=IllegalArgumentException.class)
  public final void test_containsSequence1_fail()
  {
    DirectedSparseGraph g = new DirectedSparseGraph();
    DirectedSparseVertex init = new DirectedSparseVertex();
    init.addUserDatum(JUConstants.INITIAL, true, UserData.SHARED);
    init.addUserDatum(JUConstants.ACCEPTED, false, UserData.SHARED);
    init.addUserDatum(JUConstants.LABEL, "A", UserData.SHARED);
    g.addVertex(init);
    PTASequenceEngine engine = new PTA_FSMStructure(new LearnerGraph(g,mainConfiguration),null);
    engine.containsSequence(new ArrayList<Label>());
  }
View Full Code Here

  /** FSMs used in testing of cloning. */
  private LearnerGraph testGraphJung,testGraphString,testGraphSame;

  static final protected OrigStatePair constructOrigPair(String a,String b)
  {
    DirectedSparseVertex aV = new DirectedSparseVertex(), bV = new DirectedSparseVertex();
    aV.addUserDatum(JUConstants.LABEL, a, UserData.SHARED);
    bV.addUserDatum(JUConstants.LABEL, b, UserData.SHARED);
    return new OrigStatePair(aV,bV);
  }
View Full Code Here

TOP

Related Classes of edu.uci.ics.jung.graph.impl.DirectedSparseVertex

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.