Index: branches/autoquest-core-tasktrees-alignment/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/matrix/ObjectDistanceSubstitionMatrix.java
===================================================================
--- branches/autoquest-core-tasktrees-alignment/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/matrix/ObjectDistanceSubstitionMatrix.java	(revision 1687)
+++ branches/autoquest-core-tasktrees-alignment/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/matrix/ObjectDistanceSubstitionMatrix.java	(revision 1692)
@@ -3,4 +3,5 @@
 
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.Iterator;
 
@@ -11,13 +12,11 @@
 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask;
 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskInstance;
-import de.ugoe.cs.autoquest.usageprofiles.SymbolMap;
 
 
 public class ObjectDistanceSubstitionMatrix implements SubstitutionMatrix {
 
-	// private ArrayList<int[][]> matrix;
 	HashMap<Integer, Integer> idmapping;
 	private TriangleMatrix matrix;
-	private SymbolMap<ITaskInstance, ITask> uniqueTasks;
+	private HashSet<ITask> uniqueTasks;
 	private double gapPenalty; 
 	private int index = 0;
@@ -26,5 +25,5 @@
 	
 	public ObjectDistanceSubstitionMatrix(
-			SymbolMap<ITaskInstance, ITask> uniqueTasks,float positiveThreshold, int gapPenalty) {
+			HashSet<ITask> uniqueTasks,float positiveThreshold, int gapPenalty) {
 		this.uniqueTasks = uniqueTasks;
 		this.positiveThreshold = positiveThreshold;
@@ -49,45 +48,43 @@
 		int index2=-1;
 		float distance=0;
-		
-		//TODO: Nicht ueber Symbols sondern ueber values, wenn Eventtask -> getInstances()->get(0)
-		for (Iterator<ITaskInstance> it = uniqueTasks.getSymbols().iterator(); it
-				.hasNext();) {
-			Object obj1 = it.next();
-			for (Iterator<ITaskInstance> jt = uniqueTasks.getSymbols()
-					.iterator(); jt.hasNext();) {
-			
+		for (Iterator<ITask> it = uniqueTasks.iterator(); it.hasNext();) {
+			ITask task1 = it.next();
+			for (Iterator<ITask> jt = uniqueTasks.iterator(); jt.hasNext();) {
+				ITask task2 = jt.next();
+				ITaskInstance ti1 = null;
+				ITaskInstance ti2 = null;
+				//TODO This seems ugly
+				if(task1.getInstances().size() > 0) {
+					ti1 = (ITaskInstance) task1.getInstances().iterator().next();
+				}
+				if(task2.getInstances().size() > 0) {
+					ti2 = (ITaskInstance) task2.getInstances().iterator().next();
+				}
 				IEventTaskInstance eti1 = null;
-				ITask task1 = null;
+				IEventTaskInstance eti2 = null;
 				
-				IEventTaskInstance eti2 = null;
-				ITask task2 = null;
 				
-				Object obj2 = jt.next();
-				
-				if (obj1 instanceof IEventTaskInstance && obj2 instanceof IEventTaskInstance) {
-					eti1 = (IEventTaskInstance) obj1;
+				if (ti1 instanceof IEventTaskInstance && ti2 instanceof IEventTaskInstance) {
+					eti1 = (IEventTaskInstance) ti1;
 					index1 = getIndex(eti1);
-					eti2 = (IEventTaskInstance) obj2;
+					eti2 = (IEventTaskInstance) ti2;
 					index2 = getIndex(eti2);
 					distance = distanceBetweenInstances(eti1,eti2);
 				}
-				else if(obj1 instanceof IEventTaskInstance &&  !(obj2 instanceof IEventTaskInstance)) {
-					task2 = ((ITaskInstance) obj2).getTask();
+				else if(ti1 instanceof IEventTaskInstance &&  !(ti2 instanceof IEventTaskInstance)) {
+					task1 = ((ITaskInstance) ti1).getTask();
 					index2 = getIndex(task2);
-					eti1 = (IEventTaskInstance) obj1;
+					eti1 = (IEventTaskInstance) ti1;
 					index1 = getIndex(eti1);
 					distance = distanceBetweenTaskAndInstance(task2,eti1);
 				}
-				else if(!(obj1 instanceof IEventTaskInstance) && obj2 instanceof IEventTaskInstance) {
-					task1 = ((ITaskInstance) obj1).getTask();
+				else if(!(ti1 instanceof IEventTaskInstance) && ti2 instanceof IEventTaskInstance) {
 					index1 = getIndex(task1);
-					eti2 = (IEventTaskInstance) obj2;
+					eti2 = (IEventTaskInstance) ti2;
 					index2 = getIndex(eti2);
 					distance = distanceBetweenTaskAndInstance(task1,eti2);
 				}
-				else if(!(obj2 instanceof IEventTaskInstance) && !(obj2 instanceof IEventTaskInstance)) {
-					task1 = ((ITaskInstance) obj1).getTask();
+				else if(!(ti1 instanceof IEventTaskInstance) && !(ti2 instanceof IEventTaskInstance)) {
 					index1 = getIndex(task1);
-					task2 = ((ITaskInstance) obj2).getTask();
 					index2 = getIndex(task2);
 					distance = distanceBetweenTasks(task1,task2);
@@ -103,9 +100,10 @@
 	}
 
-	
+	//TODO: Calculate distance here
 	private float distanceBetweenTaskAndInstance(ITask task1, IEventTaskInstance eti) {
 		return 0;
 	}
 	
+	//TODO: Calculate distance here
 	private float distanceBetweenTasks(ITask task1, ITask task2) {
 		return 0;
@@ -158,11 +156,7 @@
 		} 
 		else {
-			System.out.println("Firsttask: " +taskId1);
-			System.out.println("Secondtask: " + taskId2);
-			System.out.println(idmapping);
+			
 			Integer first = idmapping.get(taskId1);
 			Integer second = idmapping.get(taskId2);
-			System.out.println("First: " + first + " Second: " + second);
-			System.out.println("Matrix: " + matrix.get(first, second));
 			return matrix.get(first,second);	
 		}
