Changeset 1905
- Timestamp:
- 03/10/15 15:06:08 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/taskequality/SequenceComparisonRule.java
r1887 r1905 147 147 } 148 148 149 TaskEquality resultingEquality = requiredEqualityLevel != null ? 150 requiredEqualityLevel : TaskEquality.LEXICALLY_EQUAL; 149 TaskEquality resultingEquality = null; 151 150 152 151 for (int i = 0; i < children1.size(); i++) { … … 158 157 TaskEquality taskEquality = callRuleManager(child1, child2, resultingEquality); 159 158 160 if ((taskEquality == null) || (taskEquality == TaskEquality.UNEQUAL)) { 159 if ((taskEquality == null) || (taskEquality == TaskEquality.UNEQUAL) || 160 ((requiredEqualityLevel != null) && 161 (!taskEquality.isAtLeast(requiredEqualityLevel)))) 162 { 161 163 return TaskEquality.UNEQUAL; 162 164 } 163 165 164 resultingEquality = resultingEquality.getCommonDenominator(taskEquality); 166 if (resultingEquality == null) { 167 // non identical sequences can be at most lexically equal 168 resultingEquality = TaskEquality.LEXICALLY_EQUAL.getCommonDenominator(taskEquality); 169 } 170 else { 171 resultingEquality = resultingEquality.getCommonDenominator(taskEquality); 172 } 165 173 } 166 174 … … 228 236 } 229 237 230 TaskEquality resultingEquality = requiredEqualityLevel != null ? 231 requiredEqualityLevel : TaskEquality.LEXICALLY_EQUAL; 238 TaskEquality resultingEquality = TaskEquality.LEXICALLY_EQUAL; 232 239 233 240 for (int i = 0; i < sequence1.size(); i++) { … … 239 246 TaskEquality taskEquality = callRuleManager(child1, child2, resultingEquality); 240 247 241 if ((taskEquality == null) || (taskEquality == TaskEquality.UNEQUAL)) { 248 if ((taskEquality == null) || (taskEquality == TaskEquality.UNEQUAL) || 249 ((requiredEqualityLevel != null) && 250 (!taskEquality.isAtLeast(requiredEqualityLevel)))) 251 { 242 252 return TaskEquality.UNEQUAL; 243 253 } 244 254 245 resultingEquality = resultingEquality.getCommonDenominator(taskEquality); 255 if (resultingEquality == null) { 256 // non identical sequences can be at most lexically equal 257 resultingEquality = TaskEquality.LEXICALLY_EQUAL.getCommonDenominator(taskEquality); 258 } 259 else { 260 resultingEquality = resultingEquality.getCommonDenominator(taskEquality); 261 } 246 262 } 247 263
Note: See TracChangeset
for help on using the changeset viewer.