Changeset 118 for trunk/EventBenchCore/src
- Timestamp:
- 07/12/11 16:52:27 (13 years ago)
- Location:
- trunk/EventBenchCore/src/de/ugoe/cs/eventbench
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/EventBenchCore/src/de/ugoe/cs/eventbench/coverage/CoverageCalculator.java
r114 r118 178 178 double sum = 0.0; 179 179 for (List<? extends Event<?>> sequence : sequences) { 180 double prob = 1.0; 181 List<Event<?>> context = new LinkedList<Event<?>>(); 182 for (Event<?> event : sequence) { 183 prob *= process.getProbability(context, event); 184 context.add(event); 185 } 180 double prob = process.getProbability(sequence); 186 181 subSeqWeights.put(sequence, prob); 187 182 sum += prob; -
trunk/EventBenchCore/src/de/ugoe/cs/eventbench/models/IStochasticProcess.java
r102 r118 32 32 */ 33 33 double getProbability(List<? extends Event<?>> context, Event<?> symbol); 34 35 /** 36 * <p> 37 * Returns the probabilitiy that a given sequence is generated by the stochastic process. 38 * </p> 39 * @param sequence sequences of which the probability is calculated 40 * @return probability of the sequences; 1.0 if sequence is empty or null 41 */ 42 double getProbability(List<? extends Event<?>> sequence); 34 43 35 44 /** -
trunk/EventBenchCore/src/de/ugoe/cs/eventbench/models/TrieBasedModel.java
r102 r118 274 274 */ 275 275 @Override 276 public Collection<List<? extends Event<?>>> generateValidSequences(int length) { 276 public Collection<List<? extends Event<?>>> generateValidSequences( 277 int length) { 277 278 // check for min-length implicitly done by generateSequences 278 Collection<List<? extends Event<?>>> allSequences = generateSequences( length,279 true);279 Collection<List<? extends Event<?>>> allSequences = generateSequences( 280 length, true); 280 281 Collection<List<? extends Event<?>>> validSequences = new LinkedHashSet<List<? extends Event<?>>>(); 281 282 for (List<? extends Event<?>> sequence : allSequences) { … … 288 289 } 289 290 291 /* 292 * (non-Javadoc) 293 * 294 * @see 295 * de.ugoe.cs.eventbench.models.IStochasticProcess#getProbability(java.util 296 * .List) 297 */ 298 @Override 299 public double getProbability(List<? extends Event<?>> sequence) { 300 double prob = 1.0; 301 if (sequence != null) { 302 List<Event<?>> context = new LinkedList<Event<?>>(); 303 for (Event<?> event : sequence) { 304 prob *= getProbability(context, event); 305 context.add(event); 306 } 307 } 308 return prob; 309 } 310 290 311 }
Note: See TracChangeset
for help on using the changeset viewer.