Changeset 1190
- Timestamp:
- 04/29/13 16:43:17 (12 years ago)
- Location:
- trunk
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/taskequality/IterationComparisonRuleTest.java
r1146 r1190 24 24 import de.ugoe.cs.autoquest.tasktrees.taskequality.IterationComparisonRule; 25 25 import de.ugoe.cs.autoquest.tasktrees.taskequality.TaskEquality; 26 import de.ugoe.cs.autoquest.tasktrees.taskequality.TaskEqualityRuleManager;27 26 import de.ugoe.cs.autoquest.tasktrees.treeifc.IIteration; 28 27 import de.ugoe.cs.autoquest.tasktrees.treeifc.ISelection; … … 44 43 @Test 45 44 public void test() { 46 TaskEqualityRuleManager manager = new TaskEqualityRuleManager();47 manager.init();48 49 45 ITaskFactory taskFactory = new TaskFactory(); 50 46 ITaskBuilder treeBuilder = new TaskBuilder(); 51 47 52 IterationComparisonRule rule = new IterationComparisonRule( manager);48 IterationComparisonRule rule = new IterationComparisonRule(); 53 49 54 50 IEventType eventType1 = new StringEventType("eventType1"); -
trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/taskequality/SelectionComparisonRuleTest.java
r1146 r1190 24 24 import de.ugoe.cs.autoquest.tasktrees.taskequality.TaskEquality; 25 25 import de.ugoe.cs.autoquest.tasktrees.taskequality.SelectionComparisonRule; 26 import de.ugoe.cs.autoquest.tasktrees.taskequality.TaskEqualityRuleManager;27 26 import de.ugoe.cs.autoquest.tasktrees.treeifc.ISelection; 28 27 import de.ugoe.cs.autoquest.tasktrees.treeifc.ISequence; … … 44 43 @Test 45 44 public void test() { 46 TaskEqualityRuleManager manager = new TaskEqualityRuleManager();47 manager.init();48 49 45 ITaskFactory taskFactory = new TaskFactory(); 50 46 ITaskBuilder treeBuilder = new TaskBuilder(); 51 47 52 SelectionComparisonRule rule = new SelectionComparisonRule( manager);48 SelectionComparisonRule rule = new SelectionComparisonRule(); 53 49 54 50 IEventType eventType1 = new StringEventType("eventType1"); -
trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/taskequality/SequenceComparisonRuleTest.java
r1146 r1190 24 24 import de.ugoe.cs.autoquest.tasktrees.taskequality.TaskEquality; 25 25 import de.ugoe.cs.autoquest.tasktrees.taskequality.SequenceComparisonRule; 26 import de.ugoe.cs.autoquest.tasktrees.taskequality.TaskEqualityRuleManager;27 26 import de.ugoe.cs.autoquest.tasktrees.treeifc.ISelection; 28 27 import de.ugoe.cs.autoquest.tasktrees.treeifc.ISequence; … … 44 43 @Test 45 44 public void test() { 46 TaskEqualityRuleManager manager = new TaskEqualityRuleManager();47 manager.init();48 49 45 ITaskFactory taskFactory = new TaskFactory(); 50 46 ITaskBuilder treeBuilder = new TaskBuilder(); 51 47 52 SequenceComparisonRule rule = new SequenceComparisonRule( manager);48 SequenceComparisonRule rule = new SequenceComparisonRule(); 53 49 54 50 IEventType eventType1 = new StringEventType("eventType1"); -
trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/taskequality/TaskAndIterationComparisonRuleTest.java
r1146 r1190 24 24 import de.ugoe.cs.autoquest.tasktrees.taskequality.TaskAndIterationComparisonRule; 25 25 import de.ugoe.cs.autoquest.tasktrees.taskequality.TaskEquality; 26 import de.ugoe.cs.autoquest.tasktrees.taskequality.TaskEqualityRuleManager;27 26 import de.ugoe.cs.autoquest.tasktrees.treeifc.IIteration; 28 27 import de.ugoe.cs.autoquest.tasktrees.treeifc.ISelection; … … 44 43 @Test 45 44 public void test() { 46 TaskEqualityRuleManager manager = new TaskEqualityRuleManager();47 manager.init();48 49 45 ITaskFactory taskFactory = new TaskFactory(); 50 46 ITaskBuilder treeBuilder = new TaskBuilder(); 51 47 52 TaskAndIterationComparisonRule rule = new TaskAndIterationComparisonRule( manager);48 TaskAndIterationComparisonRule rule = new TaskAndIterationComparisonRule(); 53 49 54 50 IEventType eventType1 = new StringEventType("eventType1"); -
trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/taskequality/TaskAndSelectionComparisonRuleTest.java
r1146 r1190 24 24 import de.ugoe.cs.autoquest.tasktrees.taskequality.TaskAndSelectionComparisonRule; 25 25 import de.ugoe.cs.autoquest.tasktrees.taskequality.TaskEquality; 26 import de.ugoe.cs.autoquest.tasktrees.taskequality.TaskEqualityRuleManager;27 26 import de.ugoe.cs.autoquest.tasktrees.treeifc.ISelection; 28 27 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskBuilder; … … 43 42 @Test 44 43 public void test() { 45 TaskEqualityRuleManager manager = new TaskEqualityRuleManager();46 manager.init();47 48 44 ITaskFactory taskFactory = new TaskFactory(); 49 45 ITaskBuilder treeBuilder = new TaskBuilder(); 50 46 51 TaskAndSelectionComparisonRule rule = new TaskAndSelectionComparisonRule( manager);47 TaskAndSelectionComparisonRule rule = new TaskAndSelectionComparisonRule(); 52 48 53 49 IEventType eventType1 = new StringEventType("eventType1"); -
trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/AbstractTemporalRelationshipTC.java
r1146 r1190 33 33 import de.ugoe.cs.autoquest.tasktrees.TaskTreeValidator; 34 34 import de.ugoe.cs.autoquest.tasktrees.taskequality.TaskEquality; 35 import de.ugoe.cs.autoquest.tasktrees.taskequality.TaskEqualityRuleManager;36 import de.ugoe.cs.autoquest.tasktrees.testutils.Utilities;37 35 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskInstanceList; 38 36 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskBuilder; … … 62 60 private TaskTreeEncoder encoder = new TaskTreeEncoder(); 63 61 64 /** */65 private TaskEqualityRuleManager taskEqualityRuleManager =66 Utilities.getTaskEqualityRuleManagerForTests();67 68 62 /** 69 63 * … … 97 91 parameters.add(taskBuilder); 98 92 } 99 else if (TaskEqualityRuleManager.class.equals(type)) {100 parameters.add(taskEqualityRuleManager);101 }102 93 else if (TaskEquality.class.equals(type)) { 103 94 parameters.add(TaskEquality.LEXICALLY_EQUAL); … … 192 183 parameters.add(taskBuilder); 193 184 } 194 else if (TaskEqualityRuleManager.class.equals(type)) {195 parameters.add(taskEqualityRuleManager);196 }197 185 else if (TaskEquality.class.equals(type)) { 198 186 parameters.add(TaskEquality.LEXICALLY_EQUAL); -
trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/taskequality/IterationComparisonRule.java
r1154 r1190 81 81 public class IterationComparisonRule implements TaskComparisonRule { 82 82 83 /** the rule manager for internally comparing tasks */84 private TaskEqualityRuleManager mRuleManager;85 86 /**87 * <p>88 * simple constructor to provide the rule with the task equality rule manager to be able89 * to perform comparisons of the children of provided tasks90 * </p>91 *92 * @param ruleManager the rule manager for comparing tasks93 */94 IterationComparisonRule(TaskEqualityRuleManager ruleManager) {95 super();96 mRuleManager = ruleManager;97 }98 99 83 /* (non-Javadoc) 100 84 * @see NodeComparisonRule#isApplicable(ITask, ITask) … … 319 303 { 320 304 if (requiredEqualityLevel == null) { 321 return mRuleManager.compare(child1, child2); 322 } 323 else if (mRuleManager.areAtLeastEqual(child1, child2, requiredEqualityLevel)) { 305 return TaskEqualityRuleManager.getInstance().compare(child1, child2); 306 } 307 else if (TaskEqualityRuleManager.getInstance().areAtLeastEqual 308 (child1, child2, requiredEqualityLevel)) 309 { 324 310 return requiredEqualityLevel; 325 311 } -
trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/taskequality/SelectionComparisonRule.java
r1154 r1190 37 37 */ 38 38 public class SelectionComparisonRule implements TaskComparisonRule { 39 40 /** the rule manager for internally comparing tasks */41 private TaskEqualityRuleManager mRuleManager;42 43 /**44 * <p>45 * simple constructor to provide the rule with the task equality rule manager to be able46 * to perform comparisons of the children of provided tasks47 * </p>48 *49 * @param ruleManager the rule manager for comparing tasks50 */51 SelectionComparisonRule(TaskEqualityRuleManager ruleManager) {52 super();53 mRuleManager = ruleManager;54 }55 39 56 40 /* (non-Javadoc) … … 263 247 { 264 248 if (requiredEqualityLevel == null) { 265 return mRuleManager.compare(child1, child2); 266 } 267 else if (mRuleManager.areAtLeastEqual(child1, child2, requiredEqualityLevel)) { 249 return TaskEqualityRuleManager.getInstance().compare(child1, child2); 250 } 251 else if (TaskEqualityRuleManager.getInstance().areAtLeastEqual 252 (child1, child2, requiredEqualityLevel)) 253 { 268 254 return requiredEqualityLevel; 269 255 } -
trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/taskequality/SequenceComparisonRule.java
r1154 r1190 32 32 */ 33 33 public class SequenceComparisonRule implements TaskComparisonRule { 34 35 /** the rule manager for internally comparing tasks */36 private TaskEqualityRuleManager mRuleManager;37 38 /**39 * <p>40 * simple constructor to provide the rule with the task equality rule manager to be able41 * to perform comparisons of the children of provided tasks42 * </p>43 *44 * @param ruleManager the rule manager for comparing tasks45 */46 SequenceComparisonRule(TaskEqualityRuleManager ruleManager) {47 super();48 mRuleManager = ruleManager;49 }50 34 51 35 /* (non-Javadoc) … … 154 138 { 155 139 if (requiredEqualityLevel == null) { 156 return mRuleManager.compare(child1, child2);140 return TaskEqualityRuleManager.getInstance().compare(child1, child2); 157 141 } 158 else if (mRuleManager.areAtLeastEqual(child1, child2, requiredEqualityLevel)) { 142 else if (TaskEqualityRuleManager.getInstance().areAtLeastEqual 143 (child1, child2, requiredEqualityLevel)) 144 { 159 145 return requiredEqualityLevel; 160 146 } -
trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/taskequality/TaskAndIterationComparisonRule.java
r1154 r1190 32 32 public class TaskAndIterationComparisonRule implements TaskComparisonRule { 33 33 34 /** the rule manager for internally comparing tasks */35 private TaskEqualityRuleManager mRuleManager;36 37 /**38 * <p>39 * simple constructor to provide the rule with the task equality rule manager to be able40 * to perform comparisons of the children of provided tasks41 * </p>42 *43 * @param ruleManager the rule manager for comparing tasks44 */45 TaskAndIterationComparisonRule(TaskEqualityRuleManager ruleManager) {46 super();47 mRuleManager = ruleManager;48 }49 50 34 /* (non-Javadoc) 51 35 * @see NodeComparisonRule#isApplicable(ITask, ITask) … … 172 156 { 173 157 if (requiredEqualityLevel == null) { 174 return mRuleManager.compare(child1, child2);158 return TaskEqualityRuleManager.getInstance().compare(child1, child2); 175 159 } 176 else if (mRuleManager.areAtLeastEqual(child1, child2, requiredEqualityLevel)) { 160 else if (TaskEqualityRuleManager.getInstance().areAtLeastEqual 161 (child1, child2, requiredEqualityLevel)) 162 { 177 163 return requiredEqualityLevel; 178 164 } -
trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/taskequality/TaskAndSelectionComparisonRule.java
r1154 r1190 33 33 public class TaskAndSelectionComparisonRule implements TaskComparisonRule { 34 34 35 /** the rule manager for internally comparing tasks */36 private TaskEqualityRuleManager mRuleManager;37 38 /**39 * <p>40 * simple constructor to provide the rule with the task equality rule manager to be able41 * to perform comparisons of the children of provided tasks42 * </p>43 *44 * @param ruleManager the rule manager for comparing tasks45 */46 TaskAndSelectionComparisonRule(TaskEqualityRuleManager ruleManager) {47 super();48 mRuleManager = ruleManager;49 }50 51 35 /* (non-Javadoc) 52 36 * @see NodeComparisonRule#isApplicable(ITask, ITask) … … 196 180 { 197 181 if (requiredEqualityLevel == null) { 198 return mRuleManager.compare(child1, child2);182 return TaskEqualityRuleManager.getInstance().compare(child1, child2); 199 183 } 200 else if (mRuleManager.areAtLeastEqual(child1, child2, requiredEqualityLevel)) { 184 else if (TaskEqualityRuleManager.getInstance().areAtLeastEqual 185 (child1, child2, requiredEqualityLevel)) 186 { 201 187 return requiredEqualityLevel; 202 188 } -
trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/taskequality/TaskEqualityRuleManager.java
r1189 r1190 57 57 mRuleIndex.add(new GUIEventTaskComparisonRule()); 58 58 mRuleIndex.add(new EventTaskComparisonRule()); 59 mRuleIndex.add(new IterationComparisonRule( this));60 mRuleIndex.add(new SequenceComparisonRule( this));61 mRuleIndex.add(new SelectionComparisonRule( this));62 mRuleIndex.add(new TaskAndIterationComparisonRule( this));63 mRuleIndex.add(new TaskAndSelectionComparisonRule( this));59 mRuleIndex.add(new IterationComparisonRule()); 60 mRuleIndex.add(new SequenceComparisonRule()); 61 mRuleIndex.add(new SelectionComparisonRule()); 62 mRuleIndex.add(new TaskAndIterationComparisonRule()); 63 mRuleIndex.add(new TaskAndSelectionComparisonRule()); 64 64 } 65 65
Note: See TracChangeset
for help on using the changeset viewer.