- Timestamp:
- 08/28/14 00:30:39 (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
r1699 r1700 111 111 .createNewTaskInstance(model); 112 112 113 114 // TODO: Debug output 115 System.out.println("PRINTING MODEL: "); 116 for (int i = 0; i < subsequence.getSequence().getChildren().size(); i++) { 117 System.out.println(subsequence.getSequence().getChildren().get(i)); 118 119 if (subsequence.getSequence().getChildren().get(i).getType() == "selection") { 120 for (int j = 0; j < ((ISelection) subsequence.getSequence().getChildren().get(i)) 121 .getChildren().size(); j++) { 122 if(((IStructuringTemporalRelationship) subsequence.getSequence().getChildren().get(i)).getChildren().get(j).getType() =="sequence") 123 { 124 ISequence foo = (ISequence) ((ISelection) (subsequence.getSequence().getChildren().get(i))).getChildren().get(j); 125 System.out.println("\t" + foo); 126 for(int k=0; k< foo.getChildren().size();k++) { 127 System.out.println("\t\t" +foo.getChildren().get(k)); 128 } 129 System.out.println(); 130 } 131 else{ 132 System.out.println("\t" 133 + ((ISelection) subsequence.getSequence().getChildren().get(i)) 134 .getChildren().get(j)); 135 } 136 137 } 138 } 139 140 } 141 System.out.println(); 142 143 113 144 //TODO: This is dirty! 114 145 missedOptionals=0; … … 125 156 126 157 if(((IMarkingTemporalRelationship) tempTask).getMarkedTask() == parent.get(startIndex).getTask()) { 127 //System.out.println("Adding OptionalInstance " + parent.get(startIndex) + " to " + tempTask.getType());158 System.out.println("Adding OptionalInstance " + parent.get(startIndex) + " to " + tempTask.getType()); 128 159 IOptionalInstance optional = taskFactory.createNewTaskInstance((IOptional) tempTask); 129 160 taskBuilder.setChild(optional, parent.get(startIndex)); … … 131 162 } 132 163 else { 133 //System.out.println("Adding Empty optional, not deleting anything from the input sequence");164 System.out.println("Adding Empty optional, not deleting anything from the input sequence"); 134 165 IOptionalInstance optional = taskFactory.createNewTaskInstance((IOptional) tempTask); 135 166 taskBuilder.addChild(subsequence, optional); … … 143 174 if(tmpSel.getChildren().get(0).getType() == "sequence" && tmpSel.getChildren().get(1).getType()=="sequence") { 144 175 ISequenceInstance selseq = null; 145 //The selection icreate can just have 2 children176 //The selection I create can just have 2 children 146 177 if(parent.get(startIndex).getTask().getId() == ((ISequence)tmpSel.getChildren().get(0)).getChildren().get(0).getId()) { 147 178 selseq = taskFactory.createNewTaskInstance((ISequence) tmpSel.getChildren().get(0)); … … 151 182 } 152 183 else if(parent.get(startIndex).getTask().getId() == tmpSel.getChildren().get(0).getId() || parent.get(startIndex).getTask().getId() == tmpSel.getChildren().get(1).getId() ) { 184 System.out.println("Session ID: " + parent.get(startIndex).getTask().getId() + " tmpSel(0): " + tmpSel.getChildren().get(0).getId() + " tmpSel(1): " +tmpSel.getChildren().get(1).getId() ); 153 185 continue; 154 186 } 155 187 156 188 for (int k=0;k<selseq.getSequence().getChildren().size();k++) { 189 System.out.println("Trying to add " + parent.get(startIndex) + " to " + selseq); 157 190 taskBuilder.addChild(selseq,parent.get(startIndex)); 158 191 taskBuilder.removeTaskInstance(parent, startIndex); 159 192 i++; 160 } 193 System.out.println("I:" + i); 194 } 195 System.out.println("Trying to add " + selseq + " to " + tmpSel); 161 196 taskBuilder.setChild(selection, selseq); 197 taskBuilder.addChild(subsequence, selection); 198 modelindex++; 199 continue; 162 200 } 163 201 else 164 202 { 165 //System.out.println("Adding SelectionInstance " + parent.get(startIndex) + " to " + tempTask);203 System.out.println("Trying to adding SelectionInstance " + parent.get(startIndex) + " to " + tempTask); 166 204 taskBuilder.setChild(selection, parent.get(startIndex)); 205 taskBuilder.addChild(subsequence,selection); 167 206 } 168 taskBuilder.addChild(subsequence,selection);169 170 207 } else if (tempTask.getType() == "sequence") { 171 //System.out.println("Adding SequenceInstance " + parent.get(startIndex) + " to " + tempTask);208 System.out.println("Adding SequenceInstance " + parent.get(startIndex) + " to " + tempTask); 172 209 taskBuilder.addChild(subsequence, parent.get(startIndex)); 173 210 } else if (tempTask.getType() == "iteration") { 174 //System.out.println("Adding IterationInstance " + parent.get(startIndex) + " to " + tempTask);211 System.out.println("Adding IterationInstance " + parent.get(startIndex) + " to " + tempTask); 175 212 taskBuilder.addChild(subsequence, parent.get(startIndex)); 176 213 } else { 177 //System.out.println("Adding EventInstance " + parent.get(startIndex) + " to " + tempTask); 214 System.out.println("Adding EventInstance " + parent.get(startIndex) + " to " + tempTask); 215 System.out.println("Foo"); 178 216 taskBuilder.addChild(subsequence, parent.get(startIndex)); 179 217 } -
branches/autoquest-core-tasktrees-alignment/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/SequenceForTaskDetectionRuleAlignment.java
r1698 r1700 68 68 class SequenceForTaskDetectionRuleAlignment implements ISessionScopeRule { 69 69 70 //private int iteration = 0;70 private int iteration = 0; 71 71 /** 72 72 * <p> … … 144 144 145 145 do { 146 //iteration++;146 iteration++; 147 147 148 148 appData.detectedAndReplacedTasks = false; … … 526 526 selectionfound = true; 527 527 } 528 else{ 529 continue; 530 } 528 531 i++; 529 532 } … … 639 642 MatchOccurence oc = it.next(); 640 643 641 /*642 if (iteration > 0) {644 645 if (iteration > 1) { 643 646 644 647 System.out.println("Trying to replace sequence: "); … … 659 662 } 660 663 } 661 */664 662 665 // Check if nothing has been replaced in the sequence we 663 666 // want to replace
Note: See TracChangeset
for help on using the changeset viewer.