Package org.jamesii.core.util.graph

Examples of org.jamesii.core.util.graph.SimpleEdge


  public void setUp() {
    setUpBasicTree(simpleTree);
    setUpBasicTree(similarSimpleTree);

    nonSimilarSimpleTree1.setTreeRoot(0);
    nonSimilarSimpleTree1.addEdge(new SimpleEdge(1, 0));
    nonSimilarSimpleTree1.addEdge(new SimpleEdge(2, 1));

    nonSimilarSimpleTree2.setTreeRoot(0);
    nonSimilarSimpleTree2.addVertex(2);
    nonSimilarSimpleTree2.addEdge(new SimpleEdge(2, 0));
    nonSimilarSimpleTree2.addVertex(3);
    nonSimilarSimpleTree2.addEdge(new SimpleEdge(3, 0));
  }
View Full Code Here


   * @param tree
   *          the new up basic tree
   */
  protected void setUpBasicTree(SimpleTree tree) {
    tree.setTreeRoot(0);
    tree.addEdge(new SimpleEdge(1, 0));
    tree.addEdge(new SimpleEdge(2, 0));
  }
View Full Code Here

      graph.setLabel(actualVertex, 1.0);
      String[] neighbours = line.split(" ");

      for (String neighbour : neighbours) {
        if (neighbour.length() > 0) {
          graph.addEdge(new SimpleEdge(actualVertex, Integer
              .parseInt(neighbour) - 1, 1.0));
        }
      }

      line = file.readLine();
View Full Code Here

   *          the vertex a
   * @param vertexB
   *          the vertex b
   */
  protected void addEdge(SimpleGraph graph, int vertexA, int vertexB) {
    graph.addEdge(new SimpleEdge(vertexA, vertexB, rand.nextDouble()
        * UPPER_BOUND_RANDOM_NODE_WEIGHT));
    graph.setLabel(vertexB, rand.nextDouble() * UPPER_BOUND_RANDOM_NODE_WEIGHT);
  }
View Full Code Here

   *          the vertex a
   * @param vertexB
   *          the vertex b
   */
  protected void addEdge(SimpleTree tree, int vertexA, int vertexB) {
    tree.addEdge(new SimpleEdge(vertexA, vertexB, rand.nextDouble()
        * UPPER_BOUND_RANDOM_NODE_WEIGHT));
    tree.setLabel(vertexB, rand.nextDouble() * UPPER_BOUND_RANDOM_NODE_WEIGHT);
  }
View Full Code Here

TOP

Related Classes of org.jamesii.core.util.graph.SimpleEdge

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.