Changeset 1570 for branches/ralph/src/main
- Timestamp:
- 06/18/14 21:24:30 (11 years ago)
- Location:
- branches/ralph/src/main/java/de/ugoe/cs/autoquest/tasktrees
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ralph/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/substitution/ObjectDistanceSubstitionMatrix.java
r1568 r1570 1 1 package de.ugoe.cs.autoquest.tasktrees.alignment.substitution; 2 2 3 import java.util.ArrayList; 4 import java.util.Collection; 3 5 4 import java.util.HashMap; 6 5 import java.util.Iterator; 7 6 8 import de.ugoe.cs.autoquest.eventcore.guimodel.GUIModel; 7 9 8 import de.ugoe.cs.autoquest.eventcore.guimodel.IGUIElement; 10 11 import java.util.List;12 13 import de.ugoe.cs.autoquest.eventcore.Event;14 9 import de.ugoe.cs.autoquest.tasktrees.alignment.algorithms.AlignmentHelpers; 15 10 import de.ugoe.cs.autoquest.tasktrees.treeifc.IEventTaskInstance; 16 11 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 17 12 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskInstance; 18 import de.ugoe.cs.autoquest.tasktrees.treeifc.IUserSession;19 13 import de.ugoe.cs.autoquest.usageprofiles.SymbolMap; 20 import de.ugoe.cs.util.console.GlobalDataContainer; 14 21 15 22 16 public class ObjectDistanceSubstitionMatrix implements SubstitutionMatrix { … … 92 86 } 93 87 float distance = -1*AlignmentHelpers.distanceBetween(first, second); 94 //meandistance += distance;88 95 89 96 90 if(distance > maxDistance){ … … 98 92 } 99 93 100 distance += 5;94 distance += positiveThreshold; 101 95 102 //if (distance < positiveThreshold) { 103 // distance = -1*distance; 104 //} 96 105 97 106 98 matrix.set(tempindex1, tempindex2,distance); -
branches/ralph/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/substitution/SubstitutionMatrix.java
r1568 r1570 1 1 package de.ugoe.cs.autoquest.tasktrees.alignment.substitution; 2 2 3 import java.util.Collection;4 import java.util.List;5 6 import de.ugoe.cs.autoquest.eventcore.Event;7 import de.ugoe.cs.autoquest.tasktrees.treeifc.IUserSession;8 3 9 4 -
branches/ralph/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/substitution/TriangleMatrix.java
r1569 r1570 5 5 private double[] matrix; 6 6 private int size; 7 8 7 9 8 10 public TriangleMatrix(int size) { -
branches/ralph/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/SequenceForTaskDetectionRuleAlignment.java
r1568 r1570 27 27 import de.ugoe.cs.autoquest.tasktrees.alignment.algorithms.FengDoolittle; 28 28 import de.ugoe.cs.autoquest.tasktrees.alignment.algorithms.NumberSequence; 29 import de.ugoe.cs.autoquest.tasktrees.alignment.algorithms.SmithWaterman;30 29 import de.ugoe.cs.autoquest.tasktrees.alignment.algorithms.SmithWatermanRepeated; 31 30 import de.ugoe.cs.autoquest.tasktrees.alignment.substitution.ObjectDistanceSubstitionMatrix; … … 163 162 164 163 TriangleMatrix sequenceDistances = new TriangleMatrix(numberseqs.size()); 164 sequenceDistances.initialize(Double.POSITIVE_INFINITY); 165 165 166 166 for (int i = 0; i < numberseqs.size(); i++) { … … 190 190 191 191 double score = twoSequences.getAlignmentScore(); 192 // Scores of the sequence be eing aligned to itself192 // Scores of the sequence being aligned to itself 193 193 double sSelf1 = sameSequence1.getAlignmentScore(); 194 194 double sSelf2 = sameSequence2.getAlignmentScore(); … … 198 198 double sMax = (sSelf1 + sSelf2) / 2; 199 199 double sEff = (score - sRand)/ (sMax - sRand); 200 if(sEff < 0) { 201 sEff = 0; 202 } 200 203 double distance = -Math.log(sEff); 201 202 System.out.println("Score: " + score + " sRand: " + sRand + " sMax: " + sMax + " sEff: " + sEff + " distance: " + distance);203 204 204 sequenceDistances.set(i,j,distance ); 205 206 if(!Double.isInfinite(distance) && !Double.isNaN(distance)) { 207 //System.out.println("Score: " + String.format("%5.1f", score) + " sRand: " + String.format("%5.1f", sRand) + " sMax: " + String.format("%6.1f", sMax) + " distance: " + String.format("%2.3f",distance)); 208 if(distance < sequenceDistances.get(i, j)) { 209 sequenceDistances.set(i,j,distance ); 210 } 211 } 205 212 206 213 if (score > 0) { … … 227 234 } 228 235 } 229 //System.out.println(sequenceDistances.toString());236 System.out.println(sequenceDistances.toString()); 230 237 231 238 do { 232 239 System.out.println(); 233 FengDoolittle fd = new FengDoolittle();240 //FengDoolittle fd = new FengDoolittle(); 234 241 235 242 // appData.getStopWatch().start("whole loop");
Note: See TracChangeset
for help on using the changeset viewer.