Changeset 1949
- Timestamp:
- 05/29/15 12:06:09 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-core-usability/src/main/java/de/ugoe/cs/autoquest/usability/RequiredInefficientActionsRule.java
r1918 r1949 24 24 import de.ugoe.cs.autoquest.eventcore.gui.Scroll; 25 25 import de.ugoe.cs.autoquest.tasktrees.treeifc.DefaultTaskInstanceTraversingVisitor; 26 import de.ugoe.cs.autoquest.tasktrees.treeifc.IEventTask;27 26 import de.ugoe.cs.autoquest.tasktrees.treeifc.IEventTaskInstance; 28 import de.ugoe.cs.autoquest.tasktrees.treeifc.I MarkingTemporalRelationship;27 import de.ugoe.cs.autoquest.tasktrees.treeifc.ISequence; 29 28 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 30 29 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskInstance; … … 48 47 UsabilityEvaluationResult results = new UsabilityEvaluationResult(taskModel); 49 48 50 Map<ITask, double[]> smellingTasks = getInefficientActionStatistics(taskModel.getTasks()); 49 Map<ISequence, double[]> smellingTasks = 50 getInefficientActionStatistics(taskModel.getTasks()); 51 51 52 analyzeTasksWithInefficientActions(smellingTasks, results, taskModel); 52 53 … … 57 58 * 58 59 */ 59 private void analyzeTasksWithInefficientActions(Map<I Task, double[]>smellingTasks,60 private void analyzeTasksWithInefficientActions(Map<ISequence, double[]> smellingTasks, 60 61 UsabilityEvaluationResult results, 61 62 ITaskModel taskModel) 62 63 { 63 64 64 for (Map.Entry<I Task, double[]> entry : smellingTasks.entrySet()) {65 for (Map.Entry<ISequence, double[]> entry : smellingTasks.entrySet()) { 65 66 DescriptiveStatistics stats = new DescriptiveStatistics(entry.getValue()); 66 67 … … 84 85 * 85 86 */ 86 private Map<I Task, double[]> getInefficientActionStatistics(Collection<ITask> tasks) {87 Map<I Task, double[]> inefficientActionRatios = new HashMap<ITask, double[]>();87 private Map<ISequence, double[]> getInefficientActionStatistics(Collection<ITask> tasks) { 88 Map<ISequence, double[]> inefficientActionRatios = new HashMap<ISequence, double[]>(); 88 89 89 90 for (ITask task : tasks) { 90 if (task MustBeChecked(task)) {91 double[] ratios = getRatiosOfInefficientActionsInInstances( task);91 if (task instanceof ISequence) { 92 double[] ratios = getRatiosOfInefficientActionsInInstances((ISequence) task); 92 93 93 94 for (int i = 0; i < ratios.length; i++) { 94 95 if (ratios[i] > 0) { 95 96 // there is at least on inefficient action 96 inefficientActionRatios.put( task, ratios);97 inefficientActionRatios.put((ISequence) task, ratios); 97 98 break; 98 99 } … … 107 108 * 108 109 */ 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(); 126 112 127 113 double[] ratios = new double[instances.size()];
Note: See TracChangeset
for help on using the changeset viewer.