- Timestamp:
- 08/14/14 16:44:43 (10 years ago)
- Location:
- branches/autoquest-core-tasktrees-alignment/src/main/java/de/ugoe/cs/autoquest/tasktrees
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/autoquest-core-tasktrees-alignment/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/matrix/ObjectDistanceSubstitionMatrix.java
r1676 r1677 46 46 public void generate() { 47 47 48 int index1=-1; 49 int index2=-1; 50 float distance=0; 48 51 for (Iterator<ITaskInstance> it = uniqueTasks.getSymbols().iterator(); it 49 52 .hasNext();) { 50 53 Object obj1 = it.next(); 51 IEventTaskInstance eti1 = null;52 if (obj1 instanceof IEventTaskInstance) {53 System.out.println(obj1);54 eti1 = (IEventTaskInstance) obj1;55 }56 else {57 //System.out.println("Not an EventTaskInstance");58 //System.out.println(obj1);59 continue;60 }61 62 54 for (Iterator<ITaskInstance> jt = uniqueTasks.getSymbols() 63 55 .iterator(); jt.hasNext();) { 56 57 IEventTaskInstance eti1 = null; 58 ITask task1 = null; 59 64 60 IEventTaskInstance eti2 = null; 61 ITask task2 = null; 62 65 63 Object obj2 = jt.next(); 66 if (obj2 instanceof IEventTaskInstance) { 64 65 if (obj1 instanceof IEventTaskInstance && obj2 instanceof IEventTaskInstance) { 66 eti1 = (IEventTaskInstance) obj1; 67 index1 = getIndex(eti1); 67 68 eti2 = (IEventTaskInstance) obj2; 69 index2 = getIndex(eti2); 70 distance = distanceBetweenInstances(eti1,eti2); 68 71 } 69 else{ 70 //System.out.println("Not an EventtaskInstance"); 71 //System.out.println(obj1); 72 continue; 72 else if(obj1 instanceof IEventTaskInstance && !(obj2 instanceof IEventTaskInstance)) { 73 task2 = ((ITaskInstance) obj2).getTask(); 74 index2 = getIndex(task2); 75 eti1 = (IEventTaskInstance) obj1; 76 index1 = getIndex(eti1); 77 distance = distanceBetweenTaskAndInstance(task2,eti1); 73 78 } 74 75 matrix.set(getIndex(eti1), getIndex(eti2),distanceBetweenInstances(eti1,eti2)); 79 else if(!(obj1 instanceof IEventTaskInstance) && obj2 instanceof IEventTaskInstance) { 80 task1 = ((ITaskInstance) obj1).getTask(); 81 index1 = getIndex(task1); 82 eti2 = (IEventTaskInstance) obj2; 83 index2 = getIndex(eti2); 84 distance = distanceBetweenTaskAndInstance(task1,eti2); 85 } 86 else if(!(obj2 instanceof IEventTaskInstance) && !(obj2 instanceof IEventTaskInstance)) { 87 task1 = ((ITaskInstance) obj1).getTask(); 88 index1 = getIndex(task1); 89 task2 = ((ITaskInstance) obj2).getTask(); 90 index2 = getIndex(task2); 91 distance = distanceBetweenTasks(task1,task2); 92 } 93 else { 94 System.out.println("Unknown error"); 95 } 96 97 matrix.set(index1, index2,distance); 76 98 77 99 } 78 100 } 79 101 } 102 103 104 private float distanceBetweenTaskAndInstance(ITask task1, IEventTaskInstance eti) { 105 return 0; 106 } 107 108 private float distanceBetweenTasks(ITask task1, ITask task2) { 109 return 0; 110 } 111 112 113 private int getIndex(ITask task) { 114 int tempindex =-1; 115 if(!idmapping.containsKey(task.getId())) { 116 idmapping.put(task.getId(), index); 117 tempindex = index; 118 index++; 119 } 120 else { 121 tempindex = idmapping.get(task.getId()); 122 } 123 return tempindex; 124 } 80 125 81 126 private int getIndex(IEventTaskInstance eti) { 82 127 int tempindex = -1; 83 if(!idmapping.containsKey(eti.getTask().getId())) 84 { 128 if(!idmapping.containsKey(eti.getTask().getId())) { 85 129 idmapping.put(eti.getTask().getId(), index); 86 130 tempindex = index; 87 131 index++; 88 132 } 89 else 90 { 133 else { 91 134 tempindex = idmapping.get(eti.getTask().getId()); 92 135 } 93 136 return tempindex; 94 } 137 }; 95 138 96 139 private float distanceBetweenInstances(IEventTaskInstance eti1, IEventTaskInstance eti2) { … … 111 154 } 112 155 else { 113 return matrix.get(idmapping.get(taskId1),idmapping.get(taskId2)); 156 int first = idmapping.get(taskId1); 157 int second = idmapping.get(taskId2); 158 System.out.println("First: " + first + " Second: " + second); 159 System.out.println("Matrix: " + matrix.get(first, second)); 160 return matrix.get(first,second); 114 161 } 115 162 -
branches/autoquest-core-tasktrees-alignment/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/SequenceForTaskDetectionRuleAlignment.java
r1675 r1677 226 226 IUserSession session = sessions.get(j); 227 227 228 NumberSequence templist = new NumberSequence(session.size());229 230 228 for (int i = 0; i < session.size(); i++) { 231 229 ITaskInstance taskInstance = session.get(i); … … 429 427 // Both tasks are not equal, we need to insert a selection here 430 428 else { 431 System.out.println("First: " + first[i] + " Second: " + second[i]); 429 //TODO: Debug output 430 //System.out.println("First: " + first[i] + " Second: " + second[i]); 432 431 ISelection selection = taskFactory.createNewSelection(); 433 432 appData.uniqueTasks
Note: See TracChangeset
for help on using the changeset viewer.