Ignore:
Timestamp:
10/06/11 19:07:39 (13 years ago)
Author:
sherbold
Message:
  • added method getNumTransitions to interface de.ugoe.cs.eventbench.models.IStochasticProcess and implemented it in implementing classes
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/EventBenchCore/src/de/ugoe/cs/eventbench/models/TrieNode.java

    r129 r248  
    318318                } 
    319319        } 
     320         
     321        /** 
     322         * <p>Returns the number of descendants of this node that are leafs. This does not only include direct children of this node, but all leafs in the sub-trie with this node as root. 
     323         * </p> 
     324         * @return 
     325         */ 
     326        protected int getNumLeafs() { 
     327                int numLeafs = 0; 
     328                for( TrieNode<T> child : children) { 
     329                        if( child.isLeaf() ) { 
     330                                numLeafs++; 
     331                        } else { 
     332                                numLeafs += child.getNumLeafs(); 
     333                        } 
     334                } 
     335                return numLeafs; 
     336        } 
    320337} 
Note: See TracChangeset for help on using the changeset viewer.