Examples of addEdge()


Examples of org.graphstream.graph.implementations.SingleGraph.addEdge()

  graph.addNode("A");
  graph.addNode("B");
  graph.addNode("C");
  sleep();
  graph.addEdge("AB", "A", "B");
  graph.addEdge("BC", "B", "C");
  graph.addEdge("CA", "C", "A");
  sleep();

  // graph.clear();
View Full Code Here

Examples of org.integratedmodelling.riskwiz.bn.BeliefNetwork.addEdge()

        bn.addBeliefNode(bnodeHasRiver);
        bn.addBeliefNode(bnodePolution);
        bn.addBeliefNode(bnodeWaterSupply);

        // connecting nodes
        bn.addEdge(bnodeHasRiver, bnodeWaterSupply);
        bn.addEdge(bnodePolution, bnodeWaterSupply);

        // save the created network
        String filename = "MyNetwork.xml";
View Full Code Here

Examples of org.jamesii.core.util.graph.SimpleGraph.addEdge()

  /**
   * Tests the cycle detection.
   */
  public void testCycleDetection() {
    SimpleGraph simpleGraph = new SimpleGraph(5);
    simpleGraph.addEdge(new AnnotatedEdge<Integer, Double, Object>(0, 1));
    simpleGraph.addEdge(new AnnotatedEdge<Integer, Double, Object>(1, 2));
    simpleGraph.addEdge(new AnnotatedEdge<Integer, Double, Object>(2, 3));
    simpleGraph.addEdge(new AnnotatedEdge<Integer, Double, Object>(3, 4));
    List<Integer> cycle = CycleDetection.detectCycle(simpleGraph);
    assertTrue("There is no cycle in the given graph.", cycle.isEmpty());
View Full Code Here

Examples of org.jamesii.core.util.graph.trees.SimpleTree.addEdge()

   */
  public void testBFS() {
    BreadthFirstSearch<Integer> bfs = new BreadthFirstSearch<>();
    SimpleTree tree = new SimpleTree(4);
    tree.setTreeRoot(0);
    tree.addEdge(new AnnotatedEdge<Integer, Double, Object>(1, 0));
    tree.addEdge(new AnnotatedEdge<Integer, Double, Object>(2, 0));
    tree.addEdge(new AnnotatedEdge<Integer, Double, Object>(3, 0));
    ListCallBack lcb = new ListCallBack();
    bfs.traverse(tree, lcb);
    assertEquals(4, lcb.getVisited().size());
View Full Code Here

Examples of org.jamesii.perfdb.recording.selectiontrees.SelectionTree.addEdge()

    SelectionTree st = new SelectionTree(null);
    st.addVertices(nodes);
    if (nodes.length == 0) {
      return st;
    }
    st.addEdge(e(st.getRoot(), nodes[0]));
    for (int i = 1; i < nodes.length; i++) {
      st.addEdge(e(nodes[0], nodes[i]));
    }
    return st;
  }
View Full Code Here

Examples of org.jgraph.graph.Port.addEdge()

        Port target = (Port) edge.getTarget();
        // TODO: move validation in Editor
        if (isValidConnection(source, target))
        {
            source.addEdge(edge);
            target.addEdge(edge);
            // Use Edge to Connect Source and Target
            ConnectionSet cs = new ConnectionSet(edge, source, target);
            // Create a Map that holds the attributes for the edge
            AttributeMap attr = edge.getAttributes();// GraphConstants.createMap();
            // Construct a Map from cells to Maps (for insert)
View Full Code Here

Examples of org.jgrapht.graph.DirectedSubgraph.addEdge()

    DirectedGraph<GroundLiteral, DefaultEdge> depGraph = getDependencyGraph();


    for (DefaultEdge e : depGraph.edgeSet()) {
      if (supp.contains(depGraph.getEdgeSource(e)) && supp.contains(depGraph.getEdgeTarget(e))) {
        subGraph.addEdge(depGraph.getEdgeSource(e), depGraph.getEdgeTarget(e));
      }
    }

    //System.out.println(supp);
View Full Code Here

Examples of org.jgrapht.graph.SimpleDirectedGraph.addEdge()

   
    g.addVertex(v1);
        g.addVertex(v2);
        g.addVertex(v3);
        g.addVertex(v4);
        g.addEdge(v1, v2);
        g.addEdge(v2, v3);
        g.addEdge(v3, v4);
        g.addEdge(v4, v3);
       
        //graphx
View Full Code Here

Examples of org.jruby.ir.representations.CFG.addEdge()

        for (BasicBlock b: cfg.getBasicBlocks()) {
            if ((b != entry) && (b != exit)) {
                BasicBlock rb = ii.getRenamedBB(b);
                for (Edge<BasicBlock> e : cfg.getOutgoingEdges(b)) {
                    BasicBlock destination = e.getDestination().getData();
                    if (destination != exit) selfClone.addEdge(rb, ii.getRenamedBB(destination), e.getType());
                }
            }
        }

        return selfClone;
View Full Code Here

Examples of org.lab41.dendrite.metagraph.DendriteGraphTx.addEdge()

            Vertex srcDVertex = srcTx.addVertex(null);
            srcDVertex.setProperty("name", "D");
            srcDVertex.setProperty("age", 10);

            srcTx.addEdge(null, srcAVertex, srcBVertex, "friends");
            srcTx.addEdge(null, srcBVertex, srcCVertex, "enemies");
            srcTx.addEdge(null, srcCVertex, srcDVertex, "friends");
        } finally {
            srcTx.commit();
        }
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.