Ignore:
Timestamp:
03/18/13 11:54:15 (11 years ago)
Author:
pharms
Message:
  • complete refactoring of task detection
  • many performance improvements in task detection
  • improved merging of sequences using Myers diff algorithm
File:
1 edited

Legend:

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

    r1117 r1127  
    1515package de.ugoe.cs.autoquest.tasktrees.temporalrelation; 
    1616 
     17import java.util.List; 
     18 
    1719import de.ugoe.cs.autoquest.eventcore.gui.ValueSelection; 
    1820import de.ugoe.cs.autoquest.eventcore.guimodel.ITrackBar; 
    19 import de.ugoe.cs.autoquest.tasktrees.nodeequality.NodeEquality; 
    2021import de.ugoe.cs.autoquest.tasktrees.nodeequality.NodeEqualityRuleManager; 
    2122import de.ugoe.cs.autoquest.tasktrees.treeifc.IEventTask; 
     
    9798 
    9899        int index = 0; 
    99         while (index < parent.getChildren().size()) { 
    100             ITaskTreeNode child = parent.getChildren().get(index); 
     100        List<ITaskTreeNode> children = parent.getChildren(); 
     101         
     102        while (index < children.size()) { 
     103            ITaskTreeNode child = children.get(index); 
    101104 
    102105            if ((child instanceof IEventTask) && 
     
    128131            if (finalize) { 
    129132                handleValueSelections(parent, currentTrackBar, valueSelectionStartIndex, 
    130                                       parent.getChildren().size() - 1, result); 
     133                                      children.size() - 1, result); 
    131134            } 
    132135            else { 
    133                 result.setRuleApplicationStatus(RuleApplicationStatus.RULE_APPLICATION_FEASIBLE); 
     136                result.setRuleApplicationStatus(RuleApplicationStatus.FEASIBLE); 
    134137            } 
    135138        } 
     
    156159        taskTreeBuilder.setChild(iteration, selection); 
    157160 
     161        List<ITaskTreeNode> children = parent.getChildren(); 
     162         
    158163        for (int i = endIndex - startIndex; i >= 0; i--) { 
    159             addChildIfNecessary(selection, parent.getChildren().get(startIndex), result); 
     164            addChildIfNecessary(selection, children.get(startIndex), result); 
    160165            taskTreeBuilder.removeChild((ISequence) parent, startIndex); 
    161166        } 
     
    163168        taskTreeBuilder.addChild((ISequence) parent, startIndex, iteration); 
    164169 
    165         result.setRuleApplicationStatus(RuleApplicationStatus.RULE_APPLICATION_FINISHED); 
     170        result.setRuleApplicationStatus(RuleApplicationStatus.FINISHED); 
    166171    } 
    167172 
     
    173178                                     RuleApplicationResult result) 
    174179    { 
    175         for (int i = 0; i < parentSelection.getChildren().size(); i++) { 
    176             ITaskTreeNode child = parentSelection.getChildren().get(i); 
     180        List<ITaskTreeNode> children = parentSelection.getChildren(); 
     181         
     182        for (int i = 0; i < children.size(); i++) { 
     183            ITaskTreeNode child = children.get(i); 
    177184 
    178185            // check, if the new node is a variant for the current event task 
    179             NodeEquality nodeEquality = nodeEqualityRuleManager.applyRules(child, node); 
    180             if (nodeEquality.isAtLeast(NodeEquality.SYNTACTICALLY_EQUAL)) { 
     186            if (nodeEqualityRuleManager.areSyntacticallyEqual(child, node)) { 
    181187                return; 
    182188            } 
Note: See TracChangeset for help on using the changeset viewer.