- Timestamp:
- 03/26/14 19:47:27 (11 years ago)
- Location:
- trunk/autoquest-plugin-alignment
- Files:
-
- 5 added
- 4 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-plugin-alignment/src/main/java/de/ugoe/cs/autoquest/plugin/alignment/commands/CMDbinaryAlignment.java
r1446 r1449 44 44 * @see de.ugoe.cs.util.console.Command#run(java.util.List) 45 45 */ 46 @SuppressWarnings("unchecked") 46 47 public void run(List<Object> parameters) { 47 48 String sequencesName = "sequences"; … … 58 59 Collection<List<Event>> sequences = new LinkedList<List<Event>>(); 59 60 Object obj = GlobalDataContainer.getInstance().getData(sequencesName); 60 if(obj.getClass().equals(sequences.getClass())) { 61 sequences = (Collection<List<Event>>) obj; 62 } 61 if(obj != null) { 62 63 if(obj.getClass().equals(sequences.getClass())) { 64 sequences = (Collection<List<Event>>) obj; 65 } 63 66 64 65 66 67 68 if(sequences != null) { 67 69 68 Console.println("Number of sequences: " + sequences.size()); 70 69 … … 73 72 int[] seq1 = gen.get(0).getSequence(); 74 73 int[] seq2 = gen.get(0).getSequence(); 75 ObjectDistanceSubstitionMatrix submat = new ObjectDistanceSubstitionMatrix();76 submat.generate(sequences);77 SmithWaterman sw = new SmithWaterman(seq1, seq2,78 new NearbySubstitutionMatrix(seq1, seq2, 10));74 //ObjectDistanceSubstitionMatrix submat = new ObjectDistanceSubstitionMatrix(); 75 //submat.generate(sequences); 76 //SmithWaterman sw = new SmithWaterman(seq1, seq2, 77 // new NearbySubstitutionMatrix(seq1, seq2, 10)); 79 78 80 sw.printDPMatrix();81 System.out.println();82 sw.printAlignments();79 //sw.printDPMatrix(); 80 //System.out.println(); 81 //sw.printAlignments(); 83 82 // sw.getMatches(); 83 System.out.println("foo"); 84 84 } 85 85 } -
trunk/autoquest-plugin-alignment/src/main/java/de/ugoe/cs/autoquest/plugin/alignment/seqgen/RandomSequenceGenerator.java
r1323 r1449 5 5 import java.util.List; 6 6 7 public class RandomSequenceGenerator implements ISequenceGenerator{7 public class RandomSequenceGenerator implements SequenceGenerator{ 8 8 9 9 private int min; … … 33 33 34 34 @Override 35 public int[]get(int index) {35 public NumberSequence get(int index) { 36 36 // TODO Auto-generated method stub 37 37 return null; -
trunk/autoquest-plugin-alignment/src/main/java/de/ugoe/cs/autoquest/plugin/alignment/seqgen/SequenceGenerator.java
r1439 r1449 6 6 import de.ugoe.cs.autoquest.eventcore.Event; 7 7 8 public interface ISequenceGenerator {8 public interface SequenceGenerator { 9 9 10 10 public void generate(Collection<List<Event>> eventList); 11 public int[]get(int index);11 public NumberSequence get(int index); 12 12 13 13 -
trunk/autoquest-plugin-alignment/src/main/java/de/ugoe/cs/autoquest/plugin/alignment/seqgen/SimpleSequenceGenerator.java
r1330 r1449 17 17 import de.ugoe.cs.autoquest.tasktrees.treeimpl.TaskBuilder; 18 18 import de.ugoe.cs.autoquest.usageprofiles.SymbolMap; 19 import de.ugoe.cs.util.console.Console; 19 20 20 21 21 public class SimpleSequenceGenerator implements ISequenceGenerator {22 public class SimpleSequenceGenerator implements SequenceGenerator { 22 23 23 private ArrayList< int[]> numberseqs;24 private ArrayList<NumberSequence> numberseqs; 24 25 25 26 26 27 public SimpleSequenceGenerator() { 27 this.numberseqs = new ArrayList< int[]>();28 this.numberseqs = new ArrayList<NumberSequence>(); 28 29 29 30 } 30 31 32 public void print() { 33 for (NumberSequence sequence : numberseqs) { 34 System.out.println(sequence.toString()); 35 } 36 37 } 31 38 32 39 public void generate(Collection<List<Event>> sequences) { … … 35 42 if (sequences != null) { 36 43 TaskTreeManager ttm = new TaskTreeManager(); 44 Console.println("Creating the task model"); 37 45 ttm.createTaskModel(sequences); 38 46 Console.println("Finished creating the task model"); 39 47 TaskHandlingStrategy preparationTaskHandlingStrategy = new TaskHandlingStrategy(TaskEquality.SEMANTICALLY_EQUAL); 40 48 SymbolMap<ITaskInstance, ITask> uniqueTasks = preparationTaskHandlingStrategy … … 49 57 for (IUserSession session : sessions) { 50 58 //Creating a new sequence that just consists of integers 51 int[] templist = new int[session.size()];59 NumberSequence templist = new NumberSequence(session.size()) ; 52 60 for (int i = 0; i < session.size(); i++) { 53 61 ITaskInstance taskInstance = session.get(i); … … 57 65 uniqueTasks.addSymbol(taskInstance, 58 66 taskInstance.getTask()); 59 templist [i]=taskInstance.getTask().getId();67 templist.getSequence()[i]=taskInstance.getTask().getId(); 60 68 61 69 } else { 62 70 taskBuilder.setTask(taskInstance, task); 63 templist [i]=task.getId();71 templist.getSequence()[i]=task.getId(); 64 72 65 73 } … … 77 85 78 86 @Override 79 public int[]get(int index) {87 public NumberSequence get(int index) { 80 88 return numberseqs.get(index); 81 89 } -
trunk/autoquest-plugin-alignment/src/main/java/de/ugoe/cs/autoquest/plugin/alignment/substitution/ObjectDistanceSubstitionMatrix.java
r1331 r1449 37 37 return matrix.get(currentSequence)[pos1][pos2]; 38 38 } 39 40 public double getDistance(int sequence, int pos1, int pos2) { 41 return matrix.get(sequence)[pos1][pos2]; 42 43 44 } 39 45 40 46 @Override … … 46 52 @Override 47 53 public void generate(Collection<List<Event>> eventList) { 48 GUIModel guimodel = (GUIModel) GlobalDataContainer.getInstance().getData("sequences_targets");49 guimodel.condenseModel();50 54 51 55 for(Iterator<List<Event>> seqs = eventList.iterator(); seqs.hasNext();) {
Note: See TracChangeset
for help on using the changeset viewer.