Ignore:
Timestamp:
06/25/14 22:02:05 (10 years ago)
Author:
rkrimmel
Message:

Code cleanup, removed alot of unneccessary code from pal sources

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ralph/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/pal/tree/NodeUtils.java

    r1573 r1579  
    1212 
    1313import de.ugoe.cs.autoquest.tasktrees.alignment.pal.io.FormattedOutput; 
    14 import de.ugoe.cs.autoquest.tasktrees.alignment.pal.misc.BranchLimits; 
    1514import de.ugoe.cs.autoquest.tasktrees.alignment.pal.misc.Identifier; 
    1615 
     
    119118        } 
    120119 
    121         /** 
    122          * determines branch lengths of this and all descendent nodes 
    123          * from heights 
    124          */ 
    125         public static void heights2Lengths(Node node) { 
    126                 heights2Lengths(node, true); //respect minimum 
    127         } 
    128  
    129         /** 
    130          * determines branch lengths of this and all descendent nodes 
    131          * from heights 
    132          */ 
    133         public static void heights2Lengths(Node node, boolean respectMinimum) { 
    134  
    135                 for (int i = 0; i < node.getChildCount(); i++) { 
    136                         heights2Lengths(node.getChild(i)); 
    137                 } 
    138  
    139                 if (node.isRoot()) { 
    140                         node.setBranchLength(0.0); 
    141                 } 
    142                 else { 
    143                         node.setBranchLength(node.getParent().getNodeHeight() - node.getNodeHeight()); 
    144                         if (respectMinimum && (node.getBranchLength() < BranchLimits.MINARC)) 
    145                         { 
    146                                 node.setBranchLength(BranchLimits.MINARC); 
    147                         } 
    148                 } 
    149         } 
    150  
    151         /** 
    152          * determines branch lengths of this node and its immediate descendent nodes 
    153          * from heights. 
    154          */ 
    155         public static void localHeights2Lengths(Node node, boolean respectMinimum) { 
    156  
    157                 for (int i = 0; i < node.getChildCount(); i++) { 
    158                         Node child = node.getChild(i); 
    159  
    160                         child.setBranchLength(node.getNodeHeight() - child.getNodeHeight()); 
    161                 } 
    162  
    163                 if (node.isRoot()) { 
    164                         node.setBranchLength(0.0); 
    165                 } 
    166                 else { 
    167                         node.setBranchLength(node.getParent().getNodeHeight() - node.getNodeHeight()); 
    168                         if (respectMinimum && (node.getBranchLength() < BranchLimits.MINARC)) 
    169                         { 
    170                                 node.setBranchLength(BranchLimits.MINARC); 
    171                         } 
    172                 } 
    173         } 
     120 
    174121 
    175122 
Note: See TracChangeset for help on using the changeset viewer.