Package primitives.graph

Examples of primitives.graph.Node


        double f_m = f((ClusterNode)icl, g);
        f_values.put(icl, f_m);
        F += f_m;
      }else{
        //nodes;
        Node n;
        n = icl.getNodes().toArray(new Node[1])[0];
        double f_n = f(n,g);
        f_values.put(icl,f_n);
        F += f_n;
      }
    }
   
    for(IClusterLevel icl : f_values.keySet()){
      double f = f_values.get(icl);
      ret += l(-Math.log(f/F)  ) - f * Math.log(f/F)
    }
   
    //HIERARCHY ENCODING
    for(Node n : container.getNodesInLeaves()){
      for(Node nP : n.getTransitionsAsN()){
        ret += l(relativeDepth(container, lowestCommonAncestor(n,nP, ch), ch));
       
       
      }
     
View Full Code Here


        ClusterHead ch = new ClusterHead();
        Map<Integer, ClusterNode> parents = new HashMap<Integer, ClusterNode>();
        Set<Node> nodes = originalTree.getNodes();
        for (int i = 0; i < assignments.size(); i++) {
            int parentNumber = assignments.get(i).intValue();
            Node cur = nodenumbers.get(i + 1);



            if (cur == null) {
                throw new RuntimeException(String.format("ERROR: Missing node %d, known nodes: %s", i, nodenumbers.keySet()));
View Full Code Here

    assertFalse(c.encapsulates());
  }

  @Test
  public void testAddNode() {
    Node n = new Node("c");
    c.addNode(n);
    assertTrue(c.contains(n));
  }
View Full Code Here

    assertTrue(c.contains(n));
  }

  @Test
  public void testRemoveNode() {
    Node n = new Node("c");
    c.addNode(n);
    assertTrue(c.contains(n));

    assertFalse(c.contains(n));
  }
View Full Code Here

    assertFalse(c.contains(n));
  }

  @Test
  public void testContains() {
    Node n = new Node ("c");
    assertFalse(c.contains(n));
    assertTrue(c.contains(a));
    assertTrue(c.contains(b));
    c.addNode(n);
    assertTrue(c.contains(n));
View Full Code Here

  Node outsideOut;
  Node a,b;
  @Before
  public void setUp() throws Exception {
    c = new ClusterNode();
    a = new Node("a");
    b = new Node("b");
    outsideIn = new Node("outside -> in ");
    outsideOut = new Node("cluster -> outside");
    c.addNode(a);
    c.addNode(b);
    outsideIn.connect(a," a ");
    b.connect(outsideOut, " b ");
  }
View Full Code Here

    assertTrue(c.encapsulates());
  }

  @Test
  public void testAddNode() {
    Node n = new Node("c");
    c.addNode(n);
    assertTrue(c.contains(n));
  }
View Full Code Here

    assertTrue(c.contains(n));
  }

  @Test
  public void testRemoveNode() {
    Node n = new Node("c");
    c.addNode(n);
    assertTrue(c.contains(n));

  }
View Full Code Here

  }

  @Test
  public void testContains() {
    Node n = new Node ("c");
    assertFalse(c.contains(n));
    assertTrue(c.contains(a));
    assertTrue(c.contains(b));
    c.addNode(n);
    assertTrue(c.contains(n));
View Full Code Here

  ClusterHead head;
  Graph g;
  @Before
  public void setUp() throws Exception {
    c = new ClusterNode();
    a = new Node("a");
    b = new Node("b");
    g = new Graph();
    g.addNode(a);
    g.addNode(b);
    outsideIn = new Node("outside -> in ");
    outsideOut = new Node("cluster -> outside");
    c.addNode(a);
    c.addNode(b);
    outsideIn.connect(a," a ");
    b.connect(outsideOut, " b ");
    g.addNode(outsideIn);
View Full Code Here

TOP

Related Classes of primitives.graph.Node

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.