Changeset 126 for trunk/EventBenchCore/src/de
- Timestamp:
- 07/14/11 14:18:04 (13 years ago)
- Location:
- trunk/EventBenchCore/src/de/ugoe/cs/eventbench/coverage
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/EventBenchCore/src/de/ugoe/cs/eventbench/coverage/CoverageCalculatorObserved.java
r123 r126 122 122 createSubSeqs(); 123 123 Map<List<? extends Event<?>>, Double> weightMap = SequenceTools 124 .generateWeights(process, observedSequences);124 .generateWeights(process, subSeqsObserved); 125 125 126 126 Collection<List<? extends Event<?>>> subSeqsObservedCopy = new LinkedHashSet<List<? extends Event<?>>>( … … 128 128 subSeqsObservedCopy.retainAll(subSeqsGenerated); 129 129 double weight = 0.0d; 130 for (List<? extends Event<?>> subSeq : subSeqsObserved ) {130 for (List<? extends Event<?>> subSeq : subSeqsObservedCopy) { 131 131 weight += weightMap.get(subSeq); 132 132 } … … 204 204 return weight; 205 205 } 206 207 /** 208 * <p> 209 * Returns the number of covered subsequences of length k. 210 * </p> 211 * 212 * @return number of covered subsequences 213 */ 214 public int getNumObserved() { 215 createSubSeqs(); 216 return subSeqsObserved.size(); 217 } 218 219 /** 220 * <p> 221 * Returns the number of covered subsequences of length k. 222 * </p> 223 * @return 224 */ 225 public int getNumCovered() { 226 createSubSeqs(); 227 return subSeqsGenerated.size(); 228 } 229 230 public int getNumNew() { 231 createSubSeqs(); 232 Collection<List<? extends Event<?>>> subSeqsGeneratedCopy = new LinkedHashSet<List<? extends Event<?>>>( 233 subSeqsGenerated); 234 subSeqsGeneratedCopy.removeAll(subSeqsObserved); 235 return subSeqsGeneratedCopy.size(); 236 } 237 206 238 207 239 /** -
trunk/EventBenchCore/src/de/ugoe/cs/eventbench/coverage/CoverageCalculatorProcess.java
r125 r126 162 162 return weight; 163 163 } 164 165 /** 166 * <p> 167 * Returns the number of covered subsequences of length k. 168 * </p> 169 * @return number of covered subsequences 170 */ 171 public int getNumCovered() { 172 if (containedSubSeqs == null) { 173 containedSubSeqs = SequenceTools.containedSubSequences(sequences, 174 length); 175 } 176 return containedSubSeqs.size(); 177 } 178 179 /** 180 * <p> 181 * Returns the number of possible subsequences of length k according to the stochastic process. 182 * </p> 183 * 184 * @return number of possible subsequences 185 */ 186 public int getNumPossible() { 187 if (allPossibleSubSeqs == null) { 188 allPossibleSubSeqs = process.generateSequences(length); 189 } 190 return allPossibleSubSeqs.size(); 191 } 164 192 165 193 }
Note: See TracChangeset
for help on using the changeset viewer.