Changeset 1494 for trunk/autoquest-core-tasktrees
- Timestamp:
- 04/11/14 11:22:05 (11 years ago)
- Location:
- trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/treeifc/TaskMetric.java
r1423 r1494 34 34 EVENT_COVERAGE_RATIO("event coverage ratio", 35 35 "the ratio of events covered by this task in relation to all events " + 36 "covered by all tasks in their instances in per mille", 0.1, "%"); 36 "covered by all tasks in their instances in per mille", 0.1, "%"), 37 EVENT_COVERAGE_QUANTILE("event coverage ratio quantile", 38 "the quantile of with respect to all event coverages begining with " + 39 "the lowest", 0.1, "%"); 37 40 38 41 /** -
trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/treeimpl/TaskModel.java
r1423 r1494 15 15 package de.ugoe.cs.autoquest.tasktrees.treeimpl; 16 16 17 import java.util.Arrays; 17 18 import java.util.Collection; 18 19 import java.util.Collections; … … 66 67 TaskMetric.DEPTH, 67 68 TaskMetric.EVENT_COVERAGE, 68 TaskMetric.EVENT_COVERAGE_RATIO }; 69 TaskMetric.EVENT_COVERAGE_RATIO, 70 TaskMetric.EVENT_COVERAGE_QUANTILE }; 69 71 70 72 /** … … 169 171 } 170 172 173 int[] eventCoverageRatios = new int[tasks.size()]; 174 int i = 0; 175 171 176 // add some further measures 172 177 for (ITask task : tasks) { … … 175 180 176 181 int coveredEvents = info.getMeasureValue(TaskMetric.EVENT_COVERAGE); 182 int coverageRatio = 0; 177 183 178 184 if (allEventsCovered > 0) { 179 info.setCount(TaskMetric.EVENT_COVERAGE_RATIO, null, 180 ((coveredEvents * 1000) / allEventsCovered)); 181 } 185 coverageRatio = (coveredEvents * 1000) / allEventsCovered; 186 } 187 188 eventCoverageRatios[i++] = coverageRatio; 189 info.setCount(TaskMetric.EVENT_COVERAGE_RATIO, null, coverageRatio); 190 } 191 192 Arrays.sort(eventCoverageRatios); 193 194 // add some further measures 195 for (ITask task : tasks) { 196 TaskInfo info = index.taskMap.get(task); 197 info.addMeasure(TaskMetric.EVENT_COVERAGE_QUANTILE); 198 int quantile = Arrays.binarySearch 199 (eventCoverageRatios, info.getMeasureValue(TaskMetric.EVENT_COVERAGE_RATIO)); 200 201 quantile = 1000 * quantile / eventCoverageRatios.length; 202 203 info.setCount(TaskMetric.EVENT_COVERAGE_QUANTILE, null, quantile); 182 204 } 183 205
Note: See TracChangeset
for help on using the changeset viewer.