private double calculateNodeTimes(TreeModel tree,NodeRef node){
  NodeRef parent=tree.getParent(node);
  double time0=0.0;
  if (!tree.isExternal(node)) {
    NodeRef child1=tree.getChild(node,0);
    double t1=calculateNodeTimes(tree,child1);
    NodeRef child2=tree.getChild(node,1);
    double t2=calculateNodeTimes(tree,child2);
    time0=(t1 + t2) / 2.0;
  }
  if (parent == null)   return 0.0;
  double branchTime=tree.getNodeHeight(parent) - tree.getNodeHeight(node);
  double time1=time0 + branchTime;
  nodeTimes[node.getNumber()]=time0;
  return time1;
}

private double calculateNodeTimes ( TreeModel tree , NodeRef node ) { NodeRef parent = tree . getParent ( node ) ; double time0 = 0.0 ; if ( ! tree . isExternal ( node ) ) { NodeRef child1 = tree . getChild ( node , 0 ) ; double t1 = calculateNodeTimes ( tree , child1 ) ; NodeRef child2 = tree . getChild ( node , 1 ) ; double t2 = calculateNodeTimes ( tree , child2 ) ; time0 = ( t1 + t2 ) / 2.0 ; } if ( parent == null ) return 0.0 ; double branchTime = tree . getNodeHeight ( parent ) - tree . getNodeHeight ( node ) ; double time1 = time0 + branchTime ; nodeTimes [ node . getNumber ( ) ] = time0 ; return time1 ; }
traverse the tree calculating partial likelihoods .
