Changeset 248 for trunk/EventBenchCore/src
- Timestamp:
- 10/06/11 19:07:39 (13 years ago)
- Location:
- trunk/EventBenchCore/src/de/ugoe/cs/eventbench/models
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/EventBenchCore/src/de/ugoe/cs/eventbench/models/IStochasticProcess.java
r129 r248 32 32 */ 33 33 double getProbability(List<? extends Event<?>> context, Event<?> symbol); 34 34 35 35 /** 36 36 * <p> 37 * Returns the probabilitiy that a given sequence is generated by the stochastic process. 37 * Returns the probabilitiy that a given sequence is generated by the 38 * stochastic process. 38 39 * </p> 39 * @param sequence sequences of which the probability is calculated 40 * 41 * @param sequence 42 * sequences of which the probability is calculated 40 43 * @return probability of the sequences; 1.0 if sequence is empty or null 41 44 */ … … 97 100 * @return generated sequences 98 101 */ 99 public Collection<List<? extends Event<?>>> generateValidSequences(int length); 102 public Collection<List<? extends Event<?>>> generateValidSequences( 103 int length); 100 104 101 105 /** … … 117 121 */ 118 122 public String[] getSymbolStrings(); 119 123 120 124 /** 121 125 * <p> 122 * Returns the number of states the process would have if it would be flattened through state-splitting to a first-order Markov model. 126 * Returns the number of states the process would have if it would be 127 * flattened through state-splitting to a first-order Markov model. 123 128 * </p> 124 129 * <p> … … 126 131 * </p> 127 132 * 128 * @return number of states an equivalent FOM would have; -1 is not available 133 * @return number of states an equivalent FOM would have; -1 if not 134 * available 129 135 */ 130 136 public int getNumFOMStates(); 137 138 /** 139 * <p> 140 * Returns the number of transitions the process would have if it would be 141 * flattened through state-splitting to a first-order Markov model. 142 * </p> 143 * 144 * @return number of transitions an equivalent FOM would have; -1 if not 145 * available 146 */ 147 public int getNumTransitions(); 131 148 132 149 /** -
trunk/EventBenchCore/src/de/ugoe/cs/eventbench/models/Trie.java
r129 r248 386 386 return ancestors.size(); 387 387 } 388 389 /** 390 * <p> 391 * Returns the number of trie nodes that are leafs. 392 * </p> 393 * 394 * @return number of leafs in the trie 395 */ 396 public int getNumLeafs() { 397 return rootNode.getNumLeafs(); 398 } 388 399 } -
trunk/EventBenchCore/src/de/ugoe/cs/eventbench/models/TrieBasedModel.java
r182 r248 336 336 return trie.getNumLeafAncestors(); 337 337 } 338 339 /* 340 * (non-Javadoc) 341 * 342 * @see de.ugoe.cs.eventbench.models.IStochasticProcess#getNumTransitions() 343 */ 344 @Override 345 public int getNumTransitions() { 346 return trie.getNumLeafs(); 347 } 338 348 } -
trunk/EventBenchCore/src/de/ugoe/cs/eventbench/models/TrieNode.java
r129 r248 318 318 } 319 319 } 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 } 320 337 }
Note: See TracChangeset
for help on using the changeset viewer.