- Timestamp:
- 08/12/14 21:55:45 (10 years ago)
- Location:
- branches/autoquest-core-tasktrees-alignment
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/autoquest-core-tasktrees-alignment/.classpath
r1619 r1666 23 23 </attributes> 24 24 </classpathentry> 25 <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/> 25 26 <classpathentry kind="output" path="target/classes"/> 26 27 </classpath> -
branches/autoquest-core-tasktrees-alignment/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/RuleUtils.java
r1657 r1666 114 114 // System.out.println(subsequence.getSequence().getChildren().get(i)); 115 115 //} 116 System.out.println();116 //System.out.println(); 117 117 //TODO: This is dirty! 118 118 missedOptionals=0; … … 129 129 130 130 if(((IMarkingTemporalRelationship) tempTask).getMarkedTask() == parent.get(startIndex).getTask()) { 131 System.out.println("Adding OptionalInstance " + parent.get(startIndex) + " to " + tempTask.getType());131 //System.out.println("Adding OptionalInstance " + parent.get(startIndex) + " to " + tempTask.getType()); 132 132 IOptionalInstance optional = taskFactory.createNewTaskInstance((IOptional) tempTask); 133 133 taskBuilder.setChild(optional, parent.get(startIndex)); … … 135 135 } 136 136 else { 137 System.out.println("Adding Empty optional, not deleting anything from the input sequence");137 //System.out.println("Adding Empty optional, not deleting anything from the input sequence"); 138 138 IOptionalInstance optional = taskFactory.createNewTaskInstance((IOptional) tempTask); 139 139 taskBuilder.addChild(subsequence, optional); … … 143 143 } 144 144 } else if (tempTask.getType() == "selection") { 145 System.out.println("Adding SelectionInstance " + parent.get(startIndex) + " to " + tempTask.getType());145 //System.out.println("Adding SelectionInstance " + parent.get(startIndex) + " to " + tempTask.getType()); 146 146 ISelectionInstance selection = taskFactory.createNewTaskInstance((ISelection) tempTask); 147 147 taskBuilder.setChild(selection, parent.get(startIndex) ); … … 149 149 150 150 } else if (tempTask.getType() == "sequence") { 151 System.out.println("Adding SequenceInstance " + parent.get(startIndex) + " to " + tempTask.getType());151 //System.out.println("Adding SequenceInstance " + parent.get(startIndex) + " to " + tempTask.getType()); 152 152 //TODO: Implement this 153 153 throw new NotImplementedException(); … … 155 155 } else if (tempTask.getType() == "iteration") { 156 156 //TODO: Implement this 157 System.out.println("Adding IterationInstance " + parent.get(startIndex) + " to " + tempTask.getType());157 //System.out.println("Adding IterationInstance " + parent.get(startIndex) + " to " + tempTask.getType()); 158 158 throw new NotImplementedException(); 159 159 } else { 160 System.out.println("Adding EventInstance " + parent.get(startIndex) + " to " + tempTask.getType());160 //System.out.println("Adding EventInstance " + parent.get(startIndex) + " to " + tempTask.getType()); 161 161 taskBuilder.addChild(subsequence, parent.get(startIndex)); 162 162 } … … 170 170 System.out.println(it.next()); 171 171 }*/ 172 System.out.println();173 System.out.println();172 //System.out.println(); 173 //System.out.println(); 174 174 175 175 taskBuilder.addTaskInstance(parent, startIndex, subsequence); -
branches/autoquest-core-tasktrees-alignment/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/SequenceForTaskDetectionRuleAlignment.java
r1664 r1666 198 198 .getNumberSequences().get(j).containsPattern(pattern); 199 199 if (startpositions.size() > 0) { 200 NumberSequence tempns = appData.getNumberSequences().get(j);201 202 200 for (Iterator<Integer> jt = startpositions.iterator(); jt 203 201 .hasNext();) { … … 234 232 .get(i).getOccurences().iterator(); it.hasNext();) { 235 233 MatchOccurence oc = it.next(); 234 /* 236 235 System.out.println("Trying to replace sequence: "); 237 236 matchseqs.get(i).getFirstSequence().printSequence(); … … 244 243 + oc.getEndindex()); 245 244 System.out.println(); 246 245 */ 246 247 247 // System.out.println("Printing session: "); 248 for (int j = 0; j < sessions.get(oc.getSequenceId()).size(); j++) {249 System.out.println(j + ": "250 + sessions.get(oc.getSequenceId()).get(j));251 }248 //for (int j = 0; j < sessions.get(oc.getSequenceId()).size(); j++) { 249 // System.out.println(j + ": " 250 // + sessions.get(oc.getSequenceId()).get(j)); 251 //} 252 252 253 253 // Check if nothing has been replaced in the sequence we … … 272 272 273 273 if (oc.getStartindex() >= tmpOC.getStartindex() && oc.getStartindex()<=tmpOC.getEndindex()) { 274 System.out.println("This position has already been replaced in this iteration");275 274 continue invalidOccurence; 276 275 } … … 284 283 // Just to be sure. 285 284 if (diff > 0) { 286 System.out.println("Old index: Start: "287 + oc.getStartindex() + " End "288 + oc.getEndindex());289 285 oc.setStartindex(oc.getStartindex() - diff+1); 290 286 oc.setEndindex(oc.getEndindex() - diff+1); 291 System.out.println("Updated index: Start: "292 + oc.getStartindex() + " End "293 + oc.getEndindex());294 287 } else { 295 288 Console.traceln(Level.WARNING, … … 346 339 } 347 340 348 // check if we have any replaced occurence with indexes 349 // smaller than ours. If so, we need to adjust our start 350 // and endpoints 351 // of the replacement. 352 // Also do a check if we have replaced this specific 353 // MatchOccurence in this sequence already. Jump to the 354 // next occurence if this is the case. 355 private void updateMatchIndexes(List<Match> matchseqs, int sequenceId, 356 int startindex, int endindex) { 357 358 for (int i = 0; i < matchseqs.size(); i++) { 359 for (Iterator<MatchOccurence> it = matchseqs.get(i).getOccurences() 360 .iterator(); it.hasNext();) { 361 MatchOccurence tmpOC = it.next(); 362 // if the matchoccurence starts in a sequence that has been 363 // replaced right now we delete it 364 if (tmpOC.getStartindex() > startindex 365 && tmpOC.getStartindex() < endindex) { 366 it.remove(); 367 } else if (tmpOC.getStartindex() > endindex) { 368 int diff = endindex-startindex; 369 // Just to be sure. 370 if (diff > 0) { 371 System.out.println("Old index: Start: " 372 + tmpOC.getStartindex() + " End " 373 + tmpOC.getEndindex()); 374 tmpOC.setStartindex(tmpOC.getStartindex() - diff + 1); 375 tmpOC.setEndindex(tmpOC.getEndindex() - diff + 1); 376 System.out.println("Updated index: Start: " 377 + tmpOC.getStartindex() + " End " 378 + tmpOC.getEndindex()); 379 } else { 380 Console.traceln(Level.WARNING, 381 "End index of a Match before start. This should never happen"); 382 } 383 } 384 } 385 } 386 } 387 341 388 342 /** 389 343 * <p>
Note: See TracChangeset
for help on using the changeset viewer.