- Timestamp:
- 03/18/13 15:43:35 (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
r1129 r1133 131 131 appData.getStopWatch().start("whole loop"); 132 132 detectAndReplaceIterations(appData); 133 //mergeEqualTasks(appData); 133 134 134 appData.getStopWatch().start("task replacement"); 135 135 detectAndReplaceTasks(appData); … … 158 158 159 159 /** 160 * <p>161 * TODO: comment162 * </p>163 *164 160 * @param appData 165 161 */ … … 180 176 181 177 /** 182 * <p>183 * TODO: comment184 * </p>185 *186 178 * @param appData 187 179 */ … … 208 200 } 209 201 210 // /** 211 // * <p> 212 // * TODO: comment 213 // * </p> 214 // * 215 // * @param appData 216 // */ 217 // private void mergeEqualTasks(RuleApplicationData appData) { 218 // System.out.println("merging equal tasks"); 219 // appData.getStopWatch().start("merging equal tasks"); 220 // 221 // int replacements = 0; 222 // List<ISequence> sessions = appData.getSessions(); 223 // 224 // IdentityHashMap<ITaskTreeNode, ITaskTreeNode> replacedChildren = 225 // new IdentityHashMap<ITaskTreeNode, ITaskTreeNode>(); 226 // 227 // for (int sessionIdx1 = 0; sessionIdx1 < sessions.size(); sessionIdx1++) { 228 // List<ITaskTreeNode> children1 = appData.getSessions().get(sessionIdx1).getChildren(); 229 // for (int childIdx1 = 0; childIdx1 < children1.size(); childIdx1++) { 230 // // this is the child of which we search equal other children to merge and to 231 // // replace with one single unique node 232 // ITaskTreeNode child1 = children1.get(childIdx1); 233 // 234 // if (replacedChildren.containsKey(child1)) { 235 // continue; 236 // } 237 // 238 // // now search for all other children that are equal. Also record the session they 239 // // belong to as well as the index in that session 240 // List<ITaskTreeNode> equalChildren = new LinkedList<ITaskTreeNode>(); 241 // List<Integer> sessionIndexes = new LinkedList<Integer>(); 242 // List<Integer> childIndexes = new LinkedList<Integer>(); 243 // 244 // // add all information about the current child 245 // equalChildren.add(child1); 246 // sessionIndexes.add(sessionIdx1); 247 // childIndexes.add(childIdx1); 248 // 249 // for (int sessionIdx2 = sessionIdx1; sessionIdx2 < sessions.size(); sessionIdx2++) { 250 // List<ITaskTreeNode> children2 = 251 // appData.getSessions().get(sessionIdx2).getChildren(); 252 // 253 // int startIndex = (sessionIdx1 == sessionIdx2) ? childIdx1 + 1 : 0; 254 // 255 // for (int childIdx2 = startIndex; childIdx2 < children2.size(); childIdx2++) { 256 // ITaskTreeNode child2 = children2.get(childIdx2); 257 // 258 // if ((child1 != child2) && (nodeComparator.equals(child1, child2))) { 259 // // this is an equal child --> record its occurrence 260 // equalChildren.add(child2); 261 // sessionIndexes.add(sessionIdx2); 262 // childIndexes.add(childIdx2); 263 // } 264 // } 265 // } 266 // 267 // // now merge the found children 268 // if (equalChildren.size() > 1) { 269 // ITaskTreeNode replacement = 270 // mergeVariantsOfTasks(child1.toString(), equalChildren); 271 // 272 // for (int i = 0; i < sessionIndexes.size(); i++) { 273 // taskTreeBuilder.setChild(appData.getSessions().get(sessionIndexes.get(i)), 274 // childIndexes.get(i), replacement); 275 // 276 // replacements++; 277 // } 278 // 279 // // remember the replacement to prevent comparison of merged nodes 280 // replacedChildren.put(replacement, replacement); 281 // 282 // System.out.println 283 // ("replaced " + sessionIndexes.size() + " occurrences of " + child1); 284 // } 285 // } 286 // } 287 // 288 // appData.getStopWatch().stop("merging equal tasks"); 289 // 290 // System.out.println("replaced " + replacements + " equal tasks with unique replacements"); 291 // } 292 // 293 /** 294 * <p> 295 * TODO: comment 296 * </p> 297 * 202 /** 298 203 * @param appData 299 204 */ … … 314 219 315 220 /** 316 * <p>317 * TODO: comment318 * </p>319 *320 * @param i321 221 * @return 322 222 */ … … 359 259 360 260 /** 361 * <p>362 * TODO: comment363 * </p>364 *365 261 * @param parent 366 262 * @return … … 383 279 384 280 /** 385 * <p>386 * TODO: comment387 * </p>388 *389 281 * @param trie 390 282 * @param parent … … 399 291 400 292 /** 401 * <p>402 * TODO: comment403 * </p>404 *405 293 * @param appData 406 294 */ … … 445 333 446 334 /** 447 * <p>448 * TODO: comment449 * </p>450 *451 335 * @param tree 452 336 */ … … 479 363 480 364 /** 481 * <p>482 * TODO: comment483 * </p>484 *485 365 * @param appData 486 366 * @return … … 493 373 494 374 /** 495 * <p>496 * TODO: comment497 * </p>498 *499 375 * @param appData 500 376 * @return … … 525 401 526 402 /** 527 * <p>528 * TODO: comment529 * </p>530 *531 403 * @param task 532 404 * @param parent … … 578 450 579 451 /** 580 * <p>581 * TODO: comment582 * </p>583 *584 452 * @param trie 585 453 * @param object … … 613 481 614 482 /** 615 * <p>616 * TODO comment617 * </p>618 *619 483 * @author Patrick Harms 620 484 */ … … 632 496 633 497 /** 634 * <p>635 * TODO: comment636 * </p>637 498 * 638 * @param maxCount639 499 */ 640 500 public MaxCountAndLongestTasksFinder() { … … 693 553 694 554 /** 695 * <p> 696 * TODO: comment 697 * </p> 698 * 699 * @return 555 * @return 700 556 */ 701 557 public Tasks getFoundTasks() { … … 705 561 706 562 /** 707 * <p>708 * TODO: comment709 * </p>710 563 * 711 564 */ … … 740 593 * 741 594 */ 742 private class RuleApplicationData {595 private static class RuleApplicationData { 743 596 744 597 /** … … 898 751 899 752 /** 900 * <p>901 * TODO comment902 * </p>903 *904 753 * @author Patrick Harms 905 754 */ 906 private class Tasks implements Iterable<List<ITaskTreeNode>> {755 private static class Tasks implements Iterable<List<ITaskTreeNode>> { 907 756 908 757 /** … … 917 766 918 767 /** 919 * <p>920 * TODO: comment921 * </p>922 *923 768 * @param occurrenceCount 924 769 * @param sequences … … 931 776 932 777 /** 933 * <p>934 * TODO: comment935 * </p>936 *937 778 * @return 938 779 */ … … 942 783 943 784 /** 944 * <p>945 * TODO: comment946 * </p>947 *948 785 * @return 949 786 */
Note: See TracChangeset
for help on using the changeset viewer.