Changeset 1734 for branches/autoquest-core-tasktrees-alignment/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/matrix
- Timestamp:
- 09/05/14 20:20:29 (10 years ago)
- Location:
- branches/autoquest-core-tasktrees-alignment/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/matrix
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/autoquest-core-tasktrees-alignment/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/matrix/DifferenceSubstitutionMatrix.java
r1733 r1734 9 9 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 10 10 11 // TODO: Auto-generated Javadoc 11 12 /** 13 * The Class DifferenceSubstitutionMatrix. 14 * 12 15 * @author Ralph Krimmel 13 *14 16 */ 15 17 public class DifferenceSubstitutionMatrix implements SubstitutionMatrix { 16 18 19 /** The input1. */ 17 20 private final int[] input1; 21 22 /** The input2. */ 18 23 private final int[] input2; 24 25 /** The max value. */ 19 26 private final int maxValue; 20 27 28 /** 29 * Instantiates a new difference substitution matrix. 30 * 31 * @param input1 the input1 32 * @param input2 the input2 33 */ 21 34 public DifferenceSubstitutionMatrix(int[] input1, int[] input2) { 22 35 this.input1 = input1; … … 25 38 } 26 39 40 /* (non-Javadoc) 41 * @see de.ugoe.cs.autoquest.tasktrees.alignment.matrix.SubstitutionMatrix#generate(java.util.HashSet) 42 */ 27 43 @Override 28 44 public void generate(HashSet<ITask> uniqueTasks) { 29 45 } 30 46 47 /* (non-Javadoc) 48 * @see de.ugoe.cs.autoquest.tasktrees.alignment.matrix.SubstitutionMatrix#getGapPenalty() 49 */ 31 50 @Override 32 51 public float getGapPenalty() { … … 34 53 } 35 54 55 /** 56 * Gets the max value. 57 * 58 * @return the max value 59 */ 36 60 private int getMaxValue() { 37 61 int max = input1[0]; … … 61 85 } 62 86 87 /* (non-Javadoc) 88 * @see de.ugoe.cs.autoquest.tasktrees.alignment.matrix.SubstitutionMatrix#update(java.util.LinkedList) 89 */ 63 90 @Override 64 91 public void update(LinkedList<ITask> newlyGeneratedTasks) { -
branches/autoquest-core-tasktrees-alignment/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/matrix/DummySubstitutionMatrix.java
r1733 r1734 1 /* 2 * 3 */ 1 4 package de.ugoe.cs.autoquest.tasktrees.alignment.matrix; 2 5 … … 6 9 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 7 10 11 // TODO: Auto-generated Javadoc 12 /** 13 * The Class DummySubstitutionMatrix. 14 */ 8 15 public class DummySubstitutionMatrix implements SubstitutionMatrix { 9 16 17 /* (non-Javadoc) 18 * @see de.ugoe.cs.autoquest.tasktrees.alignment.matrix.SubstitutionMatrix#generate(java.util.HashSet) 19 */ 10 20 @Override 11 21 public void generate(HashSet<ITask> uniqueTasks) { 12 22 } 13 23 24 /* (non-Javadoc) 25 * @see de.ugoe.cs.autoquest.tasktrees.alignment.matrix.SubstitutionMatrix#getGapPenalty() 26 */ 14 27 @Override 15 28 public float getGapPenalty() { … … 17 30 } 18 31 32 /* (non-Javadoc) 33 * @see de.ugoe.cs.autoquest.tasktrees.alignment.matrix.SubstitutionMatrix#getScore(int, int) 34 */ 19 35 @Override 20 36 public float getScore(int pos1, int pos2) { … … 26 42 } 27 43 44 /* (non-Javadoc) 45 * @see de.ugoe.cs.autoquest.tasktrees.alignment.matrix.SubstitutionMatrix#update(java.util.LinkedList) 46 */ 28 47 @Override 29 48 public void update(LinkedList<ITask> newlyGeneratedTasks) { -
branches/autoquest-core-tasktrees-alignment/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/matrix/DynamicTriangleMatrix.java
r1733 r1734 1 /* 2 * 3 */ 1 4 package de.ugoe.cs.autoquest.tasktrees.alignment.matrix; 2 5 3 6 import java.util.ArrayList; 4 7 8 // TODO: Auto-generated Javadoc 5 9 //Must be initialized! 10 /** 11 * The Class DynamicTriangleMatrix. 12 */ 6 13 public class DynamicTriangleMatrix implements ITriangleMatrix { 7 14 15 /** The matrix. */ 8 16 private final ArrayList<Float> matrix; 17 18 /** The size. */ 9 19 protected int size; 20 21 /** The initalization value. */ 10 22 private float initalizationValue; 11 23 24 /** 25 * Instantiates a new dynamic triangle matrix. 26 * 27 * @param size the size 28 */ 12 29 public DynamicTriangleMatrix(int size) { 13 30 this.size = size; … … 81 98 } 82 99 100 /* (non-Javadoc) 101 * @see de.ugoe.cs.autoquest.tasktrees.alignment.matrix.ITriangleMatrix#size() 102 */ 83 103 @Override 84 104 public int size() { -
branches/autoquest-core-tasktrees-alignment/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/matrix/EventTaskInstancesListGenerator.java
r1733 r1734 1 /* 2 * 3 */ 1 4 package de.ugoe.cs.autoquest.tasktrees.alignment.matrix; 2 5 … … 7 10 import de.ugoe.cs.autoquest.tasktrees.treeifc.IEventTaskInstance; 8 11 12 // TODO: Auto-generated Javadoc 13 /** 14 * The Class EventTaskInstancesListGenerator. 15 */ 9 16 public class EventTaskInstancesListGenerator extends 10 17 DefaultTaskTraversingVisitor { 11 18 19 /** The eventlist. */ 12 20 private LinkedList<IEventTaskInstance> eventlist; 13 21 22 /** 23 * Instantiates a new event task instances list generator. 24 */ 14 25 public EventTaskInstancesListGenerator() { 15 26 eventlist = new LinkedList<IEventTaskInstance>(); 16 27 } 17 28 29 /** 30 * Gets the eventlist. 31 * 32 * @return the eventlist 33 */ 18 34 public LinkedList<IEventTaskInstance> getEventlist() { 19 35 return eventlist; 20 36 } 21 37 38 /** 39 * Sets the eventlist. 40 * 41 * @param eventlist the new eventlist 42 */ 22 43 public void setEventlist(LinkedList<IEventTaskInstance> eventlist) { 23 44 this.eventlist = eventlist; 24 45 } 25 46 47 /* (non-Javadoc) 48 * @see de.ugoe.cs.autoquest.tasktrees.treeifc.DefaultTaskTraversingVisitor#visit(de.ugoe.cs.autoquest.tasktrees.treeifc.IEventTask) 49 */ 26 50 @Override 27 51 public void visit(IEventTask eventTask) { -
branches/autoquest-core-tasktrees-alignment/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/matrix/ITriangleMatrix.java
r1733 r1734 1 /* 2 * 3 */ 1 4 package de.ugoe.cs.autoquest.tasktrees.alignment.matrix; 2 5 6 // TODO: Auto-generated Javadoc 7 /** 8 * The Interface ITriangleMatrix. 9 */ 3 10 public interface ITriangleMatrix { 4 11 12 /** 13 * Gets the. 14 * 15 * @param first the first 16 * @param second the second 17 * @return the float 18 */ 5 19 public abstract float get(int first, int second); 6 20 7 21 // Increases the size 22 /** 23 * Increase size. 24 * 25 * @param count the count 26 * @throws Exception the exception 27 */ 8 28 public abstract void increaseSize(int count) throws Exception; 9 29 30 /** 31 * Initialize. 32 * 33 * @param value the value 34 */ 10 35 public abstract void initialize(float value); 11 36 37 /** 38 * Sets the. 39 * 40 * @param first the first 41 * @param second the second 42 * @param value the value 43 */ 12 44 public abstract void set(int first, int second, float value); 13 45 46 /** 47 * Size. 48 * 49 * @return the int 50 */ 14 51 public abstract int size(); 15 52 53 /** 54 * To string. 55 * 56 * @return the string 57 */ 16 58 @Override 17 59 public abstract String toString(); -
branches/autoquest-core-tasktrees-alignment/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/matrix/NearbySubstitutionMatrix.java
r1733 r1734 9 9 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 10 10 11 // TODO: Auto-generated Javadoc 11 12 /** 13 * The Class NearbySubstitutionMatrix. 14 * 12 15 * @author Ralph Krimmel 13 *14 16 */ 15 17 public class NearbySubstitutionMatrix implements SubstitutionMatrix { 16 18 19 /** The input1. */ 17 20 private final int[] input1; 21 22 /** The input2. */ 18 23 private final int[] input2; 24 25 /** The range. */ 19 26 private final int range; 20 27 28 /** 29 * Instantiates a new nearby substitution matrix. 30 * 31 * @param input1 the input1 32 * @param input2 the input2 33 * @param range the range 34 */ 21 35 public NearbySubstitutionMatrix(int[] input1, int[] input2, int range) { 22 36 this.input1 = input1; … … 25 39 } 26 40 41 /* (non-Javadoc) 42 * @see de.ugoe.cs.autoquest.tasktrees.alignment.matrix.SubstitutionMatrix#generate(java.util.HashSet) 43 */ 27 44 @Override 28 45 public void generate(HashSet<ITask> uniqueTasks) { 29 46 } 30 47 48 /* (non-Javadoc) 49 * @see de.ugoe.cs.autoquest.tasktrees.alignment.matrix.SubstitutionMatrix#getGapPenalty() 50 */ 31 51 @Override 32 52 public float getGapPenalty() { … … 51 71 } 52 72 73 /* (non-Javadoc) 74 * @see de.ugoe.cs.autoquest.tasktrees.alignment.matrix.SubstitutionMatrix#update(java.util.LinkedList) 75 */ 53 76 @Override 54 77 public void update(LinkedList<ITask> newlyGeneratedTasks) { -
branches/autoquest-core-tasktrees-alignment/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/matrix/ObjectDistanceSubstitionMatrix.java
r1733 r1734 1 /* 2 * 3 */ 1 4 package de.ugoe.cs.autoquest.tasktrees.alignment.matrix; 2 5 … … 17 20 import de.ugoe.cs.util.console.Console; 18 21 22 // TODO: Auto-generated Javadoc 23 /** 24 * The Class ObjectDistanceSubstitionMatrix. 25 */ 19 26 public class ObjectDistanceSubstitionMatrix implements SubstitutionMatrix, 20 27 Serializable { 21 28 22 /** 23 * 24 */ 29 /** The Constant serialVersionUID. */ 25 30 private static final long serialVersionUID = -4253258274617754083L; 31 32 /** The idmapping. */ 26 33 private final HashMap<Integer, Integer> idmapping; 34 35 /** The matrix. */ 27 36 private ITriangleMatrix matrix; 37 38 /** The unique tasks. */ 28 39 private HashSet<ITask> uniqueTasks; 40 41 /** The gap penalty. */ 29 42 private float gapPenalty; 43 44 /** The index. */ 30 45 private int index = 0; 46 47 /** The etis of tasks. */ 31 48 private final HashMap<Integer, LinkedList<IEventTaskInstance>> etisOfTasks; 49 50 /** The calculate non task instances. */ 32 51 private boolean calculateNonTaskInstances = true; 52 53 /** The first round max index. */ 33 54 private int firstRoundMaxIndex = 0; 34 55 56 /** The positive threshold. */ 35 57 private final double positiveThreshold; 36 58 59 /** 60 * Instantiates a new object distance substition matrix. 61 * 62 * @param positiveThreshold the positive threshold 63 * @param gapPenalty the gap penalty 64 * @param calculateNonTaskInstances the calculate non task instances 65 */ 37 66 public ObjectDistanceSubstitionMatrix(float positiveThreshold, 38 67 int gapPenalty, boolean calculateNonTaskInstances) { … … 45 74 } 46 75 76 /** 77 * Compute distance. 78 * 79 * @param task1 the task1 80 * @param task2 the task2 81 */ 47 82 private void computeDistance(ITask task1, ITask task2) { 48 83 int index1 = -1; … … 92 127 } 93 128 129 /** 130 * Distance between instances. 131 * 132 * @param eti1 the eti1 133 * @param eti2 the eti2 134 * @return the float 135 */ 94 136 private float distanceBetweenInstances(IEventTaskInstance eti1, 95 137 IEventTaskInstance eti2) { … … 101 143 } 102 144 145 /** 146 * Distance between task and instance. 147 * 148 * @param task1 the task1 149 * @param eti1 the eti1 150 * @return the float 151 */ 103 152 private float distanceBetweenTaskAndInstance(ITask task1, 104 153 IEventTaskInstance eti1) { … … 127 176 } 128 177 178 /** 179 * Distance between tasks. 180 * 181 * @param task1 the task1 182 * @param task2 the task2 183 * @return the float 184 */ 129 185 private float distanceBetweenTasks(ITask task1, ITask task2) { 130 186 if (this.calculateNonTaskInstances) { … … 144 200 } 145 201 202 /* (non-Javadoc) 203 * @see de.ugoe.cs.autoquest.tasktrees.alignment.matrix.SubstitutionMatrix#generate(java.util.HashSet) 204 */ 146 205 @Override 147 206 public void generate(HashSet<ITask> uniqueTasks) { … … 174 233 } 175 234 235 /* (non-Javadoc) 236 * @see de.ugoe.cs.autoquest.tasktrees.alignment.matrix.SubstitutionMatrix#getGapPenalty() 237 */ 176 238 @Override 177 239 public float getGapPenalty() { … … 179 241 } 180 242 243 /** 244 * Gets the index. 245 * 246 * @param eti the eti 247 * @return the index 248 */ 181 249 synchronized private int getIndex(IEventTaskInstance eti) { 182 250 int tempindex = -1; … … 191 259 } 192 260 261 /** 262 * Gets the index. 263 * 264 * @param task the task 265 * @return the index 266 */ 193 267 synchronized private int getIndex(ITask task) { 194 268 int tempindex = -1; … … 211 285 // } 212 286 287 /* (non-Javadoc) 288 * @see de.ugoe.cs.autoquest.tasktrees.alignment.matrix.SubstitutionMatrix#getScore(int, int) 289 */ 213 290 @Override 214 291 public float getScore(int taskId1, int taskId2) { … … 230 307 231 308 // TODO: Merge this with updateEventTaskInstances 309 /** 310 * Search event task instances. 311 */ 232 312 private void searchEventTaskInstances() { 233 313 for (final Iterator<ITask> it = uniqueTasks.iterator(); it.hasNext();) { … … 243 323 } 244 324 325 /** 326 * Sets the gap penalty. 327 * 328 * @param gapPenalty the new gap penalty 329 */ 245 330 public void setGapPenalty(float gapPenalty) { 246 331 this.gapPenalty = gapPenalty; 247 332 }; 248 333 334 /* (non-Javadoc) 335 * @see java.lang.Object#toString() 336 */ 249 337 @Override 250 338 public String toString() { … … 253 341 254 342 // Just Calculate the distance between the new tasks and the matrix. 343 /* (non-Javadoc) 344 * @see de.ugoe.cs.autoquest.tasktrees.alignment.matrix.SubstitutionMatrix#update(java.util.LinkedList) 345 */ 255 346 @Override 256 347 public void update(LinkedList<ITask> newTasks) { … … 277 368 } 278 369 370 /** 371 * Update event task instances. 372 * 373 * @param newTasks the new tasks 374 */ 279 375 public void updateEventTaskInstances(LinkedList<ITask> newTasks) { 280 376 for (final Iterator<ITask> it = newTasks.iterator(); it.hasNext();) { -
branches/autoquest-core-tasktrees-alignment/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/matrix/StaticTriangleMatrix.java
r1733 r1734 1 /* 2 * 3 */ 1 4 package de.ugoe.cs.autoquest.tasktrees.alignment.matrix; 2 5 3 6 import java.io.Serializable; 4 7 8 // TODO: Auto-generated Javadoc 9 /** 10 * The Class StaticTriangleMatrix. 11 */ 5 12 public class StaticTriangleMatrix implements ITriangleMatrix, Serializable { 6 13 7 /** 8 * 9 */ 14 /** The Constant serialVersionUID. */ 10 15 private static final long serialVersionUID = 7599542322424894866L; 16 17 /** The matrix. */ 11 18 private final float[] matrix; 19 20 /** The size. */ 12 21 protected int size; 13 22 23 /** 24 * Instantiates a new static triangle matrix. 25 * 26 * @param size the size 27 */ 14 28 public StaticTriangleMatrix(int size) { 15 29 this.size = size; … … 17 31 } 18 32 33 /* (non-Javadoc) 34 * @see de.ugoe.cs.autoquest.tasktrees.alignment.matrix.ITriangleMatrix#get(int, int) 35 */ 19 36 @Override 20 37 public float get(int first, int second) { … … 25 42 } 26 43 44 /* (non-Javadoc) 45 * @see de.ugoe.cs.autoquest.tasktrees.alignment.matrix.ITriangleMatrix#increaseSize(int) 46 */ 27 47 @Override 28 48 public void increaseSize(int count) throws Exception { … … 32 52 } 33 53 54 /* (non-Javadoc) 55 * @see de.ugoe.cs.autoquest.tasktrees.alignment.matrix.ITriangleMatrix#initialize(float) 56 */ 34 57 @Override 35 58 public void initialize(float value) { … … 39 62 } 40 63 64 /* (non-Javadoc) 65 * @see de.ugoe.cs.autoquest.tasktrees.alignment.matrix.ITriangleMatrix#set(int, int, float) 66 */ 41 67 @Override 42 68 public void set(int first, int second, float value) { … … 46 72 } 47 73 74 /* (non-Javadoc) 75 * @see de.ugoe.cs.autoquest.tasktrees.alignment.matrix.ITriangleMatrix#size() 76 */ 48 77 @Override 49 78 public int size() { … … 51 80 } 52 81 82 /* (non-Javadoc) 83 * @see java.lang.Object#toString() 84 */ 53 85 @Override 54 86 public String toString() { -
branches/autoquest-core-tasktrees-alignment/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/matrix/SubstitutionMatrix.java
r1733 r1734 1 /* 2 * 3 */ 1 4 package de.ugoe.cs.autoquest.tasktrees.alignment.matrix; 2 5 … … 6 9 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 7 10 11 // TODO: Auto-generated Javadoc 12 /** 13 * The Interface SubstitutionMatrix. 14 */ 8 15 public interface SubstitutionMatrix { 9 16 17 /** 18 * Generate. 19 * 20 * @param uniqueTasks the unique tasks 21 */ 10 22 public void generate(HashSet<ITask> uniqueTasks); 11 23 24 /** 25 * Gets the gap penalty. 26 * 27 * @return the gap penalty 28 */ 12 29 public float getGapPenalty(); 13 30 31 /** 32 * Gets the score. 33 * 34 * @param pos1 the pos1 35 * @param pos2 the pos2 36 * @return the score 37 */ 14 38 public float getScore(int pos1, int pos2); 15 39 40 /** 41 * Update. 42 * 43 * @param newlyGeneratedTasks the newly generated tasks 44 */ 16 45 public void update(LinkedList<ITask> newlyGeneratedTasks); 17 46 -
branches/autoquest-core-tasktrees-alignment/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/matrix/UPGMAMatrix.java
r1733 r1734 1 /* 2 * 3 */ 1 4 package de.ugoe.cs.autoquest.tasktrees.alignment.matrix; 2 5 6 // TODO: Auto-generated Javadoc 7 /** 8 * The Class UPGMAMatrix. 9 */ 3 10 public class UPGMAMatrix extends StaticTriangleMatrix { 4 11 12 /** 13 * Instantiates a new UPGMA matrix. 14 * 15 * @param size the size 16 */ 5 17 public UPGMAMatrix(int size) { 6 18 super(size); 7 19 } 8 20 21 /* (non-Javadoc) 22 * @see de.ugoe.cs.autoquest.tasktrees.alignment.matrix.StaticTriangleMatrix#size() 23 */ 9 24 @Override 10 25 public int size() { … … 12 27 } 13 28 29 /* (non-Javadoc) 30 * @see de.ugoe.cs.autoquest.tasktrees.alignment.matrix.StaticTriangleMatrix#toString() 31 */ 14 32 @Override 15 33 public String toString() {
Note: See TracChangeset
for help on using the changeset viewer.