- Timestamp:
- 07/04/14 00:38:41 (10 years ago)
- Location:
- branches/ralph/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/algorithms
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ralph/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/algorithms/AlignmentAlgorithm.java
r1586 r1587 12 12 public abstract ArrayList<NumberSequence> getAlignment(); 13 13 14 public abstract void printDPMatrix(); 15 16 public abstract void printAlignment(); 17 14 18 } -
branches/ralph/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/algorithms/AlignmentAlgorithmFactory.java
r1586 r1587 8 8 public static AlignmentAlgorithm create(int[] input1, int[] input2, SubstitutionMatrix submat,float threshold) { 9 9 10 return new SmithWaterman(input1,input2,submat,threshold); 10 //return new NeedlemanWunsch(input1,input2,submat,threshold); 11 return new NeedlemanWunsch(input1,input2,submat,threshold); 12 //return new SmithWatermanRepeated(input1,input2,submat,threshold); 11 13 } 12 14 } -
branches/ralph/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/algorithms/SmithWaterman.java
r1586 r1587 32 32 33 33 private ArrayList<NumberSequence> alignment; 34 35 private float scoreThreshold;36 34 37 35 /** … … 51 49 // + submat.getClass() + " Substitution Matrix: " + 52 50 // submat.getClass().getCanonicalName()); 53 this.scoreThreshold = threshold;54 51 55 52 matrix = new MatrixEntry[length1 + 1][length2 + 1]; … … 93 90 94 91 // the first column 95 for (int j = 1; j < length2 +1; j++) {92 for (int j = 1; j < length2; j++) { 96 93 matrix[0][j].setScore(0); 97 94 matrix[0][j].setPrevious(matrix[0][j - 1]); … … 101 98 // the first row 102 99 103 for (int j = 1; j < length1 +1; j++) {100 for (int j = 1; j < length1; j++) { 104 101 matrix[j][0].setScore(0); 105 102 matrix[j][0].setPrevious(matrix[j - 1][0]); … … 262 259 System.out.format("%5d", input1[i - 1]); 263 260 System.out.println(); 264 for (int j = 0; j < length2; j++) {261 for (int j = 0; j <= length2; j++) { 265 262 if (j > 0) 266 263 System.out.format("%5d ", input2[j - 1]); … … 268 265 System.out.print(" "); 269 266 } 270 for (int i = 0; i < length1; i++) {267 for (int i = 0; i <= length1; i++) { 271 268 System.out.format("%4.1f ", matrix[i][j].getScore()); 272 269 } -
branches/ralph/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/algorithms/SmithWatermanRepeated.java
r1586 r1587 102 102 103 103 104 for (int i = 1; i < = length1 + 1; i++) {104 for (int i = 1; i < length1 + 2; i++) { 105 105 106 106 // Formula for first row: … … 220 220 public void traceback() { 221 221 MatrixEntry tmp = matrix[length1+1][0]; 222 int aligned1[] = new int[length1+ length2+2];223 int aligned2[] = new int[length1+ length2+2];222 int aligned1[] = new int[length1+1+length2+2]; 223 int aligned2[] = new int[length1+1+length2+2]; 224 224 int count = 0; 225 225 do … … 227 227 if(count != 0) 228 228 { 229 if (length1+ length2+2 == count) {229 if (length1+1+length2+2 == count) { 230 230 Console.traceln(Level.WARNING, "Traceback longer than both sequences summed up!"); 231 231 break; … … 312 312 System.out.format("%5d", input1[i - 1]); 313 313 System.out.println(); 314 for (int j = 0; j < length2; j++) {314 for (int j = 0; j <= length2; j++) { 315 315 if (j > 0) 316 316 System.out.format("%5d ",input2[j - 1]);
Note: See TracChangeset
for help on using the changeset viewer.