Changeset 331 for trunk/EventBenchCore/src/de/ugoe/cs
- Timestamp:
- 12/19/11 14:24:13 (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
r223 r331 72 72 * length of the subsequences for which the coverage is analyzed; 73 73 * must be >0 74 * @throws InvalidParameterException 75 * thrown if observedSequences or sequences is null or length 76 * less than or equal to 0 74 77 */ 75 78 public CoverageCalculatorObserved( … … 77 80 Collection<List<? extends Event<?>>> sequences, int length) { 78 81 if (observedSequences == null) { 79 throw new InvalidParameterException("process must not be null"); 82 throw new InvalidParameterException( 83 "observed sequences must not be null"); 80 84 } 81 85 if (sequences == null) { … … 162 166 * subsequences are possible 163 167 * @return coverage percentage 168 * @throws InvalidParameterException 169 * thrown if process is null 164 170 */ 165 171 public double getCoveragePossibleNew(IStochasticProcess process) { 172 if (process == null) { 173 throw new InvalidParameterException("process must not be null"); 174 } 166 175 createSubSeqs(); 167 176 Collection<List<? extends Event<?>>> subSeqsGeneratedCopy = new LinkedHashSet<List<? extends Event<?>>>( … … 187 196 * which subsequences are possible 188 197 * @return coverage percentage 198 * @throws InvalidParameterException 199 * thrown if process is null 189 200 */ 190 201 public double getCoveragePossibleNewWeight(IStochasticProcess process) { 202 if (process == null) { 203 throw new InvalidParameterException("process must not be null"); 204 } 191 205 createSubSeqs(); 192 206 Collection<List<? extends Event<?>>> subSeqsGeneratedCopy = new LinkedHashSet<List<? extends Event<?>>>( … … 200 214 double weight = 0.0d; 201 215 for (List<? extends Event<?>> subSeq : subSeqsGeneratedCopy) { 202 weight += weightMap.get(subSeq); 216 Double currentWeight = weightMap.get(subSeq); 217 if( currentWeight!=null ) { 218 weight += currentWeight; 219 } 203 220 } 204 221 return weight; 205 222 } 206 223 207 224 /** 208 225 * <p> 209 226 * Returns the number of covered subsequences of length k. 210 227 * </p> 211 * 228 * 212 229 * @return number of covered subsequences 213 230 */ … … 216 233 return subSeqsObserved.size(); 217 234 } 218 235 219 236 /** 220 237 * <p> 221 238 * Returns the number of covered subsequences of length k. 222 239 * </p> 240 * 223 241 * @return number of covered subsequences 224 242 */ … … 227 245 return subSeqsGenerated.size(); 228 246 } 229 247 230 248 public int getNumNew() { 231 249 createSubSeqs(); … … 235 253 return subSeqsGeneratedCopy.size(); 236 254 } 237 238 255 239 256 /** -
trunk/EventBenchCore/src/de/ugoe/cs/eventbench/coverage/CoverageCalculatorProcess.java
r292 r331 81 81 * length of the subsequences for which the coverage is analyzed; 82 82 * must be >0 83 * @throws InvalidParameterException 84 * thrown if process or sequences is null or length less than or equal to 0 83 85 */ 84 86 public CoverageCalculatorProcess(IStochasticProcess process, … … 200 202 * @param newSequences 201 203 * new collection of sequences 204 * @throws InvalidParameterException 205 * thrown is newSequences is null 202 206 */ 203 207 public void setSequences(Collection<List<? extends Event<?>>> newSequences) { 208 if (newSequences == null) { 209 throw new InvalidParameterException("sequences must not be null"); 210 } 204 211 this.sequences = newSequences; 205 212 containedSubSeqs = null;
Note: See TracChangeset
for help on using the changeset viewer.