Changeset 1285 for trunk/autoquest-core-tasktrees-test/src
- Timestamp:
- 07/30/13 09:44:39 (11 years ago)
- Location:
- trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/manager/TaskTreeManagerTest.java
r1146 r1285 285 285 } 286 286 287 new TaskTreeChecker( ).assertTaskInstanceList287 new TaskTreeChecker(true).assertTaskInstanceList 288 288 ("UserSession session {" + 289 289 " Iteration iteration2 {" + -
trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/TaskInstanceTrieTest.java
r1256 r1285 37 37 38 38 /** 39 * The class <code>TaskInstanceTrieTest</code> contains tests for the class <code>{@link TaskInstanceTrie}</code>. 39 * The class <code>TaskInstanceTrieTest</code> contains tests for the class 40 * <code>{@link TaskInstanceTrie}</code>. 40 41 * 41 * @author Steffen Herbold42 * @author Patrick Harms 42 43 * @version 1.0 43 44 */ … … 54 55 55 56 /** */ 56 private TaskComparator comparator = new TaskComparator(TaskEquality.SEMANTICALLY_EQUAL); 57 private TaskHandlingStrategy strategy = 58 new TaskHandlingStrategy(TaskEquality.IDENTICAL); 57 59 58 60 /** */ … … 84 86 @Test 85 87 public void testTaskInstanceTaskInstanceTrie_1() throws Exception { 86 TaskInstanceTrie result = new TaskInstanceTrie( comparator);88 TaskInstanceTrie result = new TaskInstanceTrie(strategy); 87 89 88 90 assertNotNull(result); … … 95 97 @Test(expected = java.lang.IllegalArgumentException.class) 96 98 public void testTaskInstanceTrie_2() throws Exception { 97 new TaskInstanceTrie((Task Comparator) null);99 new TaskInstanceTrie((TaskHandlingStrategy) null); 98 100 } 99 101 100 102 @Test 101 103 public void testTrainSessions_1() throws Exception { 102 TaskInstanceTrie fixture = new TaskInstanceTrie( comparator);104 TaskInstanceTrie fixture = new TaskInstanceTrie(strategy); 103 105 104 106 IUserSession session = (IUserSession) decoder.decode … … 136 138 @Test 137 139 public void testTrainSessions_2() throws Exception { 138 TaskInstanceTrie fixture = new TaskInstanceTrie( comparator);140 TaskInstanceTrie fixture = new TaskInstanceTrie(strategy); 139 141 140 142 IUserSession session = (IUserSession) decoder.decode … … 167 169 @Test 168 170 public void testTrainSessions_3() throws Exception { 169 TaskInstanceTrie fixture = new TaskInstanceTrie( comparator);171 TaskInstanceTrie fixture = new TaskInstanceTrie(strategy); 170 172 171 173 IUserSession session = (IUserSession) decoder.decode … … 199 201 @Test 200 202 public void testTrainSessions_4() throws Exception { 201 TaskInstanceTrie fixture = new TaskInstanceTrie( comparator);203 TaskInstanceTrie fixture = new TaskInstanceTrie(strategy); 202 204 203 205 IUserSession session = (IUserSession) decoder.decode … … 240 242 @Test 241 243 public void testTrainSessions_5() throws Exception { 242 TaskInstanceTrie fixture = new TaskInstanceTrie( comparator);244 TaskInstanceTrie fixture = new TaskInstanceTrie(strategy); 243 245 244 246 IUserSession session = (IUserSession) decoder.decode … … 276 278 @Test 277 279 public void testTrainSessions_6() throws Exception { 278 TaskInstanceTrie fixture = new TaskInstanceTrie( comparator);280 TaskInstanceTrie fixture = new TaskInstanceTrie(strategy); 279 281 280 282 IUserSession session = (IUserSession) decoder.decode … … 313 315 @Test 314 316 public void testTrainSessions_7() throws Exception { 315 TaskInstanceTrie fixture = new TaskInstanceTrie( comparator);317 TaskInstanceTrie fixture = new TaskInstanceTrie(strategy); 316 318 317 319 IUserSession session = (IUserSession) decoder.decode … … 354 356 @Test 355 357 public void testTrainSessions_8() throws Exception { 356 TaskInstanceTrie fixture = new TaskInstanceTrie( comparator);358 TaskInstanceTrie fixture = new TaskInstanceTrie(strategy); 357 359 358 360 IUserSession session = (IUserSession) decoder.decode … … 390 392 @Test 391 393 public void testTrainSessions_9() throws Exception { 392 TaskInstanceTrie fixture = new TaskInstanceTrie( comparator);394 TaskInstanceTrie fixture = new TaskInstanceTrie(strategy); 393 395 394 396 IUserSession session = (IUserSession) decoder.decode … … 428 430 @Test 429 431 public void testGetSequencesWithMostOccurrences_1() throws Exception { 430 TaskInstanceTrie fixture = new TaskInstanceTrie( comparator);432 TaskInstanceTrie fixture = new TaskInstanceTrie(strategy); 431 433 432 434 fixture.trainSessions(Arrays.asList(session), 3); … … 445 447 @Test 446 448 public void testGetSequencesWithMostOccurrences_2() throws Exception { 447 TaskInstanceTrie fixture = new TaskInstanceTrie( comparator);449 TaskInstanceTrie fixture = new TaskInstanceTrie(strategy); 448 450 449 451 fixture.trainSessions(Arrays.asList(session), 3); … … 510 512 @Test 511 513 public void testGetSequencesWithMostOccurrences_3() throws Exception { 512 TaskInstanceTrie fixture = new TaskInstanceTrie( comparator);514 TaskInstanceTrie fixture = new TaskInstanceTrie(strategy); 513 515 514 516 fixture.trainSessions(Arrays.asList(session), 3); … … 554 556 @Test 555 557 public void testGetSequencesWithMostOccurrences_4() throws Exception { 556 TaskInstanceTrie fixture = new TaskInstanceTrie( comparator);558 TaskInstanceTrie fixture = new TaskInstanceTrie(strategy); 557 559 558 560 fixture.trainSessions(Arrays.asList(session), 3); … … 566 568 @Test 567 569 public void testGetSequencesWithMostOccurrences_5() throws Exception { 568 TaskInstanceTrie fixture = new TaskInstanceTrie( comparator);570 TaskInstanceTrie fixture = new TaskInstanceTrie(strategy); 569 571 570 572 fixture.trainSessions(Arrays.asList(session), 3); … … 583 585 @Test 584 586 public void testGetSequencesWithMostOccurrences_6() throws Exception { 585 TaskInstanceTrie fixture = new TaskInstanceTrie( comparator);587 TaskInstanceTrie fixture = new TaskInstanceTrie(strategy); 586 588 587 589 fixture.trainSessions(Arrays.asList(session), 3); … … 596 598 @Test 597 599 public void testGetSequencesWithMostOccurrences_7() throws Exception { 598 TaskInstanceTrie fixture = new TaskInstanceTrie( comparator);600 TaskInstanceTrie fixture = new TaskInstanceTrie(strategy); 599 601 600 602 fixture.trainSessions(Arrays.asList(session), 3); … … 629 631 @Test 630 632 public void testGetSequencesWithMostOccurrences_8() throws Exception { 631 TaskInstanceTrie fixture = new TaskInstanceTrie( comparator);633 TaskInstanceTrie fixture = new TaskInstanceTrie(strategy); 632 634 633 635 fixture.trainSessions(Arrays.asList(session), 3); … … 688 690 @Test 689 691 public void testGetSequencesWithMostOccurrences_9() throws Exception { 690 TaskInstanceTrie fixture = new TaskInstanceTrie( comparator);692 TaskInstanceTrie fixture = new TaskInstanceTrie(strategy); 691 693 692 694 fixture.trainSessions(Arrays.asList(session), 3); … … 726 728 @Test 727 729 public void testGetSequencesWithMostOccurrences_10() throws Exception { 728 TaskInstanceTrie fixture = new TaskInstanceTrie( comparator);730 TaskInstanceTrie fixture = new TaskInstanceTrie(strategy); 729 731 730 732 fixture.trainSessions(Arrays.asList(session), 3); … … 738 740 @Test 739 741 public void testGetSequencesWithMostOccurrences_11() throws Exception { 740 TaskInstanceTrie fixture = new TaskInstanceTrie( comparator);742 TaskInstanceTrie fixture = new TaskInstanceTrie(strategy); 741 743 742 744 fixture.trainSessions(Arrays.asList(session), 3); … … 762 764 @Test 763 765 public void testGetSequencesWithMostOccurrences_12() throws Exception { 764 TaskInstanceTrie fixture = new TaskInstanceTrie( comparator);766 TaskInstanceTrie fixture = new TaskInstanceTrie(strategy); 765 767 766 768 fixture.trainSessions(Arrays.asList(session), 3); … … 809 811 @Test 810 812 public void testGetSequencesWithMostOccurrences_13() throws Exception { 811 TaskInstanceTrie fixture = new TaskInstanceTrie( comparator);813 TaskInstanceTrie fixture = new TaskInstanceTrie(strategy); 812 814 813 815 fixture.trainSessions(Arrays.asList(session), 3); … … 822 824 @Test 823 825 public void testGetSequencesWithMostOccurrences_14() throws Exception { 824 TaskInstanceTrie fixture = new TaskInstanceTrie( comparator);826 TaskInstanceTrie fixture = new TaskInstanceTrie(strategy); 825 827 826 828 fixture.trainSessions(Arrays.asList(session), 3); … … 835 837 @Test 836 838 public void testGetCount_1() throws Exception { 837 TaskInstanceTrie fixture = new TaskInstanceTrie( comparator);839 TaskInstanceTrie fixture = new TaskInstanceTrie(strategy); 838 840 839 841 fixture.trainSessions(Arrays.asList(session), 3); … … 850 852 @Test 851 853 public void testGetCount_2() throws Exception { 852 TaskInstanceTrie fixture = new TaskInstanceTrie( comparator);854 TaskInstanceTrie fixture = new TaskInstanceTrie(strategy); 853 855 854 856 fixture.trainSessions(Arrays.asList(session), 3); … … 865 867 @Test 866 868 public void testGetCount_3() throws Exception { 867 TaskInstanceTrie fixture = new TaskInstanceTrie( comparator);869 TaskInstanceTrie fixture = new TaskInstanceTrie(strategy); 868 870 869 871 fixture.trainSessions(Arrays.asList(session), 3); … … 879 881 @Test 880 882 public void testGetCount_4() throws Exception { 881 TaskInstanceTrie fixture = new TaskInstanceTrie( comparator);883 TaskInstanceTrie fixture = new TaskInstanceTrie(strategy); 882 884 883 885 fixture.trainSessions(Arrays.asList(session), 3); … … 893 895 @Test 894 896 public void testGetCount_5() throws Exception { 895 TaskInstanceTrie fixture = new TaskInstanceTrie( comparator);897 TaskInstanceTrie fixture = new TaskInstanceTrie(strategy); 896 898 897 899 fixture.trainSessions(Arrays.asList(session), 3); … … 908 910 @Test 909 911 public void testGetCount_6() throws Exception { 910 TaskInstanceTrie fixture = new TaskInstanceTrie( comparator);912 TaskInstanceTrie fixture = new TaskInstanceTrie(strategy); 911 913 912 914 fixture.trainSessions(Arrays.asList(session), 3); … … 922 924 @Test 923 925 public void testGetFollowingSymbols_1() throws Exception { 924 TaskInstanceTrie fixture = new TaskInstanceTrie( comparator);926 TaskInstanceTrie fixture = new TaskInstanceTrie(strategy); 925 927 926 928 fixture.trainSessions(Arrays.asList(session), 3); … … 940 942 @Test 941 943 public void testGetFollowingSymbols_2() throws Exception { 942 TaskInstanceTrie fixture = new TaskInstanceTrie( comparator);944 TaskInstanceTrie fixture = new TaskInstanceTrie(strategy); 943 945 944 946 fixture.trainSessions(Arrays.asList(session), 3); … … 956 958 @Test 957 959 public void testGetFollowingSymbols_3() throws Exception { 958 TaskInstanceTrie fixture = new TaskInstanceTrie( comparator);960 TaskInstanceTrie fixture = new TaskInstanceTrie(strategy); 959 961 960 962 fixture.trainSessions(Arrays.asList(session), 3); … … 970 972 @Test 971 973 public void testGetNumLeafAncestors_1() throws Exception { 972 TaskInstanceTrie fixture = new TaskInstanceTrie( comparator);974 TaskInstanceTrie fixture = new TaskInstanceTrie(strategy); 973 975 974 976 fixture.trainSessions(Arrays.asList(session), 3); … … 981 983 @Test 982 984 public void testGetNumLeafs_1() throws Exception { 983 TaskInstanceTrie fixture = new TaskInstanceTrie( comparator);985 TaskInstanceTrie fixture = new TaskInstanceTrie(strategy); 984 986 985 987 fixture.trainSessions(Arrays.asList(session), 3); … … 992 994 @Test 993 995 public void testGetNumSymbols_1() throws Exception { 994 TaskInstanceTrie fixture = new TaskInstanceTrie( comparator);996 TaskInstanceTrie fixture = new TaskInstanceTrie(strategy); 995 997 996 998 fixture.trainSessions(Arrays.asList(session), 3); … … 1004 1006 @Test 1005 1007 public void testLargeTaskInstanceTrie_1() throws Exception { 1006 TaskInstanceTrie fixture = new TaskInstanceTrie( comparator);1008 TaskInstanceTrie fixture = new TaskInstanceTrie(strategy); 1007 1009 1008 1010 int order = 2; … … 1024 1026 @Test 1025 1027 public void testLargeTaskInstanceTrie_2() throws Exception { 1026 TaskInstanceTrie fixture = new TaskInstanceTrie( comparator);1028 TaskInstanceTrie fixture = new TaskInstanceTrie(strategy); 1027 1029 1028 1030 int order = 2; … … 1044 1046 @Test 1045 1047 public void testLargeTaskInstanceTrie_3() throws Exception { 1046 TaskInstanceTrie fixture = new TaskInstanceTrie( comparator);1048 TaskInstanceTrie fixture = new TaskInstanceTrie(strategy); 1047 1049 1048 1050 int order = 2; … … 1064 1066 @Test 1065 1067 public void testLargeTaskInstanceTrie_4() throws Exception { 1066 TaskInstanceTrie fixture = new TaskInstanceTrie( comparator);1068 TaskInstanceTrie fixture = new TaskInstanceTrie(strategy); 1067 1069 1068 1070 int order = 2; … … 1084 1086 @Test 1085 1087 public void testLargeTaskInstanceTrie_5() throws Exception { 1086 TaskInstanceTrie fixture = new TaskInstanceTrie( comparator);1088 TaskInstanceTrie fixture = new TaskInstanceTrie(strategy); 1087 1089 1088 1090 int order = 2; … … 1104 1106 @Test 1105 1107 public void testLargeTaskInstanceTrie_6() throws Exception { 1106 TaskInstanceTrie fixture = new TaskInstanceTrie( comparator);1108 TaskInstanceTrie fixture = new TaskInstanceTrie(strategy); 1107 1109 1108 1110 int order = 3; … … 1124 1126 @Test 1125 1127 public void testLargeTaskInstanceTrie_7() throws Exception { 1126 TaskInstanceTrie fixture = new TaskInstanceTrie( comparator);1128 TaskInstanceTrie fixture = new TaskInstanceTrie(strategy); 1127 1129 1128 1130 int order = 3; … … 1144 1146 @Test 1145 1147 public void testLargeTaskInstanceTrie_8() throws Exception { 1146 TaskInstanceTrie fixture = new TaskInstanceTrie( comparator);1148 TaskInstanceTrie fixture = new TaskInstanceTrie(strategy); 1147 1149 1148 1150 int order = 3; … … 1164 1166 @Test 1165 1167 public void testLargeTaskInstanceTrie_9() throws Exception { 1166 TaskInstanceTrie fixture = new TaskInstanceTrie( comparator);1168 TaskInstanceTrie fixture = new TaskInstanceTrie(strategy); 1167 1169 1168 1170 int order = 3; … … 1184 1186 @Test 1185 1187 public void testLargeTaskInstanceTrie_10() throws Exception { 1186 TaskInstanceTrie fixture = new TaskInstanceTrie( comparator);1188 TaskInstanceTrie fixture = new TaskInstanceTrie(strategy); 1187 1189 1188 1190 int order = 3; … … 1204 1206 @Test 1205 1207 public void testLargeTaskInstanceTrie_11() throws Exception { 1206 TaskInstanceTrie fixture = new TaskInstanceTrie( comparator);1208 TaskInstanceTrie fixture = new TaskInstanceTrie(strategy); 1207 1209 1208 1210 int order = 4; … … 1224 1226 @Test 1225 1227 public void testLargeTaskInstanceTrie_12() throws Exception { 1226 TaskInstanceTrie fixture = new TaskInstanceTrie( comparator);1228 TaskInstanceTrie fixture = new TaskInstanceTrie(strategy); 1227 1229 1228 1230 int order = 4; … … 1244 1246 @Test 1245 1247 public void testLargeTaskInstanceTrie_13() throws Exception { 1246 TaskInstanceTrie fixture = new TaskInstanceTrie( comparator);1248 TaskInstanceTrie fixture = new TaskInstanceTrie(strategy); 1247 1249 1248 1250 int order = 4; … … 1264 1266 @Test 1265 1267 public void testLargeTaskInstanceTrie_14() throws Exception { 1266 TaskInstanceTrie fixture = new TaskInstanceTrie( comparator);1268 TaskInstanceTrie fixture = new TaskInstanceTrie(strategy); 1267 1269 1268 1270 int order = 4; … … 1284 1286 @Test 1285 1287 public void testLargeTaskInstanceTrie_15() throws Exception { 1286 TaskInstanceTrie fixture = new TaskInstanceTrie( comparator);1288 TaskInstanceTrie fixture = new TaskInstanceTrie(strategy); 1287 1289 1288 1290 int order = 4; … … 1304 1306 @Test 1305 1307 public void testLargeTaskInstanceTrie_16() throws Exception { 1306 TaskInstanceTrie fixture = new TaskInstanceTrie( comparator);1308 TaskInstanceTrie fixture = new TaskInstanceTrie(strategy); 1307 1309 1308 1310 int order = 5; … … 1324 1326 @Test 1325 1327 public void testLargeTaskInstanceTrie_17() throws Exception { 1326 TaskInstanceTrie fixture = new TaskInstanceTrie( comparator);1328 TaskInstanceTrie fixture = new TaskInstanceTrie(strategy); 1327 1329 1328 1330 int order = 5; … … 1344 1346 @Test 1345 1347 public void testLargeTaskInstanceTrie_18() throws Exception { 1346 TaskInstanceTrie fixture = new TaskInstanceTrie( comparator);1348 TaskInstanceTrie fixture = new TaskInstanceTrie(strategy); 1347 1349 1348 1350 int order = 5; … … 1364 1366 @Test 1365 1367 public void testLargeTaskInstanceTrie_19() throws Exception { 1366 TaskInstanceTrie fixture = new TaskInstanceTrie( comparator);1368 TaskInstanceTrie fixture = new TaskInstanceTrie(strategy); 1367 1369 1368 1370 int order = 5; … … 1384 1386 @Test 1385 1387 public void testLargeTaskInstanceTrie_20() throws Exception { 1386 TaskInstanceTrie fixture = new TaskInstanceTrie( comparator);1388 TaskInstanceTrie fixture = new TaskInstanceTrie(strategy); 1387 1389 1388 1390 int order = 5; … … 1404 1406 @Test 1405 1407 public void testLargeTaskInstanceTrie_21() throws Exception { 1406 TaskInstanceTrie fixture = new TaskInstanceTrie( comparator);1408 TaskInstanceTrie fixture = new TaskInstanceTrie(strategy); 1407 1409 1408 1410 int order = 6; … … 1424 1426 @Test 1425 1427 public void testLargeTaskInstanceTrie_22() throws Exception { 1426 TaskInstanceTrie fixture = new TaskInstanceTrie( comparator);1428 TaskInstanceTrie fixture = new TaskInstanceTrie(strategy); 1427 1429 1428 1430 int order = 6; … … 1444 1446 @Test 1445 1447 public void testLargeTaskInstanceTrie_23() throws Exception { 1446 TaskInstanceTrie fixture = new TaskInstanceTrie( comparator);1448 TaskInstanceTrie fixture = new TaskInstanceTrie(strategy); 1447 1449 1448 1450 int order = 6; … … 1464 1466 @Test 1465 1467 public void testLargeTaskInstanceTrie_24() throws Exception { 1466 TaskInstanceTrie fixture = new TaskInstanceTrie( comparator);1468 TaskInstanceTrie fixture = new TaskInstanceTrie(strategy); 1467 1469 1468 1470 int order = 6; … … 1484 1486 @Test 1485 1487 public void testLargeTaskInstanceTrie_25() throws Exception { 1486 TaskInstanceTrie fixture = new TaskInstanceTrie( comparator);1488 TaskInstanceTrie fixture = new TaskInstanceTrie(strategy); 1487 1489 1488 1490 int order = 6; … … 1493 1495 fixture.trainSessions(Arrays.asList(tester.userSession), order); 1494 1496 System.out.println("testing session with 10000 task instances and 1000 symbols took " + 1497 (System.currentTimeMillis() - start) + "ms"); 1498 1499 fixture.process(tester); 1500 1501 // do not check if counts is empty, as some sequences may not be part of the reduced trie 1502 // and may therefore not be processed by the tester. 1503 //assertTrue(tester.counts.isEmpty()); 1504 } 1505 1506 @Test 1507 public void testLargeTaskInstanceTrie_26() throws Exception { 1508 TaskInstanceTrie fixture = new TaskInstanceTrie(strategy); 1509 1510 int order = 3; 1511 1512 TaskInstanceTrieTester tester = new TaskInstanceTrieTester(1000, 1000000, order); 1513 1514 long start = System.currentTimeMillis(); 1515 fixture.trainSessions(Arrays.asList(tester.userSession), order); 1516 System.out.println("testing session with 1000000 task instances and 1000 symbols took " + 1495 1517 (System.currentTimeMillis() - start) + "ms"); 1496 1518 … … 1513 1535 found = true; 1514 1536 for (int i = 0; i < containedList.size(); i++) { 1515 if (! comparator.equals(candidate.get(0), containedList.get(0))) {1537 if (!strategy.getTaskComparator().equals(candidate.get(0), containedList.get(0))) { 1516 1538 found = false; 1517 1539 break; … … 1660 1682 1661 1683 for (Map.Entry<Integer, ITaskInstance> entry : symbols.entrySet()) { 1662 if ( comparator.equals(entry.getValue(), symbol)) {1684 if (strategy.getTaskComparator().equals(entry.getValue(), symbol)) { 1663 1685 symbolIndex = entry.getKey(); 1664 1686 break;
Note: See TracChangeset
for help on using the changeset viewer.