Index: branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Server/Dispatcher.cs
===================================================================
--- branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Server/Dispatcher.cs	(revision 1216)
+++ 	(revision )
@@ -1,127 +1,0 @@
-#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
- *
- * This file is part of HeuristicLab.
- *
- * HeuristicLab is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * HeuristicLab is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
- */
-#endregion
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Windows.Forms;
-using HeuristicLab.PluginInfrastructure;
-using System.Net;
-using System.ServiceModel;
-using HeuristicLab.CEDMA.DB.Interfaces;
-using HeuristicLab.CEDMA.DB;
-using System.ServiceModel.Description;
-using System.Linq;
-using HeuristicLab.CEDMA.Core;
-using HeuristicLab.GP.StructureIdentification;
-using HeuristicLab.Data;
-using HeuristicLab.Core;
-
-namespace HeuristicLab.CEDMA.Server {
-  public class Dispatcher {
-    private List<Execution> dispatchQueue;
-    public IList<string> DispatchQueue {
-      get { return dispatchQueue.Select(t => "StandardGP").ToList(); }
-    }
-
-    private IStore store;
-
-    public Dispatcher(IStore store) {
-      this.store = store;
-      this.dispatchQueue = new List<Execution>();
-    }
-
-    private void FillDispatchQueue() {
-      // find and select a dataset
-      var dataSetVar = new HeuristicLab.CEDMA.DB.Interfaces.Variable("DataSet");
-      var dataSetQuery = new Statement[] {
-        new Statement(dataSetVar, Ontology.PredicateInstanceOf, Ontology.TypeDataSet)
-      };
-
-      var dataSetBindings = store.Query("?DataSet <" + Ontology.PredicateInstanceOf.Uri + "> <" + Ontology.TypeDataSet.Uri + "> .");
-
-      // no datasets => do nothing
-      if (dataSetBindings.Count() == 0) return;
-
-      // assume last dataset is the most interesting one
-      // find and select all results for this dataset
-      var dataSetEntity = (Entity)dataSetBindings.Last().Get("DataSet");
-      DataSet dataSet = new DataSet(store, dataSetEntity);
-      Random random = new Random();
-      int targetVariable = dataSet.Problem.AllowedInputVariables[random.Next(0, dataSet.Problem.AllowedInputVariables.Count)];
-      string targetVariableName = dataSet.Problem.GetVariableName(targetVariable);
-      Execution exec = CreateExecution(dataSet.Problem, targetVariable);
-      if (exec != null) {
-        exec.DataSetEntity = dataSetEntity;
-        exec.TargetVariable = targetVariableName;
-        QueueJob(exec);
-      }
-    }
-
-    private void QueueJob(Execution execution) {
-      dispatchQueue.Add(execution);
-    }
-
-    public Execution GetNextJob() {
-      if (dispatchQueue.Count == 0) {
-        FillDispatchQueue();
-      }
-      if (dispatchQueue.Count > 0) {
-        Execution next = dispatchQueue[0];
-        dispatchQueue.RemoveAt(0);
-        return next;
-      } else
-        return null;
-    }
-
-    internal void Start() {
-      FillDispatchQueue();
-    }
-
-    private Execution CreateExecution(Problem problem, int targetVariable) {
-      switch (problem.LearningTask) {
-        case LearningTask.Classification: return null;
-        case LearningTask.Regression: {
-            return CreateStandardGpExecution(problem, targetVariable, 100, 10);
-          }
-        case LearningTask.TimeSeries: return null;
-        case LearningTask.Clustering: return null;
-        default: return null;
-      }
-    }
-
-    private Execution CreateStandardGpExecution(Problem problem, int targetVariable, int maxTreeSize, int maxTreeHeight) {
-      ProblemInjector probInjector = new ProblemInjector(problem);
-      probInjector.TargetVariable = targetVariable;
-      StandardGP sgp = new StandardGP();
-      sgp.SetSeedRandomly = true;
-      sgp.MaxGenerations = 2;
-      sgp.PopulationSize = 100;
-      sgp.Elites = 1;
-      sgp.ProblemInjector = probInjector;
-      sgp.MaxTreeHeight = maxTreeHeight;
-      sgp.MaxTreeSize = maxTreeSize;
-      Execution exec = new Execution(sgp.Engine);
-      exec.Description = "StandardGP - Medium Complexity";
-      return exec;
-    }
-  }
-}
Index: branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Server/DispatcherBase.cs
===================================================================
--- branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Server/DispatcherBase.cs	(revision 1217)
+++ branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Server/DispatcherBase.cs	(revision 1217)
@@ -0,0 +1,138 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Windows.Forms;
+using HeuristicLab.PluginInfrastructure;
+using System.Net;
+using System.ServiceModel;
+using HeuristicLab.CEDMA.DB.Interfaces;
+using HeuristicLab.CEDMA.DB;
+using System.ServiceModel.Description;
+using System.Linq;
+using HeuristicLab.CEDMA.Core;
+using HeuristicLab.GP.StructureIdentification;
+using HeuristicLab.Data;
+using HeuristicLab.Core;
+
+namespace HeuristicLab.CEDMA.Server {
+  public abstract class DispatcherBase :IDispatcher {
+    public enum ModelComplexity { Low, Medium, High };
+    public enum Algorithm { StandardGP };
+
+    private IStore store;
+    private ModelComplexity[] possibleComplexities = new ModelComplexity[] { ModelComplexity.Low, ModelComplexity.Medium, ModelComplexity.High };
+    private Dictionary<LearningTask, Algorithm[]> possibleAlgorithms = new Dictionary<LearningTask, Algorithm[]>() {
+      {LearningTask.Classification, new Algorithm[] {}},
+      {LearningTask.Regression, new Algorithm[] { Algorithm.StandardGP }},
+      {LearningTask.TimeSeries, new Algorithm[] { }}
+    };
+
+    public DispatcherBase(IStore store) {
+      this.store = store;
+    }
+
+    public Execution GetNextJob() {
+      // find and select a dataset
+      var dataSetVar = new HeuristicLab.CEDMA.DB.Interfaces.Variable("DataSet");
+      var dataSetQuery = new Statement[] {
+        new Statement(dataSetVar, Ontology.PredicateInstanceOf, Ontology.TypeDataSet)
+      };
+
+      Entity[] datasets = store.Query("?DataSet <" + Ontology.PredicateInstanceOf.Uri + "> <" + Ontology.TypeDataSet.Uri + "> .")
+        .Select(x => (Entity)x.Get("DataSet"))
+        .ToArray();
+
+      // no datasets => do nothing
+      if (datasets.Length == 0) return null;
+
+      Entity dataSetEntity = SelectDataSet(datasets);
+      DataSet dataSet = new DataSet(store, dataSetEntity);
+
+      int targetVariable = SelectTargetVariable(dataSet, dataSet.Problem.AllowedInputVariables.ToArray());
+      Algorithm selectedAlgorithm = SelectAlgorithm(dataSet, targetVariable, possibleAlgorithms[dataSet.Problem.LearningTask]);
+      string targetVariableName = dataSet.Problem.GetVariableName(targetVariable);
+      ModelComplexity selectedComplexity = SelectComplexity(dataSet, targetVariable, selectedAlgorithm, possibleComplexities);
+
+      Execution exec = CreateExecution(dataSet.Problem, targetVariable, selectedAlgorithm, selectedComplexity);
+      if (exec != null) {
+        exec.DataSetEntity = dataSetEntity;
+        exec.TargetVariable = targetVariableName;
+      }
+      return exec;
+    }
+
+    public abstract Entity SelectDataSet(Entity[] datasets);
+    public abstract int SelectTargetVariable(DataSet dataSet, int[] targetVariables);
+    public abstract Algorithm SelectAlgorithm(DataSet dataSet, int targetVariable, Algorithm[] possibleAlgorithms);
+    public abstract ModelComplexity SelectComplexity(DataSet dataSet, int targetVariable, Algorithm algorithm, ModelComplexity[] possibleComplexities);
+
+    private Execution CreateExecution(Problem problem, int targetVariable, Algorithm algorithm, ModelComplexity complexity) {
+      switch (algorithm) {
+        case Algorithm.StandardGP: {
+            return CreateStandardGpExecution(problem, targetVariable, complexity);
+          }
+        default: {
+            return null;
+          }
+      }
+    }
+
+    private Execution CreateStandardGpExecution(Problem problem, int targetVariable, ModelComplexity complexity) {
+      ProblemInjector probInjector = new ProblemInjector(problem);
+      probInjector.TargetVariable = targetVariable;
+      StandardGP sgp = new StandardGP();
+      sgp.SetSeedRandomly = true;
+      sgp.MaxGenerations = 2;
+      sgp.PopulationSize = 100;
+      sgp.Elites = 1;
+      sgp.ProblemInjector = probInjector;
+
+      int maxTreeHeight = 10;
+      int maxTreeSize = 100;
+      switch (complexity) {
+        case ModelComplexity.Low: {
+            maxTreeHeight = 5;
+            maxTreeSize = 20;
+            break;
+          }
+        case ModelComplexity.Medium: {
+            maxTreeHeight = 10;
+            maxTreeSize = 100;
+            break;
+          }
+        case ModelComplexity.High: {
+            maxTreeHeight = 12;
+            maxTreeSize = 200;
+            break;
+          }
+      }
+
+      sgp.MaxTreeHeight = maxTreeHeight;
+      sgp.MaxTreeSize = maxTreeSize;
+      Execution exec = new Execution(sgp.Engine);
+      exec.Description = "StandardGP - Complexity: " + complexity;
+      return exec;
+    }
+  }
+}
Index: branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Server/Executer.cs
===================================================================
--- branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Server/Executer.cs	(revision 1216)
+++ branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Server/Executer.cs	(revision 1217)
@@ -41,5 +41,5 @@
 namespace HeuristicLab.CEDMA.Server {
   public class Executer {
-    private Dispatcher dispatcher;
+    private IDispatcher dispatcher;
     private JobManager jobManager;
     private IStore store;
@@ -63,5 +63,5 @@
     }
 
-    public Executer(Dispatcher dispatcher, IStore store, string gridUrl) {
+    public Executer(IDispatcher dispatcher, IStore store, string gridUrl) {
       activeExecutions = new Dictionary<WaitHandle, Execution>();
       maxActiveJobs = 10;
Index: branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Server/HeuristicLab.CEDMA.Server.csproj
===================================================================
--- branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Server/HeuristicLab.CEDMA.Server.csproj	(revision 1216)
+++ branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Server/HeuristicLab.CEDMA.Server.csproj	(revision 1217)
@@ -75,7 +75,9 @@
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="DispatcherBase.cs" />
+    <Compile Include="IDispatcher.cs" />
     <Compile Include="Execution.cs" />
     <Compile Include="Executer.cs" />
-    <Compile Include="Dispatcher.cs" />
+    <Compile Include="RandomDispatcher.cs" />
     <Compile Include="Server.cs" />
     <Compile Include="ServerApplication.cs" />
Index: branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Server/IDispatcher.cs
===================================================================
--- branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Server/IDispatcher.cs	(revision 1217)
+++ branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Server/IDispatcher.cs	(revision 1217)
@@ -0,0 +1,42 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Windows.Forms;
+using HeuristicLab.PluginInfrastructure;
+using System.Net;
+using System.ServiceModel;
+using HeuristicLab.CEDMA.DB.Interfaces;
+using HeuristicLab.CEDMA.DB;
+using System.ServiceModel.Description;
+using System.Linq;
+using HeuristicLab.CEDMA.Core;
+using HeuristicLab.GP.StructureIdentification;
+using HeuristicLab.Data;
+using HeuristicLab.Core;
+
+namespace HeuristicLab.CEDMA.Server {
+  public interface IDispatcher {
+    Execution GetNextJob();
+  }
+}
Index: branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Server/RandomDispatcher.cs
===================================================================
--- branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Server/RandomDispatcher.cs	(revision 1217)
+++ branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Server/RandomDispatcher.cs	(revision 1217)
@@ -0,0 +1,62 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Windows.Forms;
+using HeuristicLab.PluginInfrastructure;
+using System.Net;
+using System.ServiceModel;
+using HeuristicLab.CEDMA.DB.Interfaces;
+using HeuristicLab.CEDMA.DB;
+using System.ServiceModel.Description;
+using System.Linq;
+using HeuristicLab.CEDMA.Core;
+using HeuristicLab.GP.StructureIdentification;
+using HeuristicLab.Data;
+using HeuristicLab.Core;
+
+namespace HeuristicLab.CEDMA.Server {
+  public class RandomDispatcher : DispatcherBase {
+    private Random random;
+    public RandomDispatcher(IStore store)
+      : base(store) {
+      random = new Random();
+    }
+
+    public override Algorithm SelectAlgorithm(DataSet dataSet, int targetVariable, Algorithm[] possibleAlgorithms) {
+      return possibleAlgorithms[random.Next(possibleAlgorithms.Length)];
+    }
+
+    public override ModelComplexity SelectComplexity(DataSet dataSet, int targetVariable, Algorithm algorithm, ModelComplexity[] possibleComplexities) {
+      return possibleComplexities[random.Next(possibleComplexities.Length)];
+    }
+
+    public override Entity SelectDataSet(Entity[] datasets) {
+      return datasets[random.Next(datasets.Length)];
+    }
+
+    public override int SelectTargetVariable(DataSet dataSet, int[] targetVariables) {
+      return targetVariables[random.Next(targetVariables.Length)];
+    }
+  }
+}
Index: branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Server/RunScheduler.cs
===================================================================
--- branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Server/RunScheduler.cs	(revision 1216)
+++ 	(revision )
@@ -1,163 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
- *
- * This file is part of HeuristicLab.
- *
- * HeuristicLab is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * HeuristicLab is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
- */
-#endregion
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using HeuristicLab.CEDMA.DB;
-using HeuristicLab.CEDMA.DB.Interfaces;
-using HeuristicLab.Core;
-using System.Threading;
-using HeuristicLab.Grid;
-using System.Diagnostics;
-using HeuristicLab.Data;
-using HeuristicLab.CEDMA.Core;
-using HeuristicLab.Operators;
-
-namespace HeuristicLab.CEDMA.Server {
-  public class RunScheduler {
-    private class Job {
-      public long AgentId;
-      public WaitHandle WaitHandle;
-      public AtomicOperation Operation;
-    }
-    private string serverUri;
-    private JobManager jobManager;
-    private const int RELEASE_INTERVAL = 5;
-    private object remoteCommLock = new object();
-    private object queueLock = new object();
-    private Queue<Job> jobQueue;
-    private AutoResetEvent runningJobs = new AutoResetEvent(false);
-
-    public RunScheduler(JobManager jobManager, string serverUri) {
-      this.jobManager = jobManager;
-      this.serverUri = serverUri;
-      jobQueue = new Queue<Job>();
-      Thread resultsGatheringThread = new Thread(GatherResults);
-      resultsGatheringThread.Start();
-    }
-    public void Run() {
-      while(true) {
-        ReleaseWaitingRuns();
-        Thread.Sleep(TimeSpan.FromSeconds(RELEASE_INTERVAL));
-      }
-    }
-    private void ReleaseWaitingRuns() {
-      ICollection<AgentEntry> agents;
-      lock(remoteCommLock) {
-        agents = database.GetAgents(ProcessStatus.Waiting);
-      }
-      foreach(AgentEntry entry in agents) {
-        Scope scope = new Scope();
-        // initialize CEDMA variables for the execution of the agent
-        scope.AddVariable(new Variable("AgentId", new IntData((int)entry.Id)));
-        scope.AddVariable(new Variable("CedmaServerUri", new StringData(serverUri)));
-
-        byte[] rawData = database.GetAgentRawData(entry.Id);
-        IOperatorGraph opGraph = (IOperatorGraph)PersistenceManager.RestoreFromGZip(rawData);
-
-        PatchLinks(opGraph, new Dictionary<long, IOperator>());
-
-        AtomicOperation operation = new AtomicOperation(opGraph.InitialOperator, scope);
-        WaitHandle wHandle;
-        lock(remoteCommLock) {
-          wHandle = jobManager.BeginExecuteOperation(operation.Scope, operation);
-          database.UpdateAgent(entry.Id, ProcessStatus.Active);
-        }
-
-        Job job = new Job();
-        job.AgentId = entry.Id;
-        job.Operation = operation;
-        job.WaitHandle = wHandle;
-
-        lock(queueLock) {
-          jobQueue.Enqueue(job);
-          runningJobs.Set();
-        }
-      }
-    }
-
-    private void PatchLinks(IOperatorGraph opGraph, Dictionary<long, IOperator> patchedOperators) {
-      Dictionary<IOperator, IOperator> patchDictionary = new Dictionary<IOperator, IOperator>();
-      foreach(IOperator op in opGraph.Operators) {
-        IOperator patched = PatchLinks(op, patchedOperators);
-        patchDictionary.Add(op, patched);
-      }
-      foreach(KeyValuePair<IOperator, IOperator> p in patchDictionary) {
-        IOperator original = p.Key;
-        IOperator patch = p.Value;
-        if(original != patch) {
-          foreach(IOperator subOperator in original.SubOperators) {
-            patch.AddSubOperator(subOperator);
-          }
-          if(opGraph.InitialOperator == original)
-            opGraph.InitialOperator = patch;
-          opGraph.RemoveOperator(original.Guid);
-          opGraph.AddOperator(patch);
-        }
-      }
-    }
-
-    private IOperator PatchLinks(IOperator op, Dictionary<long, IOperator> patchedOperators) {
-      if(op is OperatorLink) {
-        OperatorLink link = op as OperatorLink;
-        if(patchedOperators.ContainsKey(link.Id)) {
-          return patchedOperators[link.Id];
-        } else {
-          OperatorEntry targetEntry = database.GetOperator(link.Id);
-          IOperator target = (IOperator)PersistenceManager.RestoreFromGZip(targetEntry.RawData);
-          patchedOperators.Add(link.Id, target);
-          PatchLinks(target, patchedOperators);
-          return target;
-        }
-      } else if(op is CombinedOperator) {
-        PatchLinks(((CombinedOperator)op).OperatorGraph, patchedOperators);
-        return op;
-      }
-      return op;
-    }
-
-    private void GatherResults() {
-      try {
-        while(true) {
-          Job job = null;
-          lock(queueLock) if(jobQueue.Count > 0) job = jobQueue.Dequeue();
-          if(job == null) runningJobs.WaitOne();
-          else {
-            job.WaitHandle.WaitOne();
-            job.WaitHandle.Close();
-            lock(remoteCommLock) {
-              try {
-                jobManager.EndExecuteOperation(job.Operation);
-                database.UpdateAgent(job.AgentId, ProcessStatus.Finished);
-              } catch(JobExecutionException ex) {
-                database.UpdateAgent(job.AgentId, ProcessStatus.Error);
-              }
-            }
-          }
-        }
-      } finally {
-        Debug.Assert(false); // make sure we are notified when this thread is killed while debugging
-      }
-    }
-  }
-}
Index: branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Server/ServerForm.cs
===================================================================
--- branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Server/ServerForm.cs	(revision 1216)
+++ branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Server/ServerForm.cs	(revision 1217)
@@ -44,5 +44,5 @@
     private Server server;
     private Store store;
-    private Dispatcher dispatcher;
+    private IDispatcher dispatcher;
     private Executer executer;
 
@@ -63,6 +63,5 @@
 
     private void connectButton_Click(object sender, EventArgs e) {
-      dispatcher = new Dispatcher(store);
-      dispatcher.Start();
+      dispatcher = new RandomDispatcher(store);
       executer = new Executer(dispatcher, store, gridAddress.Text);
       executer.Start();
