Ignore:
Timestamp:
03/05/15 11:43:42 (9 years ago)
Author:
pharms
Message:
  • remove support for tasks contexts in value measurements
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/treeimpl/TaskModel.java

    r1494 r1891  
    146146    } 
    147147 
     148    /* (non-Javadoc) 
     149     * @see java.lang.Object#toString() 
     150     */ 
     151    @Override 
     152    public String toString() { 
     153        return "Task Model (" + userSessions.size() + " sessions, " + index.taskMap.size() + 
     154            " tasks, hash " + System.identityHashCode(this) + ")"; 
     155    } 
     156 
    148157    /** 
    149158     * <p> 
     
    158167            for (IUserSession session : this.userSessions) { 
    159168                for (ITaskInstance taskInstance : session) { 
    160                     index.handleTaskInstance(taskInstance, null); 
     169                    index.handleTaskInstance(taskInstance); 
    161170                } 
    162171            } 
     
    187196                 
    188197                eventCoverageRatios[i++] = coverageRatio; 
    189                 info.setCount(TaskMetric.EVENT_COVERAGE_RATIO, null, coverageRatio); 
     198                info.setCount(TaskMetric.EVENT_COVERAGE_RATIO, coverageRatio); 
    190199            } 
    191200             
     
    201210                quantile = 1000 * quantile / eventCoverageRatios.length; 
    202211                 
    203                 info.setCount(TaskMetric.EVENT_COVERAGE_QUANTILE, null, quantile); 
     212                info.setCount(TaskMetric.EVENT_COVERAGE_QUANTILE, quantile); 
    204213            } 
    205214             
     
    242251         * </p> 
    243252         */ 
    244         private int[] handleTaskInstance(ITaskInstance taskInstance, ITask context) { 
     253        private int[] handleTaskInstance(ITaskInstance taskInstance) { 
    245254            int eventTaskInstancesCovered = 0; 
    246255            int depth = 0; 
     
    248257            if (taskInstance instanceof ITaskInstanceList) { 
    249258                for (ITaskInstance child : (ITaskInstanceList) taskInstance) { 
    250                     int[] measures = handleTaskInstance(child, taskInstance.getTask()); 
     259                    int[] measures = handleTaskInstance(child); 
    251260                    eventTaskInstancesCovered += measures[0]; 
    252261                    depth = Math.max(depth, measures[1]); 
     
    257266                { 
    258267                    // ensure also empty task infos for unselected variants 
    259                     ensureTaskInfo(((IIteration) taskInstance.getTask()).getMarkedTask(), context); 
     268                    ensureTaskInfo(((IIteration) taskInstance.getTask()).getMarkedTask()); 
    260269                } 
    261270            } 
    262271            else if (taskInstance instanceof ISelectionInstance) { 
    263272                ITaskInstance child = ((ISelectionInstance) taskInstance).getChild(); 
    264                 int[] measures = handleTaskInstance(child, taskInstance.getTask()); 
     273                int[] measures = handleTaskInstance(child); 
    265274                eventTaskInstancesCovered += measures[0]; 
    266275                depth = Math.max(depth, measures[1]); 
     
    268277                // ensure also empty task infos for unselected variants 
    269278                for (ITask otherChildTask : ((ISelection) taskInstance.getTask()).getChildren()) { 
    270                     ensureTaskInfo(otherChildTask, context); 
     279                    ensureTaskInfo(otherChildTask); 
    271280                } 
    272281            } 
     
    274283                ITaskInstance child = ((IOptionalInstance) taskInstance).getChild(); 
    275284                if (child != null) { 
    276                     int[] measures = handleTaskInstance(child, taskInstance.getTask()); 
     285                    int[] measures = handleTaskInstance(child); 
    277286                    eventTaskInstancesCovered += measures[0]; 
    278287                    depth = Math.max(depth, measures[1]); 
     
    280289                else { 
    281290                    // ensure also empty task infos for unselected variants 
    282                     ensureTaskInfo(((IOptional) taskInstance.getTask()).getMarkedTask(), context); 
     291                    ensureTaskInfo(((IOptional) taskInstance.getTask()).getMarkedTask()); 
    283292                } 
    284293            } 
     
    289298            depth++; 
    290299             
    291             ensureTaskInfo(taskInstance.getTask(), context, eventTaskInstancesCovered, depth); 
     300            ensureTaskInfo(taskInstance.getTask(), eventTaskInstancesCovered, depth); 
    292301             
    293302            return new int[] { eventTaskInstancesCovered, depth }; 
     
    299308         * </p> 
    300309         */ 
    301         private void ensureTaskInfo(ITask task, ITask context) { 
    302             ensureTaskInfo(task, context, 0, 0); 
     310        private void ensureTaskInfo(ITask task) { 
     311            ensureTaskInfo(task, 0, 0); 
    303312             
    304313            if (task instanceof IStructuringTemporalRelationship) { 
    305314                for (ITask child : ((IStructuringTemporalRelationship) task).getChildren()) { 
    306                     ensureTaskInfo(child, task); 
     315                    ensureTaskInfo(child); 
    307316                } 
    308317            } 
    309318            else if (task instanceof IMarkingTemporalRelationship) { 
    310                 ensureTaskInfo(((IMarkingTemporalRelationship) task).getMarkedTask(), task); 
     319                ensureTaskInfo(((IMarkingTemporalRelationship) task).getMarkedTask()); 
    311320            } 
    312321         
     
    322331         */ 
    323332        private void ensureTaskInfo(ITask task, 
    324                                     ITask context, 
    325333                                    int   eventTaskInstancesCovered, 
    326334                                    int   depth) 
     
    335343                taskMap.put(task, taskInfo); 
    336344                 
    337                 taskInfo.setCount(TaskMetric.DEPTH, null, getDepth(task)); 
    338             } 
    339  
    340             taskInfo.increaseCount(TaskMetric.COUNT, context, 1); 
    341             taskInfo.increaseCount(TaskMetric.EVENT_COVERAGE, context, eventTaskInstancesCovered); 
    342  
    343             taskInfo.setCount(TaskMetric.DEPTH, context, depth); 
     345                taskInfo.setCount(TaskMetric.DEPTH, getDepth(task)); 
     346            } 
     347 
     348            taskInfo.increaseCount(TaskMetric.COUNT, 1); 
     349            taskInfo.increaseCount(TaskMetric.EVENT_COVERAGE, eventTaskInstancesCovered); 
     350 
     351            taskInfo.setCount(TaskMetric.DEPTH, depth); 
    344352        } 
    345353 
Note: See TracChangeset for help on using the changeset viewer.