Changeset 1331 for trunk/autoquest-plugin-alignment
- Timestamp:
- 01/22/14 15:46:30 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-plugin-alignment/src/main/java/de/ugoe/cs/autoquest/plugin/alignment/substitution/ObjectDistanceSubstitionMatrix.java
r1324 r1331 1 1 package de.ugoe.cs.autoquest.plugin.alignment.substitution; 2 2 3 import java.util.ArrayList; 3 4 import java.util.Collection; 5 import java.util.Iterator; 6 7 import de.ugoe.cs.autoquest.eventcore.guimodel.GUIModel; 8 import de.ugoe.cs.autoquest.eventcore.guimodel.IGUIElement; 9 4 10 import java.util.List; 5 11 12 import misc.AlignmentHelpers; 6 13 import de.ugoe.cs.autoquest.eventcore.Event; 14 import de.ugoe.cs.util.console.GlobalDataContainer; 7 15 8 16 public class ObjectDistanceSubstitionMatrix implements SubstitutionMatrix { 9 17 18 private ArrayList<int[][]> matrix; 19 private int currentSequence; 20 21 22 public ObjectDistanceSubstitionMatrix() { 23 currentSequence = 0; 24 matrix = new ArrayList<int[][]>(); 25 } 26 10 27 @Override 11 28 public String info() { … … 17 34 public double getDistance(int pos1, int pos2) { 18 35 // TODO Auto-generated method stub 19 return 0; 36 37 return matrix.get(currentSequence)[pos1][pos2]; 20 38 } 21 39 … … 28 46 @Override 29 47 public void generate(Collection<List<Event>> eventList) { 30 // TODO Auto-generated method stub 48 GUIModel guimodel = (GUIModel) GlobalDataContainer.getInstance().getData("sequences_targets"); 49 guimodel.condenseModel(); 31 50 51 for(Iterator<List<Event>> seqs = eventList.iterator(); seqs.hasNext();) { 52 matrix.add(new int[eventList.size()][eventList.size()]); 53 List<Event> tmpList = seqs.next(); 54 55 for (int i=0; i < tmpList.size(); i++) { 56 for (int j=0; j < tmpList.size(); j++) { 57 IGUIElement first = (IGUIElement) tmpList.get(i).getTarget(); 58 IGUIElement second =(IGUIElement) tmpList.get(j).getTarget(); 59 matrix.get(currentSequence)[i][j] = AlignmentHelpers.distanceBetween(first, second); 60 } 61 } 62 } 32 63 } 33 34 64 }
Note: See TracChangeset
for help on using the changeset viewer.