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/SmithWatermanRepeated.java

    r1596 r1612  
    4343        private SubstitutionMatrix submat; 
    4444 
    45         public SmithWatermanRepeated(int[] input1, int[] input2, SubstitutionMatrix submat,float threshold) { 
    46                 this.input1 = input1; 
    47                 this.input2 = input2; 
    48                 length1 = input1.length; 
    49                 length2 = input2.length; 
    50                 this.submat = submat; 
    51  
    52                 //System.out.println("Starting SmithWaterman algorithm with a " 
    53                 //              + submat.getClass() + " Substitution Matrix: " + submat.getClass().getCanonicalName()); 
    54                 this.scoreThreshold = threshold; 
    55                  
    56                 matrix = new MatrixEntry[length1+2][length2+1]; 
    57                 alignment = new ArrayList<NumberSequence>(); 
    58                  
    59                 for (int i = 0; i <= length1+1; i++) { 
    60                         for(int j = 0; j< length2; j++) { 
    61                                 matrix[i][j] = new MatrixEntry(); 
    62                         } 
    63                 } 
    64          
    65  
    66                 buildMatrix(); 
    67                 traceback(); 
     45        public SmithWatermanRepeated() { 
     46         
    6847        } 
    6948 
     
    374353        } 
    375354 
     355        @Override 
     356        public void align(int[] input1, int[] input2, SubstitutionMatrix submat, 
     357                        float threshold) { 
     358                this.input1 = input1; 
     359                this.input2 = input2; 
     360                length1 = input1.length; 
     361                length2 = input2.length; 
     362                this.submat = submat; 
     363 
     364                //System.out.println("Starting SmithWaterman algorithm with a " 
     365                //              + submat.getClass() + " Substitution Matrix: " + submat.getClass().getCanonicalName()); 
     366                this.scoreThreshold = threshold; 
     367                 
     368                matrix = new MatrixEntry[length1+2][length2+1]; 
     369                alignment = new ArrayList<NumberSequence>(); 
     370                 
     371                for (int i = 0; i <= length1+1; i++) { 
     372                        for(int j = 0; j< length2; j++) { 
     373                                matrix[i][j] = new MatrixEntry(); 
     374                        } 
     375                } 
     376         
     377 
     378                buildMatrix(); 
     379                traceback(); 
     380        } 
     381 
    376382} 
Note: See TracChangeset for help on using the changeset viewer.