Changeset 1734 for branches/autoquest-core-tasktrees-alignment/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/RuleUtils.java
- Timestamp:
- 09/05/14 20:20:29 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/autoquest-core-tasktrees-alignment/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/RuleUtils.java
r1733 r1734 28 28 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskFactory; 29 29 30 30 31 /** 31 32 * <p> 32 33 * provides some convenience methods for rule application 33 * </p> 34 * 34 * </p>. 35 * 35 36 * @author Patrick Harms 36 37 */ … … 41 42 * replaces a sub sequence for a specified range of elements in the provided 42 43 * task instances list by a sub task instance 43 * </p> 44 * 45 * @param parent 46 * the list of which the range shall be replaced 47 * @param startIndex 48 * the start index of the range 49 * @param endIndex 50 * the end index of the range (inclusive) 51 * @param model 52 * the task model (required for instantiating the sub sequence) 53 * @param taskFactory 54 * the task factory used for instantiating the sub sequence 55 * @param taskBuilder 56 * the task builder to perform changes in the task structure 57 * 44 * </p>. 45 * 46 * @param parent the list of which the range shall be replaced 47 * @param startIndex the start index of the range 48 * @param endIndex the end index of the range (inclusive) 49 * @param model the task model (required for instantiating the sub sequence) 50 * @param taskFactory the task factory used for instantiating the sub sequence 51 * @param taskBuilder the task builder to perform changes in the task structure 58 52 * @return the replacement for the range 59 * @throws60 53 */ 61 54 static ISequenceInstance createNewSubSequenceInRange( … … 65 58 .createNewTaskInstance(model); 66 59 67 // TODO: Debug output 68 /* 69 * System.out.println("PRINTING MODEL: "); for (int i = 0; i < 70 * subsequence.getSequence().getChildren().size(); i++) { 71 * System.out.println(subsequence.getSequence().getChildren().get(i)); 72 * 73 * if (subsequence.getSequence().getChildren().get(i).getType() == 74 * "selection") { for (int j = 0; j < ((ISelection) 75 * subsequence.getSequence().getChildren().get(i)) 76 * .getChildren().size(); j++) { if(((IStructuringTemporalRelationship) 77 * subsequence 78 * .getSequence().getChildren().get(i)).getChildren().get(j).getType() 79 * =="sequence") { ISequence foo = (ISequence) ((ISelection) 80 * (subsequence 81 * .getSequence().getChildren().get(i))).getChildren().get(j); 82 * System.out.println("\t" + foo); for(int k=0; k< 83 * foo.getChildren().size();k++) { System.out.println("\t\t" 84 * +foo.getChildren().get(k)); } System.out.println(); } else{ 85 * System.out.println("\t" + ((ISelection) 86 * subsequence.getSequence().getChildren().get(i)) 87 * .getChildren().get(j)); } 88 * 89 * } } 90 * 91 * } System.out.println(); 92 */ 93 94 // TODO: This is dirty! 60 61 // TODO: This is dirty, return this in addition with the sequence instance instead 95 62 missedOptionals = 0; 96 63 int modelindex = 0; … … 144 111 || (parent.get(startIndex).getTask().getId() == tmpSel 145 112 .getChildren().get(1).getId())) { 146 // System.out.println("Session ID: " +147 // parent.get(startIndex).getTask().getId() +148 // " tmpSel(0): " + tmpSel.getChildren().get(0).getId()149 // + " tmpSel(1): " +tmpSel.getChildren().get(1).getId()150 // );151 113 continue; 152 114 } … … 154 116 for (int k = 0; k < selseq.getSequence().getChildren() 155 117 .size(); k++) { 156 // System.out.println("Trying to add " +157 // parent.get(startIndex) + " to " + selseq);158 118 taskBuilder.addChild(selseq, parent.get(startIndex)); 159 119 taskBuilder.removeTaskInstance(parent, startIndex); 160 120 i++; 161 // System.out.println("I:" + i);162 121 } 163 // System.out.println("Trying to add " + selseq + " to " +164 // tmpSel);165 122 taskBuilder.setChild(selection, selseq); 166 123 taskBuilder.addChild(subsequence, selection); … … 168 125 continue; 169 126 } else { 170 // System.out.println("Trying to adding SelectionInstance "171 // + parent.get(startIndex) + " to " + tempTask);172 127 taskBuilder.setChild(selection, parent.get(startIndex)); 173 128 taskBuilder.addChild(subsequence, selection); 174 129 } 175 130 } else if (tempTask.getType() == "sequence") { 176 // System.out.println("Adding SequenceInstance " +177 // parent.get(startIndex) + " to " + tempTask);178 131 taskBuilder.addChild(subsequence, parent.get(startIndex)); 179 132 } else if (tempTask.getType() == "iteration") { 180 // System.out.println("Adding IterationInstance " +181 // parent.get(startIndex) + " to " + tempTask);182 133 taskBuilder.addChild(subsequence, parent.get(startIndex)); 183 134 } else { 184 // System.out.println("Adding EventInstance " +185 // parent.get(startIndex) + " to " + tempTask);186 // System.out.println("Foo");187 135 taskBuilder.addChild(subsequence, parent.get(startIndex)); 188 136 } … … 199 147 * <p> 200 148 * returns the next available id (uses the id counter) 201 * </p> 202 * 149 * </p>. 150 * 203 151 * @return the next available id 204 152 */ … … 241 189 } 242 190 243 // Print out the progress 191 /** 192 * Prints the progress percentage. 193 * 194 * @param message the message 195 * @param count the count 196 * @param size the size 197 */ 244 198 static void printProgressPercentage(String message, int count, int size) { 245 199 if (size > 100) { … … 270 224 private static int idCounter = 0; 271 225 226 /** The missed optionals. */ 272 227 public static int missedOptionals = 0; 273 228 … … 275 230 * <p> 276 231 * prevent instantiation 277 * </p> 232 * </p>. 278 233 */ 279 234 private RuleUtils() {
Note: See TracChangeset
for help on using the changeset viewer.