Changeset 1645
- Timestamp:
- 08/02/14 13:26:00 (10 years ago)
- Location:
- branches/ralph/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ralph/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/RuleUtils.java
r1401 r1645 92 92 { 93 93 ISequenceInstance subsequence = taskFactory.createNewTaskInstance(model); 94 94 95 96 97 System.out.println("Got model: " + model.toString()); 98 99 100 101 102 103 System.out.println(parent); 104 //System.out.println(parent.get(startIndex)); 95 105 for (int i = startIndex; i <= endIndex; i++) { 106 System.out.println("Trying to add "+ parent.get(startIndex) + " to the model"); 96 107 taskBuilder.addChild(subsequence, parent.get(startIndex)); 108 97 109 taskBuilder.removeTaskInstance(parent, startIndex); 98 110 } -
branches/ralph/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/SequenceForTaskDetectionRuleAlignment.java
r1631 r1645 189 189 190 190 // Skip sequences with more 0 events (scrolls) than other events. 191 // Both of the pattern sequences are equally long, so the added 0 192 // counts 193 // just need to be smaller than the length of one sequence 191 // Both of the pattern sequences are equally long, so the zero 192 // counts just need to be smaller than the length of one sequence 194 193 if (pattern.getFirstSequence().eventCount(0) 195 194 + pattern.getSecondSequence().eventCount(0) + 1 > pattern … … 261 260 if (matchseqs.get(i).occurenceCount() > 2) { 262 261 263 I Task task = matchAsTask(appData,matchseqs.get(i));262 ISequence task = matchAsSequence(appData,matchseqs.get(i)); 264 263 for(Iterator<MatchOccurence> it = matchseqs.get(i).getOccurences().iterator();it.hasNext();) { 265 MatchOccurence oc = it.next(); 266 //RuleUtils.createNewSubSequenceInRange(oc.getSequenceId(), oc.getStartindex(), oc.getStartindex()+task 267 // + task.size() - 1, temporalTaskModel, 268 // taskFactory, taskBuilder)); 264 MatchOccurence oc = it.next(); 265 System.out.println("Trying to replace sequence: "); 266 matchseqs.get(i).getFirstSequence().printSequence(); 267 matchseqs.get(i).getSecondSequence().printSequence(); 268 System.out.println(" in session number: " + (oc.getSequenceId()+1) + " at position " + oc.getStartindex() + "-" + (oc.getStartindex()+matchseqs.get(i).getFirstSequence().size())); 269 System.out.println("Printing session: "); 270 for(int j=0;j<sessions.get(oc.getSequenceId()).size();j++) { 271 System.out.println(j+ ": " + sessions.get(oc.getSequenceId()).get(j)); 272 } 273 List<ISequenceInstance> sequenceInstances = new LinkedList<ISequenceInstance>(); 274 RuleUtils.createNewSubSequenceInRange(sessions.get(oc.getSequenceId()), oc.getStartindex(), oc.getStartindex()+matchseqs.get(i).getFirstSequence().size()-1, task, taskFactory, taskBuilder); 269 275 } 270 276 System.out.println(task); … … 361 367 appData.getNumber2Task().put(templist.getSequence()[i], taskInstance.getTask()); 362 368 } 369 //Each NumberSequence is identified by its id, beginning to count at zero 363 370 templist.setId(appData.getNumberSequences().size()); 364 371 appData.getNumberSequences().add(templist); … … 504 511 505 512 506 I Task matchAsTask(RuleApplicationData appData,Match m) {513 ISequence matchAsSequence(RuleApplicationData appData,Match m) { 507 514 508 515 ISequence sequence = taskFactory.createNewSequence(); … … 510 517 int[] first = m.getFirstSequence().getSequence(); 511 518 int[] second = m.getSecondSequence().getSequence(); 512 System.out.println("Number2Task size: " +appData.getNumber2Task().size()); 519 513 520 514 521 //Both sequences of a match are equally long 515 522 for(int i=0;i<m.getFirstSequence().size();i++) { 516 System.out.println("First:" + first[i]); 517 System.out.println("Second:" + second[i]); 518 System.out.println(); 523 519 524 //Two gaps aligned to each other: Have not seen it happening so far, just to handle it 520 525 if(first[i]==-1 && second[i]==-1) { … … 648 653 appData.detectedAndReplacedTasks(false); 649 654 650 655 /* 651 656 Console.traceln(Level.FINER, "replacing tasks occurrences"); 652 /*657 653 658 for (List<ITaskInstance> task : appData.getLastFoundTasks()) { 654 659 ISequence sequence = taskFactory.createNewSequence();
Note: See TracChangeset
for help on using the changeset viewer.