Changeset 1887 for trunk


Ignore:
Timestamp:
03/05/15 11:37:37 (10 years ago)
Author:
pharms
Message:
  • extended and corrected task comparison
Location:
trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/taskequality
Files:
2 added
5 edited

Legend:

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

    r1294 r1887  
    341341            } 
    342342            else { 
     343                // pressing a key on the same target, e.g. a text field, usually has the same 
     344                // semantics 
    343345                return TaskEquality.SEMANTICALLY_EQUAL; 
    344346            } 
     
    389391        } 
    390392         
     393        // performing drag and drops on the same target usually have the same semantic meaning, 
     394        // i.e., the same function is called 
    391395        return TaskEquality.SEMANTICALLY_EQUAL; 
    392396    } 
     
    459463            } 
    460464            else { 
     465                // in most situations, the coordinates are not of interest. But if they are, then 
     466                // the event can be at most semantically equal 
    461467                return TaskEquality.SEMANTICALLY_EQUAL; 
    462468            } 
     
    468474    /** 
    469475     * <p> 
    470      * compares two mouse button interactions such as clicks, mouse button down, or double clicks. 
    471      * If both interactions have the same coordinates, they are lexically equal. Otherwise, they 
    472      * are semantically equal. Mouse clicks for which the coordinates make no lexical difference 
    473      * (see {@link #clickCoordinatesMakeLexicalDifference(IEventTarget)}) are treated as 
    474      * lexically equal. 
    475      * </p> 
    476      * <p> 
    477      * The provided equality level can be used to restrict the quality check to the given level. 
    478      * This is done for optimization purposes. The returned equality level is as concrete as 
    479      * the provided one. It may be more concrete if there is no difference regarding the 
    480      * comparison on the levels. 
    481      * </p> 
    482      * 
    483      * @param interaction1  the first mouse button interaction to compare 
    484      * @param interaction2  the second mouse button interaction to compare 
    485      * @param eventTarget   the event target on which the interactions happened (used within 
    486      *                      special comparisons like mouse clicks on buttons, where the coordinates 
    487      *                      can be ignored) 
     476     * compares two scrolls and considers them as lexically equal if they have the same coordinates. 
     477     * Otherwise, they are syntactically equal as the happen on the same target 
     478     * </p> 
     479     * 
     480     * @param interaction1  the first scroll interaction to compare 
     481     * @param interaction2  the second scroll interaction to compare 
    488482     * @param equalityLevel the equality level to be checked for 
    489483     *  
     
    494488                                        TaskEquality equalityLevel) 
    495489    { 
    496         if (equalityLevel.isAtLeast(TaskEquality.SYNTACTICALLY_EQUAL)) { 
     490        if (equalityLevel.isAtLeast(TaskEquality.LEXICALLY_EQUAL)) { 
    497491            int x1 = interaction1.getXPosition(); 
    498492            int x2 = interaction2.getXPosition(); 
     
    505499        } 
    506500         
    507         return TaskEquality.SEMANTICALLY_EQUAL; 
     501        return TaskEquality.SYNTACTICALLY_EQUAL; 
    508502    } 
    509503 
  • trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/taskequality/IterationComparisonRule.java

    r1294 r1887  
    192192        IIterationInstance iteration2 = (IIterationInstance) instance2; 
    193193 
    194         // if both sequences do not have children, they are equal although this doesn't make sense 
     194        // if both iterations do not have children, they are equal although this doesn't make sense 
    195195        if ((iteration1.size() == 0) && (iteration2.size() == 0)) { 
    196196            return true; 
  • trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/taskequality/SequenceComparisonRule.java

    r1294 r1887  
    147147        } 
    148148 
    149         TaskEquality resultingEquality = TaskEquality.LEXICALLY_EQUAL; 
     149        TaskEquality resultingEquality = requiredEqualityLevel != null ? 
     150            requiredEqualityLevel : TaskEquality.LEXICALLY_EQUAL; 
     151         
    150152        for (int i = 0; i < children1.size(); i++) { 
    151153            ITask child1 = children1.get(i); 
    152154            ITask child2 = children2.get(i); 
    153155 
    154             TaskEquality taskEquality = callRuleManager(child1, child2, requiredEqualityLevel); 
     156            // it is sufficient to check for the current at most achievable equality, i.e., 
     157            // the so far resulting equality 
     158            TaskEquality taskEquality = callRuleManager(child1, child2, resultingEquality); 
    155159 
    156160            if ((taskEquality == null) || (taskEquality == TaskEquality.UNEQUAL)) { 
     
    224228        } 
    225229 
    226         TaskEquality resultingEquality = TaskEquality.LEXICALLY_EQUAL; 
     230        TaskEquality resultingEquality = requiredEqualityLevel != null ? 
     231            requiredEqualityLevel : TaskEquality.LEXICALLY_EQUAL; 
     232         
    227233        for (int i = 0; i < sequence1.size(); i++) { 
    228234            ITaskInstance child1 = sequence1.get(i); 
    229235            ITaskInstance child2 = sequence2.get(i); 
    230236 
    231             TaskEquality taskEquality = callRuleManager(child1, child2, requiredEqualityLevel); 
     237            // it is sufficient to check for the current at most achievable equality, i.e., 
     238            // the so far resulting equality 
     239            TaskEquality taskEquality = callRuleManager(child1, child2, resultingEquality); 
    232240 
    233241            if ((taskEquality == null) || (taskEquality == TaskEquality.UNEQUAL)) { 
  • trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/taskequality/TaskEquality.java

    r1156 r1887  
    3535 * <p> 
    3636 * Tasks are lexically equal, if they represent the same events on a key stroke level to be 
    37  * carried out to execute the task. Identical tasks are also syntactically equal. 
     37 * carried out to execute the task. Identical tasks are also lexically equal. 
    3838 * </p> 
    3939 * <p> 
    40  * Nodes are syntactically equal, if they differ in their events on key stroke level, but the 
     40 * Tasks are syntactically equal, if they differ in their events on key stroke level, but the 
    4141 * syntactical result is the same. For example, entering the text "hello" into a text field can 
    4242 * be done by entering the letters in their correct order, but also by copying the text into the 
  • trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/taskequality/TaskEqualityRuleManager.java

    r1294 r1887  
    5858        mRuleIndex.add(new EventTaskComparisonRule()); 
    5959        mRuleIndex.add(new IterationComparisonRule()); 
     60        mRuleIndex.add(new OptionalComparisonRule()); 
    6061        mRuleIndex.add(new SequenceComparisonRule()); 
    6162        mRuleIndex.add(new SelectionComparisonRule()); 
    6263        mRuleIndex.add(new TaskAndIterationComparisonRule()); 
     64        mRuleIndex.add(new TaskAndOptionalComparisonRule()); 
    6365        mRuleIndex.add(new TaskAndSelectionComparisonRule()); 
    6466    } 
Note: See TracChangeset for help on using the changeset viewer.