Changeset 1696
- Timestamp:
- 08/27/14 16:19:30 (10 years ago)
- Location:
- branches/autoquest-core-tasktrees-alignment/src/main/java/de/ugoe/cs/autoquest/tasktrees
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/autoquest-core-tasktrees-alignment/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/matrix/ObjectDistanceSubstitionMatrix.java
r1695 r1696 74 74 int index1 = -1; 75 75 int index2 = -1; 76 doubledistance = 0;76 float distance = 0; 77 77 int count = 0; 78 78 for (Iterator<ITask> it = uniqueTasks.iterator(); it.hasNext();) { … … 131 131 } 132 132 133 private doubledistanceBetweenTaskAndInstance(ITask task1,133 private float distanceBetweenTaskAndInstance(ITask task1, 134 134 IEventTaskInstance eti1) { 135 135 if (this.calculateNonTaskInstances) { … … 145 145 tmpDistance += getScore(taskId1, taskId2); 146 146 } else { 147 doubledist = distanceBetweenInstances(eti1, eti2);147 float dist = distanceBetweenInstances(eti1, eti2); 148 148 matrix.set(getIndex(eti1), getIndex(eti2), dist); 149 149 tmpDistance += dist; … … 160 160 } 161 161 162 private doubledistanceBetweenTasks(ITask task1, ITask task2) {162 private float distanceBetweenTasks(ITask task1, ITask task2) { 163 163 if (this.calculateNonTaskInstances) { 164 164 LinkedList<IEventTaskInstance> eventTaskInstances = etisOfTasks … … 203 203 }; 204 204 205 private doubledistanceBetweenInstances(IEventTaskInstance eti1,205 private float distanceBetweenInstances(IEventTaskInstance eti1, 206 206 IEventTaskInstance eti2) { 207 207 IGUIElement first = (IGUIElement) eti1.getEvent().getTarget(); -
branches/autoquest-core-tasktrees-alignment/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/matrix/PairwiseAlignmentStorage.java
r1589 r1696 15 15 alignments = new AlignmentAlgorithm[sizex+1][sizey+1]; 16 16 sequenceDistances = new UPGMAMatrix(Math.max(sizex,sizey)); 17 sequenceDistances.initialize( Double.POSITIVE_INFINITY);17 sequenceDistances.initialize(Float.POSITIVE_INFINITY); 18 18 } 19 19 … … 28 28 } 29 29 30 public void setDistance(int i,int j, doubledistance) {30 public void setDistance(int i,int j,float distance) { 31 31 sequenceDistances.set(i, j, distance); 32 32 } -
branches/autoquest-core-tasktrees-alignment/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/matrix/TriangleMatrix.java
r1695 r1696 3 3 public class TriangleMatrix { 4 4 5 private double[] matrix;5 private float[] matrix; 6 6 protected int size; 7 7 … … 10 10 public TriangleMatrix(int size) { 11 11 this.size = size; 12 matrix = new double[size*(size+1)/2];12 matrix = new float [size*(size+1)/2]; 13 13 } 14 14 15 public doubleget(int first, int second) {15 public float get(int first, int second) { 16 16 int row = Math.min(first, second); 17 17 int col = Math.max(first, second); … … 20 20 } 21 21 22 public void set(int first, int second, doublevalue) {22 public void set(int first, int second, float value) { 23 23 int row = Math.min(first, second); 24 24 int col = Math.max(first, second); … … 26 26 } 27 27 28 public void initialize( doublevalue) {28 public void initialize(float value) { 29 29 for (int i=0; i < matrix.length; i++) { 30 30 matrix[i] = value; … … 39 39 for(int j = 0; j< size; j++) { 40 40 if(i<j) { 41 if( Double.isInfinite(this.get(i,j))) {41 if(Float.isInfinite(this.get(i,j))) { 42 42 result = result + " -------"; 43 43 } -
branches/autoquest-core-tasktrees-alignment/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/RuleUtils.java
r1694 r1696 111 111 .createNewTaskInstance(model); 112 112 113 // TODO: Debug output114 System.out.println("PRINTING MODEL: ");115 for (int i = 0; i < subsequence.getSequence().getChildren().size(); i++) {116 System.out.println(subsequence.getSequence().getChildren().get(i));117 118 if (subsequence.getSequence().getChildren().get(i).getType() == "selection") {119 for (int j = 0; j < ((ISelection) subsequence.getSequence().getChildren().get(i))120 .getChildren().size(); j++) {121 if(((IStructuringTemporalRelationship) subsequence.getSequence().getChildren().get(i)).getChildren().get(j).getType() =="sequence")122 {123 ISequence foo = (ISequence) ((ISelection) (subsequence.getSequence().getChildren().get(i))).getChildren().get(j);124 System.out.println("\t" + foo);125 for(int k=0; k< foo.getChildren().size();k++) {126 System.out.println("\t\t" +foo.getChildren().get(k));127 }128 System.out.println();129 }130 else{131 System.out.println("\t"132 + ((ISelection) subsequence.getSequence().getChildren().get(i))133 .getChildren().get(j));134 }135 136 }137 }138 139 }140 System.out.println();141 142 113 //TODO: This is dirty! 143 114 missedOptionals=0; … … 154 125 155 126 if(((IMarkingTemporalRelationship) tempTask).getMarkedTask() == parent.get(startIndex).getTask()) { 156 System.out.println("Adding OptionalInstance " + parent.get(startIndex) + " to " + tempTask.getType());127 //System.out.println("Adding OptionalInstance " + parent.get(startIndex) + " to " + tempTask.getType()); 157 128 IOptionalInstance optional = taskFactory.createNewTaskInstance((IOptional) tempTask); 158 129 taskBuilder.setChild(optional, parent.get(startIndex)); … … 171 142 ISelection tmpSel = (ISelection)tempTask; 172 143 if(tmpSel.getChildren().get(0).getType() == "sequence" && tmpSel.getChildren().get(1).getType()=="sequence") { 173 System.out.println("Adding SequenceInstance " + parent.get(startIndex) + " to " + tempTask);174 144 ISequenceInstance selseq = null; 175 //System.out.println("IDS: " + parent.get(startIndex).getTask().getId() + " " +((ISequence)tmpSel.getChildren().get(0)).getChildren().get(0).getId()); 176 //System.out.println("IDS: " + parent.get(startIndex).getTask().getId() + " " +((ISequence)tmpSel.getChildren().get(1)).getChildren().get(0).getId()); 145 //The selection i create can just have 2 children 177 146 if(parent.get(startIndex).getTask().getId() == ((ISequence)tmpSel.getChildren().get(0)).getChildren().get(0).getId()) { 178 147 selseq = taskFactory.createNewTaskInstance((ISequence) tmpSel.getChildren().get(0)); … … 182 151 } 183 152 else if(parent.get(startIndex).getTask().getId() == tmpSel.getChildren().get(0).getId() || parent.get(startIndex).getTask().getId() == tmpSel.getChildren().get(1).getId() ) { 184 selseq = (ISequenceInstance) parent.get(startIndex);185 taskBuilder.setChild(selection, selseq);186 153 continue; 187 154 } … … 196 163 else 197 164 { 198 System.out.println("Adding SelectionInstance " + parent.get(startIndex) + " to " + tempTask);165 //System.out.println("Adding SelectionInstance " + parent.get(startIndex) + " to " + tempTask); 199 166 taskBuilder.setChild(selection, parent.get(startIndex)); 200 167 } … … 202 169 203 170 } else if (tempTask.getType() == "sequence") { 204 System.out.println("Adding SequenceInstance " + parent.get(startIndex) + " to " + tempTask); 205 //ISequenceInstance sequence = taskFactory.createNewTaskInstance((ISequence) tempTask); 206 //taskBuilder.addChild(sequence, parent.get(i)); 207 //taskBuilder.addChild(subsequence,sequence); 171 //System.out.println("Adding SequenceInstance " + parent.get(startIndex) + " to " + tempTask); 208 172 taskBuilder.addChild(subsequence, parent.get(startIndex)); 209 173 } else if (tempTask.getType() == "iteration") { 210 System.out.println("Adding IterationInstance " + parent.get(startIndex) + " to " + tempTask);174 //System.out.println("Adding IterationInstance " + parent.get(startIndex) + " to " + tempTask); 211 175 taskBuilder.addChild(subsequence, parent.get(startIndex)); 212 176 } else { 213 System.out.println("Adding EventInstance " + parent.get(startIndex) + " to " + tempTask);177 //System.out.println("Adding EventInstance " + parent.get(startIndex) + " to " + tempTask); 214 178 taskBuilder.addChild(subsequence, parent.get(startIndex)); 215 179 } -
branches/autoquest-core-tasktrees-alignment/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/SequenceForTaskDetectionRuleAlignment.java
r1693 r1696 443 443 * @return 444 444 */ 445 public ISequence matchAsSequence(RuleApplicationData appData, Match m) { 446 447 System.out.println("DEBUGGING MODEL GENERATION"); 448 System.out.println(); 449 445 public ISequence matchAsSequence(RuleApplicationData appData, Match m) { 450 446 ISequence sequence = taskFactory.createNewSequence(); 451 447 appData.uniqueTasks.add(sequence); … … 506 502 taskBuilder.addChild(sequence, selection); 507 503 } else { 508 System.out.println("SELECTION OF SEQUENCES FOUND!");509 504 boolean selectionfound = true; 510 505 ISelection selection = taskFactory.createNewSelection(); … … 543 538 } 544 539 } 545 546 540 else { 547 541 if ((first[i] != second[i])) { … … 578 572 Console.traceln(Level.INFO, "generating substitution matrix"); 579 573 ObjectDistanceSubstitionMatrix submat = new ObjectDistanceSubstitionMatrix( 580 appData.getUniqueTasks(), 6, -3 );574 appData.getUniqueTasks(), 6, -3,false); 581 575 submat.generate(); 582 576 … … 661 655 MatchOccurence oc = it.next(); 662 656 657 /* 663 658 if (iteration > 0) { 664 659 … … 680 675 } 681 676 } 677 */ 682 678 // Check if nothing has been replaced in the sequence we 683 679 // want to replace … … 740 736 alignments = null; 741 737 matchseqs = null; 738 submat = null; 742 739 appData.getStopWatch().stop("replacing tasks"); 743 740 } … … 788 785 789 786 /** 790 * @return the tree787 * @return the UserSessions as List. 791 788 */ 792 789 private List<IUserSession> getSessions() {
Note: See TracChangeset
for help on using the changeset viewer.