Changeset 1494


Ignore:
Timestamp:
04/11/14 11:22:05 (11 years ago)
Author:
pharms
Message:
  • state of the HCSE 2014 Paper. An appropriate tag will follow.
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  
    3434    EVENT_COVERAGE_RATIO("event coverage ratio", 
    3535                         "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, "%"); 
    3740     
    3841    /** 
  • trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/treeimpl/TaskModel.java

    r1423 r1494  
    1515package de.ugoe.cs.autoquest.tasktrees.treeimpl; 
    1616 
     17import java.util.Arrays; 
    1718import java.util.Collection; 
    1819import java.util.Collections; 
     
    6667          TaskMetric.DEPTH, 
    6768          TaskMetric.EVENT_COVERAGE, 
    68           TaskMetric.EVENT_COVERAGE_RATIO }; 
     69          TaskMetric.EVENT_COVERAGE_RATIO, 
     70          TaskMetric.EVENT_COVERAGE_QUANTILE }; 
    6971 
    7072    /** 
     
    169171            } 
    170172             
     173            int[] eventCoverageRatios = new int[tasks.size()]; 
     174            int i = 0; 
     175 
    171176            // add some further measures 
    172177            for (ITask task : tasks) { 
     
    175180                 
    176181                int coveredEvents = info.getMeasureValue(TaskMetric.EVENT_COVERAGE); 
     182                int coverageRatio = 0; 
    177183                 
    178184                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); 
    182204            } 
    183205             
Note: See TracChangeset for help on using the changeset viewer.