- Timestamp:
- 03/05/15 11:37:37 (10 years ago)
- 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 341 341 } 342 342 else { 343 // pressing a key on the same target, e.g. a text field, usually has the same 344 // semantics 343 345 return TaskEquality.SEMANTICALLY_EQUAL; 344 346 } … … 389 391 } 390 392 393 // performing drag and drops on the same target usually have the same semantic meaning, 394 // i.e., the same function is called 391 395 return TaskEquality.SEMANTICALLY_EQUAL; 392 396 } … … 459 463 } 460 464 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 461 467 return TaskEquality.SEMANTICALLY_EQUAL; 462 468 } … … 468 474 /** 469 475 * <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 488 482 * @param equalityLevel the equality level to be checked for 489 483 * … … 494 488 TaskEquality equalityLevel) 495 489 { 496 if (equalityLevel.isAtLeast(TaskEquality. SYNTACTICALLY_EQUAL)) {490 if (equalityLevel.isAtLeast(TaskEquality.LEXICALLY_EQUAL)) { 497 491 int x1 = interaction1.getXPosition(); 498 492 int x2 = interaction2.getXPosition(); … … 505 499 } 506 500 507 return TaskEquality.S EMANTICALLY_EQUAL;501 return TaskEquality.SYNTACTICALLY_EQUAL; 508 502 } 509 503 -
trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/taskequality/IterationComparisonRule.java
r1294 r1887 192 192 IIterationInstance iteration2 = (IIterationInstance) instance2; 193 193 194 // if both sequences do not have children, they are equal although this doesn't make sense194 // if both iterations do not have children, they are equal although this doesn't make sense 195 195 if ((iteration1.size() == 0) && (iteration2.size() == 0)) { 196 196 return true; -
trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/taskequality/SequenceComparisonRule.java
r1294 r1887 147 147 } 148 148 149 TaskEquality resultingEquality = TaskEquality.LEXICALLY_EQUAL; 149 TaskEquality resultingEquality = requiredEqualityLevel != null ? 150 requiredEqualityLevel : TaskEquality.LEXICALLY_EQUAL; 151 150 152 for (int i = 0; i < children1.size(); i++) { 151 153 ITask child1 = children1.get(i); 152 154 ITask child2 = children2.get(i); 153 155 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); 155 159 156 160 if ((taskEquality == null) || (taskEquality == TaskEquality.UNEQUAL)) { … … 224 228 } 225 229 226 TaskEquality resultingEquality = TaskEquality.LEXICALLY_EQUAL; 230 TaskEquality resultingEquality = requiredEqualityLevel != null ? 231 requiredEqualityLevel : TaskEquality.LEXICALLY_EQUAL; 232 227 233 for (int i = 0; i < sequence1.size(); i++) { 228 234 ITaskInstance child1 = sequence1.get(i); 229 235 ITaskInstance child2 = sequence2.get(i); 230 236 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); 232 240 233 241 if ((taskEquality == null) || (taskEquality == TaskEquality.UNEQUAL)) { -
trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/taskequality/TaskEquality.java
r1156 r1887 35 35 * <p> 36 36 * 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. 38 38 * </p> 39 39 * <p> 40 * Nodes are syntactically equal, if they differ in their events on key stroke level, but the40 * Tasks are syntactically equal, if they differ in their events on key stroke level, but the 41 41 * syntactical result is the same. For example, entering the text "hello" into a text field can 42 42 * 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 58 58 mRuleIndex.add(new EventTaskComparisonRule()); 59 59 mRuleIndex.add(new IterationComparisonRule()); 60 mRuleIndex.add(new OptionalComparisonRule()); 60 61 mRuleIndex.add(new SequenceComparisonRule()); 61 62 mRuleIndex.add(new SelectionComparisonRule()); 62 63 mRuleIndex.add(new TaskAndIterationComparisonRule()); 64 mRuleIndex.add(new TaskAndOptionalComparisonRule()); 63 65 mRuleIndex.add(new TaskAndSelectionComparisonRule()); 64 66 }
Note: See TracChangeset
for help on using the changeset viewer.