Ignore:
Timestamp:
05/29/15 12:06:09 (9 years ago)
Author:
pharms
Message:
  • changed smell detection to focus on sequences only
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/autoquest-core-usability/src/main/java/de/ugoe/cs/autoquest/usability/RequiredInefficientActionsRule.java

    r1918 r1949  
    2424import de.ugoe.cs.autoquest.eventcore.gui.Scroll; 
    2525import de.ugoe.cs.autoquest.tasktrees.treeifc.DefaultTaskInstanceTraversingVisitor; 
    26 import de.ugoe.cs.autoquest.tasktrees.treeifc.IEventTask; 
    2726import de.ugoe.cs.autoquest.tasktrees.treeifc.IEventTaskInstance; 
    28 import de.ugoe.cs.autoquest.tasktrees.treeifc.IMarkingTemporalRelationship; 
     27import de.ugoe.cs.autoquest.tasktrees.treeifc.ISequence; 
    2928import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 
    3029import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskInstance; 
     
    4847        UsabilityEvaluationResult results = new UsabilityEvaluationResult(taskModel); 
    4948 
    50         Map<ITask, double[]> smellingTasks = getInefficientActionStatistics(taskModel.getTasks()); 
     49        Map<ISequence, double[]> smellingTasks = 
     50            getInefficientActionStatistics(taskModel.getTasks()); 
     51         
    5152        analyzeTasksWithInefficientActions(smellingTasks, results, taskModel); 
    5253 
     
    5758     * 
    5859     */ 
    59     private void analyzeTasksWithInefficientActions(Map<ITask, double[]>      smellingTasks, 
     60    private void analyzeTasksWithInefficientActions(Map<ISequence, double[]>  smellingTasks, 
    6061                                                    UsabilityEvaluationResult results, 
    6162                                                    ITaskModel                taskModel) 
    6263    { 
    6364 
    64         for (Map.Entry<ITask, double[]> entry : smellingTasks.entrySet()) { 
     65        for (Map.Entry<ISequence, double[]> entry : smellingTasks.entrySet()) { 
    6566            DescriptiveStatistics stats = new DescriptiveStatistics(entry.getValue()); 
    6667             
     
    8485     *  
    8586     */ 
    86     private Map<ITask, double[]> getInefficientActionStatistics(Collection<ITask> tasks) { 
    87         Map<ITask, double[]> inefficientActionRatios = new HashMap<ITask, double[]>(); 
     87    private Map<ISequence, double[]> getInefficientActionStatistics(Collection<ITask> tasks) { 
     88        Map<ISequence, double[]> inefficientActionRatios = new HashMap<ISequence, double[]>(); 
    8889         
    8990        for (ITask task : tasks) { 
    90             if (taskMustBeChecked(task))  { 
    91                 double[] ratios = getRatiosOfInefficientActionsInInstances(task); 
     91            if (task instanceof ISequence)  { 
     92                double[] ratios = getRatiosOfInefficientActionsInInstances((ISequence) task); 
    9293                 
    9394                for (int i = 0; i < ratios.length; i++) { 
    9495                    if (ratios[i] > 0) { 
    9596                        // there is at least on inefficient action 
    96                         inefficientActionRatios.put(task, ratios); 
     97                        inefficientActionRatios.put((ISequence) task, ratios); 
    9798                        break; 
    9899                    } 
     
    107108     * 
    108109     */ 
    109     private boolean taskMustBeChecked(ITask task) { 
    110         if ((task instanceof IEventTask) || (task instanceof IMarkingTemporalRelationship)) { 
    111             // event tasks are not considered 
    112             // marking temporal relationships have a child, that is more important, but it will 
    113             // be checked independently as all tasks of a task model are checked separately 
    114             return false; 
    115         } 
    116         else { 
    117             return true; 
    118         } 
    119     } 
    120  
    121     /** 
    122      * 
    123      */ 
    124     private double[] getRatiosOfInefficientActionsInInstances(ITask task) { 
    125         Collection<ITaskInstance> instances = task.getInstances(); 
     110    private double[] getRatiosOfInefficientActionsInInstances(ISequence sequence) { 
     111        Collection<ITaskInstance> instances = sequence.getInstances(); 
    126112         
    127113        double[] ratios = new double[instances.size()]; 
Note: See TracChangeset for help on using the changeset viewer.