Changeset 1690 for branches/autoquest-core-tasktrees-alignment
- Timestamp:
- 08/22/14 01:14:05 (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
r1682 r1690 15 15 package de.ugoe.cs.autoquest.tasktrees.temporalrelation; 16 16 17 import de.ugoe.cs.autoquest.tasktrees.alignment.algorithms.NumberSequence;18 import de.ugoe.cs.autoquest.tasktrees.treeifc.IIteration;19 import de.ugoe.cs.autoquest.tasktrees.treeifc.IIterationInstance;20 17 import de.ugoe.cs.autoquest.tasktrees.treeifc.IMarkingTemporalRelationship; 21 18 import de.ugoe.cs.autoquest.tasktrees.treeifc.IOptional; … … 128 125 129 126 if(((IMarkingTemporalRelationship) tempTask).getMarkedTask() == parent.get(startIndex).getTask()) { 130 System.out.println("Adding OptionalInstance " + parent.get(startIndex) + " to " + tempTask.getType());127 //System.out.println("Adding OptionalInstance " + parent.get(startIndex) + " to " + tempTask.getType()); 131 128 IOptionalInstance optional = taskFactory.createNewTaskInstance((IOptional) tempTask); 132 129 taskBuilder.setChild(optional, parent.get(startIndex)); … … 134 131 } 135 132 else { 136 System.out.println("Adding Empty optional, not deleting anything from the input sequence");133 //System.out.println("Adding Empty optional, not deleting anything from the input sequence"); 137 134 IOptionalInstance optional = taskFactory.createNewTaskInstance((IOptional) tempTask); 138 135 taskBuilder.addChild(subsequence, optional); … … 142 139 } 143 140 } else if (tempTask.getType() == "selection") { 144 System.out.println("Adding SelectionInstance " + parent.get(startIndex) + " to " + tempTask.getType());141 //System.out.println("Adding SelectionInstance " + parent.get(startIndex) + " to " + tempTask.getType()); 145 142 ISelectionInstance selection = taskFactory.createNewTaskInstance((ISelection) tempTask); 146 143 taskBuilder.setChild(selection, parent.get(startIndex) ); … … 148 145 149 146 } else if (tempTask.getType() == "sequence") { 150 System.out.println("Adding SequenceInstance " + parent.get(startIndex) + " to " + tempTask.getType());147 //System.out.println("Adding SequenceInstance " + parent.get(startIndex) + " to " + tempTask.getType()); 151 148 taskBuilder.addChild(subsequence,parent.get(startIndex)); 152 149 } else if (tempTask.getType() == "iteration") { 153 //IIterationInstance iteration = taskFactory.createNewTaskInstance((IIteration) tempTask);154 //taskBuilder.addChild(iteration,parent.get(startIndex));155 150 taskBuilder.addChild(subsequence, parent.get(startIndex)); 156 System.out.println("Adding IterationInstance " + parent.get(startIndex) + " to " + tempTask.getType());151 //System.out.println("Adding IterationInstance " + parent.get(startIndex) + " to " + tempTask.getType()); 157 152 } else { 158 System.out.println("Adding EventInstance " + parent.get(startIndex) + " to " + tempTask.getType());153 //System.out.println("Adding EventInstance " + parent.get(startIndex) + " to " + tempTask.getType()); 159 154 taskBuilder.addChild(subsequence, parent.get(startIndex)); 160 155 } -
branches/autoquest-core-tasktrees-alignment/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/SequenceForTaskDetectionRuleAlignment.java
r1687 r1690 38 38 import de.ugoe.cs.autoquest.tasktrees.treeifc.IOptional; 39 39 import de.ugoe.cs.autoquest.tasktrees.treeifc.ISelection; 40 import de.ugoe.cs.autoquest.tasktrees.treeifc.ISelectionInstance;41 40 import de.ugoe.cs.autoquest.tasktrees.treeifc.ISequence; 42 41 import de.ugoe.cs.autoquest.tasktrees.treeifc.ISequenceInstance; … … 93 92 private TaskHandlingStrategy preparationTaskHandlingStrategy; 94 93 95 /**96 * <p>97 * the task handling strategy to be used for comparing tasks during98 * iteration detection i.e., after the tasks are harmonized99 * </p>100 */101 private TaskHandlingStrategy identityTaskHandlingStrategy;102 94 103 95 /** … … 123 115 this.preparationTaskHandlingStrategy = new TaskHandlingStrategy( 124 116 minimalTaskEquality); 125 this.identityTaskHandlingStrategy = new TaskHandlingStrategy(126 TaskEquality.IDENTICAL);127 117 128 118 } … … 153 143 iteration++; 154 144 appData.detectedAndReplacedTasks = false; 155 156 145 appData.getStopWatch().start("whole loop"); 157 146 detectAndReplaceIterations(appData); … … 188 177 for (int j = 0; j < session.size(); j++) { 189 178 ITaskInstance taskInstance = session.get(j); 190 //System.out.print(taskInstance.getTask().getId() + " ");191 179 templist.getSequence()[j] = taskInstance.getTask().getId(); 192 appData.getNumber2Task().put(templist.getSequence()[j],193 taskInstance.getTask());194 180 } 195 181 //System.out.println(); … … 219 205 "harmonizing task model of event task instances"); 220 206 appData.getStopWatch().start("harmonizing event tasks"); 221 222 appData.uniqueTasks = preparationTaskHandlingStrategy.createSymbolMap(); 207 SymbolMap<ITaskInstance, ITask> uniqueTasks = preparationTaskHandlingStrategy.createSymbolMap(); 223 208 224 209 TaskInstanceComparator comparator = preparationTaskHandlingStrategy … … 233 218 for (int i = 0; i < session.size(); i++) { 234 219 ITaskInstance taskInstance = session.get(i); 235 task = appData.getUniqueTasks().getValue(taskInstance);220 task = uniqueTasks.getValue(taskInstance); 236 221 237 222 if (task == null) { 238 appData.getUniqueTasks().addSymbol(taskInstance,223 uniqueTasks.addSymbol(taskInstance, 239 224 taskInstance.getTask()); 225 appData.getUniqueTasks().add(taskInstance.getTask()); 226 appData.getNumber2Task().put(taskInstance.getTask().getId(),taskInstance.getTask()); 240 227 } else { 241 228 taskBuilder.setTask(taskInstance, task); … … 333 320 for (ITask iteratedTask : iteratedTasks) { 334 321 335 // TODO: Check if this is correct336 322 IIteration iteration = taskFactory.createNewIteration(); 337 appData.getUniqueTasks().addSymbol( 338 taskFactory.createNewTaskInstance(iteration), iteration); 323 appData.getUniqueTasks().add( iteration); 339 324 appData.getNumber2Task().put(iteration.getId(), iteration); 340 325 iterations.put(iteratedTask, iteration); … … 384 369 385 370 ISequence sequence = taskFactory.createNewSequence(); 371 appData.uniqueTasks.add(sequence); 372 appData.number2task.put(sequence.getId(), sequence); 373 386 374 387 375 int[] first = m.getFirstSequence().getSequence(); … … 406 394 else if (first[i] == -1 && second[i] != -1) { 407 395 IOptional optional = taskFactory.createNewOptional(); 408 appData.uniqueTasks.addSymbol( 409 //TODO:: Don't create TaskInstances here, use a set of tasks instead 410 taskFactory.createNewTaskInstance(optional), optional); 396 appData.uniqueTasks.add(optional); 411 397 appData.number2task.put(optional.getId(), optional); 412 398 taskBuilder.setMarkedTask(optional, appData.getNumber2Task() … … 418 404 else if (first[i] != -1 && second[i] == -1) { 419 405 IOptional optional = taskFactory.createNewOptional(); 420 //TODO:: Don't create TaskInstances here, use a set of tasks instead 421 appData.uniqueTasks.addSymbol( 422 taskFactory.createNewTaskInstance(optional), optional); 406 appData.uniqueTasks.add(optional); 423 407 appData.number2task.put(optional.getId(), optional); 424 408 taskBuilder.setMarkedTask(optional, appData.getNumber2Task() … … 428 412 // Both tasks are not equal, we need to insert a selection here 429 413 else { 430 //TODO: Debug output431 //System.out.println("First: " + first[i] + " Second: " + second[i]);432 414 ISelection selection = taskFactory.createNewSelection(); 433 //TODO:: Don't create TaskInstances here, use a set of tasks instead 434 ISelectionInstance temp = taskFactory.createNewTaskInstance(selection); 435 appData.uniqueTasks 436 .addSymbol(temp,selection); 415 appData.getUniqueTasks().add(selection); 437 416 appData.number2task.put(selection.getId(), selection); 438 417 taskBuilder.addChild(selection, … … 649 628 private HashMap<Integer, ITask> number2task; 650 629 651 private SymbolMap<ITaskInstance, ITask> uniqueTasks; 630 //TODO: We Actually just need number2task here 631 private HashSet<ITask> uniqueTasks; 652 632 653 633 private ArrayList<NumberSequence> numberseqs; … … 679 659 this.sessions = sessions; 680 660 numberseqs = new ArrayList<NumberSequence>(); 661 uniqueTasks = new HashSet<ITask>(); 681 662 number2task = new HashMap<Integer, ITask>(); 682 663 stopWatch = new StopWatch(); … … 691 672 } 692 673 693 private SymbolMap<ITaskInstance,ITask> getUniqueTasks() {674 private HashSet<ITask> getUniqueTasks() { 694 675 return uniqueTasks; 695 676 }
Note: See TracChangeset
for help on using the changeset viewer.