Ignore:
Timestamp:
07/14/14 23:27:01 (10 years ago)
Author:
rkrimmel
Message:

Removed parameters from alignmentalgorihm factory constructor and changed interface by adding a new align() method, which now gets all the data via parameter

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ralph/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/algorithms/NeedlemanWunsch.java

    r1592 r1612  
    3939        private SubstitutionMatrix submat; 
    4040 
    41         public NeedlemanWunsch(int[] input1, int[] input2, SubstitutionMatrix submat, 
    42                         float threshold) { 
    43                 this.input1 = input1; 
    44                 this.input2 = input2; 
    45                 length1 = input1.length; 
    46                 length2 = input2.length; 
    47                 this.submat = submat; 
    48  
    49                 // System.out.println("Starting SmithWaterman algorithm with a " 
    50                 // + submat.getClass() + " Substitution Matrix: " + 
    51                 // submat.getClass().getCanonicalName()); 
    52  
    53                 matrix = new MatrixEntry[length1 + 1][length2 + 1]; 
    54                 alignment = new ArrayList<NumberSequence>(); 
    55  
    56                 for (int i = 0; i < length1+1; i++) { 
    57                         for (int j = 0; j < length2+1; j++) { 
    58                                 matrix[i][j] = new MatrixEntry(); 
    59                         } 
    60                 } 
    61  
    62                 buildMatrix(); 
    63                 traceback(); 
    64         } 
    6541 
    6642        /** 
     
    289265        } 
    290266 
     267        @Override 
     268        public void align(int[] input1, int[] input2, SubstitutionMatrix submat, 
     269                        float threshold) { 
     270                this.input1 = input1; 
     271                this.input2 = input2; 
     272                length1 = input1.length; 
     273                length2 = input2.length; 
     274                this.submat = submat; 
     275 
     276                // System.out.println("Starting SmithWaterman algorithm with a " 
     277                // + submat.getClass() + " Substitution Matrix: " + 
     278                // submat.getClass().getCanonicalName()); 
     279 
     280                matrix = new MatrixEntry[length1 + 1][length2 + 1]; 
     281                alignment = new ArrayList<NumberSequence>(); 
     282 
     283                for (int i = 0; i < length1+1; i++) { 
     284                        for (int j = 0; j < length2+1; j++) { 
     285                                matrix[i][j] = new MatrixEntry(); 
     286                        } 
     287                } 
     288 
     289                buildMatrix(); 
     290                traceback(); 
     291                 
     292        } 
     293 
    291294 
    292295 
Note: See TracChangeset for help on using the changeset viewer.