- Timestamp:
- 04/19/13 17:11:46 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/SequenceForTaskDetectionRule.java
r1146 r1155 167 167 for (IUserSession session : sessions) { 168 168 for (int i = 0; i < (session.size() - 1); i++) { 169 if (taskComparator.equals(session.get(i) .getTask(), session.get(i + 1).getTask())) {169 if (taskComparator.equals(session.get(i), session.get(i + 1))) { 170 170 return session.get(i).getTask(); 171 171 } … … 175 175 return null; 176 176 } 177 178 /** 179 * 180 */ 181 /* private ITask searchIteratedTask(List<IUserSession> sessions) { 182 int minNoOfRepetitions = 2; 183 int minNoOfIterationOccurrences = 1; 184 185 Map<ITask, Integer> iterationsCounter = new HashMap<ITask, Integer>(); 186 187 for (IUserSession session : sessions) { 188 for (int i = 0; i < (session.size() - minNoOfRepetitions + 1); i++) { 189 ITask task = session.get(i).getTask(); 190 191 // check if the task is iterated 192 boolean isIterated = true; 193 for (int j = i + 1; j < i + minNoOfRepetitions; j++) { 194 if (!taskComparator.equals(task, session.get(j).getTask())) { 195 isIterated = false; 196 break; 197 } 198 } 199 200 if (isIterated) { 201 Integer currentCounter = null; 202 203 for (Map.Entry<ITask, Integer> entry : iterationsCounter.entrySet()) { 204 if (taskComparator.equals(task, entry.getKey())) { 205 currentCounter = entry.getValue(); 206 break; 207 } 208 } 209 210 if (currentCounter == null) { 211 currentCounter = 1; 212 iterationsCounter.put(task, currentCounter); 213 } 214 else { 215 currentCounter++; 216 iterationsCounter.put(task, currentCounter); 217 } 218 219 if (currentCounter >= minNoOfIterationOccurrences) { 220 return task; 221 } 222 } 223 } 224 } 225 226 return null; 227 }*/ 177 228 178 229 /** … … 215 266 216 267 /** 217 * <p>218 * TODO: comment219 * </p>220 268 * 221 * @param iteratedTaskVariants222 269 */ 223 270 private void harmonizeIterationInstancesModel(IIteration iteration, … … 839 886 * 840 887 */ 841 private class TaskComparator implements SymbolComparator<ITaskInstance> {888 private static class TaskComparator implements SymbolComparator<ITaskInstance> { 842 889 843 890 /** */ … … 949 996 * 950 997 */ 951 private interface Comparer {998 private static interface Comparer { 952 999 953 1000 /** … … 960 1007 * 961 1008 */ 962 private class LexicalComparer implements Comparer {1009 private static class LexicalComparer implements Comparer { 963 1010 964 1011 /** … … 987 1034 * 988 1035 */ 989 private class SyntacticalComparer implements Comparer {1036 private static class SyntacticalComparer implements Comparer { 990 1037 991 1038 /** … … 1014 1061 * 1015 1062 */ 1016 private class SemanticalComparer implements Comparer {1063 private static class SemanticalComparer implements Comparer { 1017 1064 1018 1065 /** … … 1041 1088 * 1042 1089 */ 1043 private class DefaultComparer implements Comparer {1090 private static class DefaultComparer implements Comparer { 1044 1091 1045 1092 /**
Note: See TracChangeset
for help on using the changeset viewer.