- Timestamp:
- 08/09/14 22:45:41 (10 years ago)
- Location:
- branches/autoquest-core-tasktrees-alignment/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/autoquest-core-tasktrees-alignment/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/RuleUtils.java
r1655 r1656 17 17 import java.util.Iterator; 18 18 19 import de.ugoe.cs.autoquest.tasktrees.treeifc.IMarkingTemporalRelationship; 19 20 import de.ugoe.cs.autoquest.tasktrees.treeifc.IOptional; 20 21 import de.ugoe.cs.autoquest.tasktrees.treeifc.IOptionalInstance; 22 import de.ugoe.cs.autoquest.tasktrees.treeifc.ISelection; 23 import de.ugoe.cs.autoquest.tasktrees.treeifc.ISelectionInstance; 21 24 import de.ugoe.cs.autoquest.tasktrees.treeifc.ISequence; 22 25 import de.ugoe.cs.autoquest.tasktrees.treeifc.ISequenceInstance; … … 103 106 ISequenceInstance subsequence = taskFactory 104 107 .createNewTaskInstance(model); 108 109 for (int i=0; i<subsequence.getSequence().getChildren().size();i++) { 110 System.out.println(subsequence.getSequence().getChildren().get(i)); 111 } 112 System.out.println(); 105 113 106 114 int modelindex=0; 107 115 for (int i = startIndex; i <= endIndex; i++) { 108 System.out.println("Trying to add " + parent.get(startIndex) 109 + " to the model instance"); 116 110 117 ITask tempTask = model.getChildren().get(modelindex); 118 //System.out.println("Trying to add " + parent.get(startIndex) 119 // + " to the model instance " + tempTask.getType()); 111 120 if (tempTask.getType() == "optionality") { 112 IOptionalInstance optional = taskFactory.createNewTaskInstance((IOptional) tempTask); 121 122 if(((IMarkingTemporalRelationship) tempTask).getMarkedTask() == parent.get(startIndex).getTask()) { 123 System.out.println("Adding OptionalInstance " + parent.get(startIndex) + " to " + tempTask.getType()); 124 IOptionalInstance optional = taskFactory.createNewTaskInstance((IOptional) tempTask); 125 taskBuilder.setChild(optional, parent.get(startIndex)); 126 taskBuilder.addChild(subsequence, optional); 127 } 128 else { 129 System.out.println("Adding Empty optional, not deleting anything from the input sequence"); 130 IOptionalInstance optional = taskFactory.createNewTaskInstance((IOptional) tempTask); 131 taskBuilder.addChild(subsequence, optional); 132 modelindex++; 133 i++; 134 continue; 135 } 113 136 } else if (tempTask.getType() == "selection") { 137 System.out.println("Adding SelectionInstance " + parent.get(startIndex) + " to " + tempTask.getType()); 138 ISelectionInstance selection = taskFactory.createNewTaskInstance((ISelection) tempTask); 139 taskBuilder.setChild(selection, parent.get(startIndex) ); 140 taskBuilder.addChild(subsequence,selection); 114 141 115 142 } else if (tempTask.getType() == "sequence") { 143 System.out.println("Adding SequenceInstance " + parent.get(startIndex) + " to " + tempTask.getType()); 144 145 } else if (tempTask.getType() == "iteration") { 146 System.out.println("Adding IterationInstance " + parent.get(startIndex) + " to " + tempTask.getType()); 147 } else { 148 System.out.println("Adding EventInstance " + parent.get(startIndex) + " to " + tempTask.getType()); 116 149 taskBuilder.addChild(subsequence, parent.get(startIndex)); 117 } else if (tempTask.getType() == "iteration") {118 119 } else {120 121 150 } 122 151 taskBuilder.removeTaskInstance(parent, startIndex); 123 152 modelindex++; 124 153 } 125 154 155 System.out.println("Sequence instance:"); 156 for(Iterator<ITaskInstance> it = subsequence.iterator();it.hasNext();) { 157 System.out.println(it.next()); 158 } 159 126 160 taskBuilder.addTaskInstance(parent, startIndex, subsequence); 127 161 -
branches/autoquest-core-tasktrees-alignment/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/SequenceForTaskDetectionRuleAlignment.java
r1655 r1656 282 282 matchseqs.get(i).getSecondSequence().printSequence(); 283 283 System.out.println(" in session number: " + (oc.getSequenceId()+1) + " at position " + (oc.getStartindex()) + "-" + (oc.getStartindex()+matchseqs.get(i).getFirstSequence().size())); 284 System.out.println(); 285 /* 284 286 System.out.println("Printing session: "); 285 287 for(int j=0;j<sessions.get(oc.getSequenceId()).size();j++) { 286 288 System.out.println(j+ ": " + sessions.get(oc.getSequenceId()).get(j)); 287 } 289 }*/ 288 290 List<ISequenceInstance> sequenceInstances = new LinkedList<ISequenceInstance>(); 289 RuleUtils.createNewSubSequenceInRange(sessions.get(oc.getSequenceId()), oc.getStartindex(), oc.getStartindex()+matchseqs.get(i).getFirstSequence().size() -1, task, taskFactory, taskBuilder);290 } 291 System.out.println(task);291 RuleUtils.createNewSubSequenceInRange(sessions.get(oc.getSequenceId()), oc.getStartindex(), oc.getStartindex()+matchseqs.get(i).getFirstSequence().size(), task, taskFactory, taskBuilder); 292 } 293 //System.out.println(task); 292 294 //matchseqs.get(i).getFirstSequence().printSequence(); 293 295 //matchseqs.get(i).getSecondSequence().printSequence(); … … 568 570 569 571 //TODO: Debug output 572 /* 570 573 for (int i =0;i<sequence.getChildren().size();i++) { 571 574 System.out.println(sequence.getChildren().get(i)); … … 577 580 } 578 581 } 582 */ 579 583 return sequence; 580 584 }
Note: See TracChangeset
for help on using the changeset viewer.