Changeset 1542
- Timestamp:
- 05/07/14 15:59:10 (11 years ago)
- Location:
- trunk/autoquest-plugin-alignment/src/main/java/de/ugoe/cs/autoquest/plugin/alignment
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-plugin-alignment/src/main/java/de/ugoe/cs/autoquest/plugin/alignment/commands/CMDbinaryAlignment.java
r1449 r1542 15 15 package de.ugoe.cs.autoquest.plugin.alignment.commands; 16 16 17 18 17 import java.util.Collection; 19 18 import java.util.LinkedList; … … 22 21 import de.ugoe.cs.autoquest.eventcore.Event; 23 22 import de.ugoe.cs.autoquest.plugin.alignment.SmithWaterman; 23 import de.ugoe.cs.autoquest.plugin.alignment.seqgen.SequenceGenerator; 24 24 import de.ugoe.cs.autoquest.plugin.alignment.seqgen.SimpleSequenceGenerator; 25 25 import de.ugoe.cs.autoquest.plugin.alignment.substitution.NearbySubstitutionMatrix; … … 46 46 @SuppressWarnings("unchecked") 47 47 public void run(List<Object> parameters) { 48 String sequencesName = "sequences"; 49 String algorithm; 48 String sequencesName = "numberSequences"; 49 String substitutionName = "substitutionMatrix"; 50 String algorithm = "smithwaterman"; 50 51 try { 51 52 sequencesName = (String) parameters.get(0); 52 if (parameters.size() > 1) { 53 algorithm = (String) parameters.get(1); 53 substitutionName = (String) parameters.get(1); 54 if (parameters.size() > 2) { 55 algorithm = (String) parameters.get(2); 54 56 } 55 57 } catch (Exception e) { … … 57 59 } 58 60 59 Collection<List<Event>> sequences = new LinkedList<List<Event>>();61 SimpleSequenceGenerator gen; 60 62 Object obj = GlobalDataContainer.getInstance().getData(sequencesName); 61 if(obj != null) { 62 63 if(obj.getClass().equals(sequences.getClass())) { 64 sequences = (Collection<List<Event>>) obj; 65 } 66 63 if (obj != null) { 64 if (obj.getClass().equals(SimpleSequenceGenerator.class)) { 65 gen = (SimpleSequenceGenerator) obj; 66 Console.println("Number of sequences: " + gen.sequenceCount()); 67 68 int[] seq1 = gen.get(0).getSequence(); 69 int[] seq2 = gen.get(0).getSequence(); 67 70 68 Console.println("Number of sequences: " + sequences.size()); 71 ObjectDistanceSubstitionMatrix submat = new 72 ObjectDistanceSubstitionMatrix(); 73 submat.generate(sequences); 74 // SmithWaterman sw = new SmithWaterman(seq1, seq2, 75 // new NearbySubstitutionMatrix(seq1, seq2, 10)); 76 // sw.printDPMatrix(); 77 // System.out.println(); 78 // sw.printAlignments(); 79 // sw.getMatches(); 80 System.out.println("foo"); 69 81 70 SimpleSequenceGenerator gen = new SimpleSequenceGenerator(); 71 gen.generate(sequences); 72 int[] seq1 = gen.get(0).getSequence(); 73 int[] seq2 = gen.get(0).getSequence(); 74 //ObjectDistanceSubstitionMatrix submat = new ObjectDistanceSubstitionMatrix(); 75 //submat.generate(sequences); 76 //SmithWaterman sw = new SmithWaterman(seq1, seq2, 77 // new NearbySubstitutionMatrix(seq1, seq2, 10)); 78 79 //sw.printDPMatrix(); 80 //System.out.println(); 81 //sw.printAlignments(); 82 // sw.getMatches(); 83 System.out.println("foo"); 84 } 82 } else { 83 Console.printerr("No number sequences generated. Please run the generateNumberSequences before."); 84 85 85 } 86 86 87 } 88 89 } 87 90 88 91 /* … … 93 96 @Override 94 97 public String help() { 95 return "binaryAlignment <sequencesName> {<algorithm>}";98 return "binaryAlignment <sequencesName> <substitutionMatrixname> {<algorithm>}"; 96 99 } 97 100 -
trunk/autoquest-plugin-alignment/src/main/java/de/ugoe/cs/autoquest/plugin/alignment/commands/CMDgenerateNumberSequences.java
r1449 r1542 83 83 @Override 84 84 public String help() { 85 return " binaryAlignment <sequencesName> {<algorithm>}";85 return "generateNumberSequences <equencesName> {<algorithm>}"; 86 86 } 87 87 -
trunk/autoquest-plugin-alignment/src/main/java/de/ugoe/cs/autoquest/plugin/alignment/seqgen/NumberSequence.java
r1450 r1542 1 1 package de.ugoe.cs.autoquest.plugin.alignment.seqgen; 2 2 3 import java.io.Serializable; 3 4 import java.util.ArrayList; 4 5 5 public class NumberSequence {6 public class NumberSequence implements Serializable { 6 7 private int[] sequence; 7 8 private int signature; -
trunk/autoquest-plugin-alignment/src/main/java/de/ugoe/cs/autoquest/plugin/alignment/seqgen/RandomSequenceGenerator.java
r1449 r1542 37 37 return null; 38 38 } 39 40 @Override 41 public int sequenceCount() { 42 return count; 43 } 44 39 45 } -
trunk/autoquest-plugin-alignment/src/main/java/de/ugoe/cs/autoquest/plugin/alignment/seqgen/SequenceGenerator.java
r1450 r1542 10 10 public void generate(Collection<List<Event>> eventList); 11 11 public NumberSequence get(int index); 12 public int sequenceCount(); 12 13 13 14 -
trunk/autoquest-plugin-alignment/src/main/java/de/ugoe/cs/autoquest/plugin/alignment/seqgen/SimpleSequenceGenerator.java
r1449 r1542 2 2 3 3 4 import java.io.Serializable; 4 5 import java.util.ArrayList; 5 6 import java.util.Collection; … … 20 21 21 22 22 public class SimpleSequenceGenerator implements SequenceGenerator {23 public class SimpleSequenceGenerator implements SequenceGenerator, Serializable { 23 24 24 25 private ArrayList<NumberSequence> numberseqs; … … 42 43 if (sequences != null) { 43 44 TaskTreeManager ttm = new TaskTreeManager(); 44 Console.println("Creating the task model");45 45 46 ttm.createTaskModel(sequences); 46 Console.println("Finished creating the task model");47 47 48 TaskHandlingStrategy preparationTaskHandlingStrategy = new TaskHandlingStrategy(TaskEquality.SEMANTICALLY_EQUAL); 48 49 SymbolMap<ITaskInstance, ITask> uniqueTasks = preparationTaskHandlingStrategy … … 84 85 85 86 86 @Override87 87 public NumberSequence get(int index) { 88 88 return numberseqs.get(index); 89 89 } 90 90 91 92 public int sequenceCount() { 93 return numberseqs.size(); 94 } 95 91 96 } 92 97
Note: See TracChangeset
for help on using the changeset viewer.