Index: /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/AlbaEncoding.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/AlbaEncoding.cs	(revision 17710)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/AlbaEncoding.cs	(revision 17711)
@@ -26,5 +26,4 @@
 using HeuristicLab.Common;
 using HeuristicLab.Core;
-using HeuristicLab.Optimization;
 using HeuristicLab.PluginInfrastructure;
 using HeuristicLab.Problems.VehicleRouting.Interfaces;
@@ -33,5 +32,5 @@
   [Item("AlbaEncoding", "Represents the encoding for Alba encoded solutions.")]
   [StorableType("9ff9f959-31d2-44e5-8a5e-b122220535c2")]
-  public class AlbaEncoding : Encoding, IVRPEncoding {
+  public sealed class AlbaEncoding : VRPEncoding {
 
     [StorableConstructor]
@@ -60,5 +59,5 @@
       };
     }
-    private void DiscoverOperators() {
+    protected override void DiscoverOperators() {
       var assembly = typeof(IAlbaOperator).Assembly;
       var discoveredTypes = ApplicationManager.Manager.GetTypes(encodingSpecificOperatorTypes, assembly, true, false, false);
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/GVR/GVREncoding.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/GVR/GVREncoding.cs	(revision 17710)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/GVR/GVREncoding.cs	(revision 17711)
@@ -26,5 +26,4 @@
 using HeuristicLab.Common;
 using HeuristicLab.Core;
-using HeuristicLab.Optimization;
 using HeuristicLab.PluginInfrastructure;
 using HeuristicLab.Problems.VehicleRouting.Interfaces;
@@ -33,5 +32,5 @@
   [Item("GVR Encoding", "Represents the genetic vehicle representation encoding for GVR encoded solutions.")]
   [StorableType("9ff9f959-31d2-44e5-8a5e-b122220535c2")]
-  public class GVREncoding : Encoding, IVRPEncoding {
+  public class GVREncoding : VRPEncoding {
 
     [StorableConstructor]
@@ -60,5 +59,5 @@
       };
     }
-    private void DiscoverOperators() {
+    protected override void DiscoverOperators() {
       var assembly = typeof(IGVROperator).Assembly;
       var discoveredTypes = ApplicationManager.Manager.GetTypes(encodingSpecificOperatorTypes, assembly, true, false, false);
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/MultiVRPEncoding.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/MultiVRPEncoding.cs	(revision 17710)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/MultiVRPEncoding.cs	(revision 17711)
@@ -26,5 +26,4 @@
 using HeuristicLab.Common;
 using HeuristicLab.Core;
-using HeuristicLab.Optimization;
 using HeuristicLab.PluginInfrastructure;
 using HeuristicLab.Problems.VehicleRouting.Interfaces;
@@ -33,5 +32,5 @@
   [Item("MultiVRPEncoding", "Represents the combination of all encodings from the VRP.")]
   [StorableType("9ff9f959-31d2-44e5-8a5e-b122220535c2")]
-  public class MultiVRPEncoding : Encoding, IVRPEncoding {
+  public class MultiVRPEncoding : VRPEncoding {
 
     [StorableConstructor]
@@ -58,5 +57,5 @@
       };
     }
-    private void DiscoverOperators() {
+    protected override void DiscoverOperators() {
       var assembly = typeof(IAlbaOperator).Assembly;
       var discoveredTypes = ApplicationManager.Manager.GetTypes(encodingSpecificOperatorTypes, assembly, true, false, false);
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/PotvinEncoding.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/PotvinEncoding.cs	(revision 17710)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/PotvinEncoding.cs	(revision 17711)
@@ -26,5 +26,4 @@
 using HeuristicLab.Common;
 using HeuristicLab.Core;
-using HeuristicLab.Optimization;
 using HeuristicLab.PluginInfrastructure;
 using HeuristicLab.Problems.VehicleRouting.Interfaces;
@@ -33,5 +32,5 @@
   [Item("Potvin Encoding", "Represents the Potvin encoding for Potvin encoded solutions.")]
   [StorableType("9ff9f959-31d2-44e5-8a5e-b122220535c2")]
-  public class PotvinEncoding : Encoding, IVRPEncoding {
+  public class PotvinEncoding : VRPEncoding {
 
     [StorableConstructor]
@@ -60,5 +59,5 @@
       };
     }
-    private void DiscoverOperators() {
+    protected override void DiscoverOperators() {
       var assembly = typeof(IPotvinOperator).Assembly;
       var discoveredTypes = ApplicationManager.Manager.GetTypes(encodingSpecificOperatorTypes, assembly, true, false, false);
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Prins/PrinsEncoding.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Prins/PrinsEncoding.cs	(revision 17710)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Prins/PrinsEncoding.cs	(revision 17711)
@@ -26,5 +26,4 @@
 using HeuristicLab.Common;
 using HeuristicLab.Core;
-using HeuristicLab.Optimization;
 using HeuristicLab.PluginInfrastructure;
 using HeuristicLab.Problems.VehicleRouting.Interfaces;
@@ -33,5 +32,5 @@
   [Item("Prins Encoding", "Represents the Prins encoding for Prins encoded solutions.")]
   [StorableType("9ff9f959-31d2-44e5-8a5e-b122220535c2")]
-  public class PrinsEncoding : Encoding, IVRPEncoding {
+  public class PrinsEncoding : VRPEncoding {
 
     [StorableConstructor]
@@ -60,5 +59,5 @@
       };
     }
-    private void DiscoverOperators() {
+    protected override void DiscoverOperators() {
       var assembly = typeof(IPrinsOperator).Assembly;
       var discoveredTypes = ApplicationManager.Manager.GetTypes(encodingSpecificOperatorTypes, assembly, true, false, false);
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/VRPEncoding.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/VRPEncoding.cs	(revision 17711)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/VRPEncoding.cs	(revision 17711)
@@ -0,0 +1,49 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 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.Linq;
+using HEAL.Attic;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Optimization;
+using HeuristicLab.Problems.VehicleRouting.Interfaces;
+
+namespace HeuristicLab.Problems.VehicleRouting.Encodings {
+  [Item("VRPEncoding", "")]
+  [StorableType("2bb0d7d5-d842-4cf7-8242-1d49940aa4b6")]
+  public abstract class VRPEncoding : Encoding, IVRPEncoding {
+
+    [StorableConstructor]
+    protected VRPEncoding(StorableConstructorFlag _) : base(_) { }
+    protected VRPEncoding(VRPEncoding original, Cloner cloner) : base(original, cloner) { }
+    protected VRPEncoding(string name) : base(name) { }
+
+    public void FilterOperators(IVRPProblemInstance instance) {
+      DiscoverOperators();
+      var operators = instance.FilterOperators(Operators);
+      foreach (var op in Operators.Except(operators).ToList()) {
+        RemoveOperator(op);
+      }
+    }
+
+    protected abstract void DiscoverOperators();
+  }
+}
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Zhu/ZhuEncoding.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Zhu/ZhuEncoding.cs	(revision 17710)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Zhu/ZhuEncoding.cs	(revision 17711)
@@ -26,5 +26,4 @@
 using HeuristicLab.Common;
 using HeuristicLab.Core;
-using HeuristicLab.Optimization;
 using HeuristicLab.PluginInfrastructure;
 using HeuristicLab.Problems.VehicleRouting.Interfaces;
@@ -33,5 +32,5 @@
   [Item("Zhu Encoding", "Represents the Zhu encoding for Zhu encoded solutions.")]
   [StorableType("9ff9f959-31d2-44e5-8a5e-b122220535c2")]
-  public class ZhuEncoding : Encoding, IVRPEncoding {
+  public class ZhuEncoding : VRPEncoding {
 
     [StorableConstructor]
@@ -60,5 +59,5 @@
       };
     }
-    private void DiscoverOperators() {
+    protected override void DiscoverOperators() {
       var assembly = typeof(IZhuOperator).Assembly;
       var discoveredTypes = ApplicationManager.Manager.GetTypes(encodingSpecificOperatorTypes, assembly, true, false, false);
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/HeuristicLab.Problems.VehicleRouting-3.4.csproj
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/HeuristicLab.Problems.VehicleRouting-3.4.csproj	(revision 17710)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/HeuristicLab.Problems.VehicleRouting-3.4.csproj	(revision 17711)
@@ -148,4 +148,5 @@
     <Compile Include="Encodings\Potvin\Moves\TwoOptStar\PotvinTwoOptStarSingleMoveGenerator.cs" />
     <Compile Include="Encodings\Prins\PrinsEncoding.cs" />
+    <Compile Include="Encodings\VRPEncoding.cs" />
     <Compile Include="Encodings\Zhu\ZhuEncoding.cs" />
     <Compile Include="Improver\VRPImprovementOperator.cs" />
@@ -340,16 +341,10 @@
     <Compile Include="Interfaces\IVRPProblemInstance.cs" />
     <Compile Include="Plugin.cs" />
-    <Compile Include="ProblemInstances\MultiDepotVRP\MDCVRP\MDCVRPEvaluator.cs" />
     <Compile Include="ProblemInstances\MultiDepotVRP\MDCVRP\MDCVRPProblemInstance.cs" />
-    <Compile Include="ProblemInstances\MultiDepotVRP\MDCVRP\MDCVRPTW\MDCVRPPDTW\MDCVRPPDTWEvaluator.cs" />
     <Compile Include="ProblemInstances\MultiDepotVRP\MDCVRP\MDCVRPTW\MDCVRPPDTW\MDCVRPPDTWProblemInstance.cs" />
-    <Compile Include="ProblemInstances\MultiDepotVRP\MDCVRP\MDCVRPTW\MDCVRPTWEvaluator.cs" />
     <Compile Include="ProblemInstances\MultiDepotVRP\MDCVRP\MDCVRPTW\MDCVRPTWProblemInstance.cs" />
     <Compile Include="ProblemInstances\MultiDepotVRP\MultiDepotVRPProblemInstance.cs" />
-    <Compile Include="ProblemInstances\MultiDepotVRP\MultiDepotVRPEvaluator.cs" />
     <Compile Include="ProblemInstances\SingleDepotVRP\CVRP\CVRPTW\CVRPPDTW\CVRPPDTWProblemInstance.cs" />
     <Compile Include="ProblemInstances\SingleDepotVRP\CVRP\CVRPTW\CVRPPDTW\CVRPPDTWEvaluation.cs" />
-    <Compile Include="ProblemInstances\SingleDepotVRP\CVRP\CVRPTW\CVRPPDTW\CVRPPDTWEvaluator.cs" />
-    <Compile Include="ProblemInstances\SingleDepotVRP\SingleDepotVRPEvaluator.cs" />
     <Compile Include="SimilarityCalculators\VRPSimilarityCalculator.cs" />
     <Compile Include="SolutionParser.cs" />
@@ -373,7 +368,4 @@
     <Compile Include="ProblemInstances\SingleDepotVRP\CVRP\CVRPTW\CVRPTWEvaluation.cs" />
     <Compile Include="ProblemInstances\SingleDepotVRP\CVRP\CVRPEvaluation.cs" />
-    <Compile Include="ProblemInstances\SingleDepotVRP\CVRP\CVRPTW\CVRPTWEvaluator.cs" />
-    <Compile Include="ProblemInstances\SingleDepotVRP\CVRP\CVRPEvaluator.cs" />
-    <Compile Include="ProblemInstances\VRPEvaluator.cs" />
     <Compile Include="ProblemInstances\VRPEvaluation.cs" />
     <Compile Include="ProblemInstances\SingleDepotVRP\SingleDepotVRPProblemInstance.cs" />
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Interfaces/IVRPEncoding.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Interfaces/IVRPEncoding.cs	(revision 17710)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Interfaces/IVRPEncoding.cs	(revision 17711)
@@ -22,8 +22,11 @@
 using HEAL.Attic;
 using HeuristicLab.Optimization;
+using HeuristicLab.Problems.VehicleRouting.Interfaces;
 
 namespace HeuristicLab.Problems.VehicleRouting {
 
   [StorableType("b6674651-cc95-48d8-a2c3-83ee9325def3")]
-  public interface IVRPEncoding : IEncoding { }
+  public interface IVRPEncoding : IEncoding {
+    void FilterOperators(IVRPProblemInstance instance);
+  }
 }
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Interfaces/IVRPProblemInstance.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Interfaces/IVRPProblemInstance.cs	(revision 17710)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Interfaces/IVRPProblemInstance.cs	(revision 17711)
@@ -22,15 +22,13 @@
 using System;
 using System.Collections.Generic;
+using HEAL.Attic;
 using HeuristicLab.Core;
 using HeuristicLab.Data;
 using HeuristicLab.Problems.VehicleRouting.ProblemInstances;
-using HEAL.Attic;
 
 namespace HeuristicLab.Problems.VehicleRouting.Interfaces {
   [StorableType("B8E231D0-6BA9-4DCF-9585-95E46B280B47")]
   public interface IVRPProblemInstance : IParameterizedNamedItem {
-    IVRPEvaluator SolutionEvaluator { get; set; }
-    IVRPEvaluator MoveEvaluator { get; }
-    IEnumerable<IOperator> Operators { get; }
+    IEnumerable<IOperator> FilterOperators(IEnumerable<IOperator> operators);
 
     event EventHandler EvaluationChanged;
@@ -50,9 +48,6 @@
     double GetDistance(int start, int end, IVRPEncodedSolution solution);
     double GetInsertionDistance(int start, int customer, int end, IVRPEncodedSolution solution, out double startDistance, out double endDistance);
-    bool Feasible(IVRPEncodedSolution solution);
-    bool TourFeasible(Tour tour, IVRPEncodedSolution solution);
     VRPEvaluation Evaluate(IVRPEncodedSolution solution);
     VRPEvaluation EvaluateTour(Tour tour, IVRPEncodedSolution solution);
-    bool Feasible(VRPEvaluation eval);
     double GetInsertionCosts(VRPEvaluation eval, IVRPEncodedSolution solution, int customer, int tour, int index, out bool feasible);
   }
Index: anches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/MultiDepotVRP/MDCVRP/MDCVRPEvaluator.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/MultiDepotVRP/MDCVRP/MDCVRPEvaluator.cs	(revision 17710)
+++ 	(revision )
@@ -1,151 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 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 HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-using HeuristicLab.Parameters;
-using HEAL.Attic;
-using HeuristicLab.Problems.VehicleRouting.Interfaces;
-using HeuristicLab.Problems.VehicleRouting.Variants;
-
-namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances {
-  [Item("MDCVRPEvaluator", "Represents a multi depot CVRP evaluator.")]
-  [StorableType("E59F6449-7DA3-4842-A0D8-C5BECC965642")]
-  public class MDCVRPEvaluator : VRPEvaluator {
-    public ILookupParameter<DoubleValue> OverloadParameter {
-      get { return (ILookupParameter<DoubleValue>)Parameters["Overload"]; }
-    }
-
-    protected override VRPEvaluation CreateTourEvaluation() {
-      return new CVRPEvaluation();
-    }
-
-    protected override void EvaluateTour(VRPEvaluation eval, IVRPProblemInstance instance, Tour tour, IVRPEncodedSolution solution) {
-      TourInsertionInfo tourInfo = new TourInsertionInfo(solution.GetVehicleAssignment(solution.GetTourIndex(tour)));
-      eval.InsertionInfo.AddTourInsertionInfo(tourInfo);
-      double originalQuality = eval.Quality;
-
-      IHeterogenousCapacitatedProblemInstance cvrpInstance = instance as IHeterogenousCapacitatedProblemInstance;
-
-      double delivered = 0.0;
-      double overweight = 0.0;
-      double distance = 0.0;
-
-      int tourIndex = solution.GetTourIndex(tour);
-      int vehicle = solution.GetVehicleAssignment(tourIndex);
-
-      double capacity = cvrpInstance.Capacity[vehicle];
-      for (int i = 0; i < tour.Stops.Count; i++) {
-        delivered += instance.GetDemand(tour.Stops[i]);
-      }
-
-      double spareCapacity = capacity - delivered;
-
-      //simulate a tour, start and end at depot
-      for (int i = 0; i <= tour.Stops.Count; i++) {
-        int start = 0;
-        if (i > 0)
-          start = tour.Stops[i - 1];
-        int end = 0;
-        if (i < tour.Stops.Count)
-          end = tour.Stops[i];
-
-        //drive there
-        double currentDistace = instance.GetDistance(start, end, solution);
-        distance += currentDistace;
-
-        CVRPInsertionInfo stopInfo = new CVRPInsertionInfo(start, end, spareCapacity);
-        tourInfo.AddStopInsertionInfo(stopInfo);
-      }
-
-      eval.Quality += instance.FleetUsageFactor.Value;
-      eval.Quality += instance.DistanceFactor.Value * distance;
-
-      eval.Distance += distance;
-      eval.VehicleUtilization += 1;
-
-      if (delivered > capacity) {
-        overweight = delivered - capacity;
-      }
-
-      (eval as CVRPEvaluation).Overload += overweight;
-      double penalty = overweight * cvrpInstance.OverloadPenalty.Value;
-      eval.Penalty += penalty;
-      eval.Quality += penalty;
-      tourInfo.Penalty = penalty;
-      tourInfo.Quality = eval.Quality - originalQuality;
-    }
-
-    protected override double GetTourInsertionCosts(IVRPProblemInstance instance, IVRPEncodedSolution solution, TourInsertionInfo tourInsertionInfo, int index, int customer,
-      out bool feasible) {
-      CVRPInsertionInfo insertionInfo = tourInsertionInfo.GetStopInsertionInfo(index) as CVRPInsertionInfo;
-
-      double costs = 0;
-      feasible = tourInsertionInfo.Penalty < double.Epsilon;
-
-      IHeterogenousCapacitatedProblemInstance cvrp = instance as IHeterogenousCapacitatedProblemInstance;
-      double overloadPenalty = cvrp.OverloadPenalty.Value;
-
-      double startDistance, endDistance;
-      costs += instance.GetInsertionDistance(insertionInfo.Start, customer, insertionInfo.End, solution, out startDistance, out endDistance);
-
-      double demand = instance.GetDemand(customer);
-      if (demand > insertionInfo.SpareCapacity) {
-        feasible = false;
-
-        if (insertionInfo.SpareCapacity >= 0)
-          costs += (demand - insertionInfo.SpareCapacity) * overloadPenalty;
-        else
-          costs += demand * overloadPenalty;
-      }
-
-      return costs;
-    }
-
-    protected override void InitResultParameters() {
-      base.InitResultParameters();
-
-      OverloadParameter.ActualValue = new DoubleValue(0);
-    }
-
-    protected override void SetResultParameters(VRPEvaluation tourEvaluation) {
-      base.SetResultParameters(tourEvaluation);
-
-      OverloadParameter.ActualValue.Value = (tourEvaluation as CVRPEvaluation).Overload;
-    }
-
-    [StorableConstructor]
-    protected MDCVRPEvaluator(StorableConstructorFlag _) : base(_) { }
-
-    public MDCVRPEvaluator() {
-      Parameters.Add(new LookupParameter<DoubleValue>("Overload", "The overload."));
-    }
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new MDCVRPEvaluator(this, cloner);
-    }
-
-    protected MDCVRPEvaluator(MDCVRPEvaluator original, Cloner cloner)
-      : base(original, cloner) {
-    }
-  }
-}
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/MultiDepotVRP/MDCVRP/MDCVRPProblemInstance.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/MultiDepotVRP/MDCVRP/MDCVRPProblemInstance.cs	(revision 17710)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/MultiDepotVRP/MDCVRP/MDCVRPProblemInstance.cs	(revision 17711)
@@ -23,11 +23,9 @@
 using System.Collections.Generic;
 using System.Linq;
+using HEAL.Attic;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
 using HeuristicLab.Data;
-using HeuristicLab.Optimization;
 using HeuristicLab.Parameters;
-using HEAL.Attic;
-using HeuristicLab.PluginInfrastructure;
 using HeuristicLab.Problems.VehicleRouting.Interfaces;
 using HeuristicLab.Problems.VehicleRouting.Variants;
@@ -67,19 +65,89 @@
     }
 
-    protected override IEnumerable<IOperator> GetOperators() {
-      return base.GetOperators()
-        .Where(o => o is IHeterogenousCapacitatedOperator).Cast<IOperator>();
-    }
-
-    protected override IEnumerable<IOperator> GetAnalyzers() {
-      return ApplicationManager.Manager.GetInstances<ICapacitatedOperator>()
-        .Where(o => o is IAnalyzer)
-        .Cast<IOperator>().Union(base.GetAnalyzers());
-    }
-
-    protected override IVRPEvaluator Evaluator {
-      get {
-        return new MDCVRPEvaluator();
-      }
+    public override IEnumerable<IOperator> FilterOperators(IEnumerable<IOperator> operators) {
+      return base.FilterOperators(operators).Where(x => x is IHeterogenousCapacitatedOperator);
+    }
+
+    protected override VRPEvaluation CreateTourEvaluation() {
+      return new CVRPEvaluation();
+    }
+
+    protected override void EvaluateTour(VRPEvaluation eval, Tour tour, IVRPEncodedSolution solution) {
+      TourInsertionInfo tourInfo = new TourInsertionInfo(solution.GetVehicleAssignment(solution.GetTourIndex(tour)));
+      eval.InsertionInfo.AddTourInsertionInfo(tourInfo);
+      double originalQuality = eval.Quality;
+
+      double delivered = 0.0;
+      double overweight = 0.0;
+      double distance = 0.0;
+
+      int tourIndex = solution.GetTourIndex(tour);
+      int vehicle = solution.GetVehicleAssignment(tourIndex);
+
+      double capacity = Capacity[vehicle];
+      for (int i = 0; i < tour.Stops.Count; i++) {
+        delivered += GetDemand(tour.Stops[i]);
+      }
+
+      double spareCapacity = capacity - delivered;
+
+      //simulate a tour, start and end at depot
+      for (int i = 0; i <= tour.Stops.Count; i++) {
+        int start = 0;
+        if (i > 0)
+          start = tour.Stops[i - 1];
+        int end = 0;
+        if (i < tour.Stops.Count)
+          end = tour.Stops[i];
+
+        //drive there
+        double currentDistace = GetDistance(start, end, solution);
+        distance += currentDistace;
+
+        CVRPInsertionInfo stopInfo = new CVRPInsertionInfo(start, end, spareCapacity);
+        tourInfo.AddStopInsertionInfo(stopInfo);
+      }
+
+      eval.Quality += FleetUsageFactor.Value;
+      eval.Quality += DistanceFactor.Value * distance;
+
+      eval.Distance += distance;
+      eval.VehicleUtilization += 1;
+
+      if (delivered > capacity) {
+        overweight = delivered - capacity;
+      }
+
+      (eval as CVRPEvaluation).Overload += overweight;
+      double penalty = overweight * OverloadPenalty.Value;
+      eval.Penalty += penalty;
+      eval.Quality += penalty;
+      tourInfo.Penalty = penalty;
+      tourInfo.Quality = eval.Quality - originalQuality;
+    }
+
+    protected override double GetTourInsertionCosts(IVRPEncodedSolution solution, TourInsertionInfo tourInsertionInfo, int index, int customer,
+      out bool feasible) {
+      CVRPInsertionInfo insertionInfo = tourInsertionInfo.GetStopInsertionInfo(index) as CVRPInsertionInfo;
+
+      double costs = 0;
+      feasible = tourInsertionInfo.Penalty < double.Epsilon;
+
+      double overloadPenalty = OverloadPenalty.Value;
+
+      double startDistance, endDistance;
+      costs += GetInsertionDistance(insertionInfo.Start, customer, insertionInfo.End, solution, out startDistance, out endDistance);
+
+      double demand = GetDemand(customer);
+      if (demand > insertionInfo.SpareCapacity) {
+        feasible = false;
+
+        if (insertionInfo.SpareCapacity >= 0)
+          costs += (demand - insertionInfo.SpareCapacity) * overloadPenalty;
+        else
+          costs += demand * overloadPenalty;
+      }
+
+      return costs;
     }
 
Index: anches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/MultiDepotVRP/MDCVRP/MDCVRPTW/MDCVRPPDTW/MDCVRPPDTWEvaluator.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/MultiDepotVRP/MDCVRP/MDCVRPTW/MDCVRPPDTW/MDCVRPPDTWEvaluator.cs	(revision 17710)
+++ 	(revision )
@@ -1,340 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 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 HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-using HeuristicLab.Parameters;
-using HEAL.Attic;
-using HeuristicLab.Problems.VehicleRouting.Interfaces;
-using HeuristicLab.Problems.VehicleRouting.Variants;
-
-namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances {
-  [Item("MDCVRPPDTWEvaluator", "Represents a multi depot CVRPPDTW evaluator.")]
-  [StorableType("4C4D6FA1-A16B-47B5-99D8-7F3D7C3D286A")]
-  public class MDCVRPPDTWEvaluator : MDCVRPTWEvaluator {
-    public ILookupParameter<IntValue> PickupViolationsParameter {
-      get { return (ILookupParameter<IntValue>)Parameters["PickupViolations"]; }
-    }
-
-    protected override VRPEvaluation CreateTourEvaluation() {
-      return new CVRPPDTWEvaluation();
-    }
-
-    protected override void EvaluateTour(VRPEvaluation eval, IVRPProblemInstance instance, Tour tour, IVRPEncodedSolution solution) {
-      TourInsertionInfo tourInfo = new TourInsertionInfo(solution.GetVehicleAssignment(solution.GetTourIndex(tour)));
-      eval.InsertionInfo.AddTourInsertionInfo(tourInfo);
-      double originalQuality = eval.Quality;
-
-      IHeterogenousCapacitatedProblemInstance cvrpInstance = instance as IHeterogenousCapacitatedProblemInstance;
-      DoubleArray demand = instance.Demand;
-
-      ITimeWindowedProblemInstance vrptw = instance as ITimeWindowedProblemInstance;
-      DoubleArray dueTime = vrptw.DueTime;
-      DoubleArray readyTime = vrptw.ReadyTime;
-      DoubleArray serviceTimes = vrptw.ServiceTime;
-
-      IPickupAndDeliveryProblemInstance pdp = instance as IPickupAndDeliveryProblemInstance;
-      IntArray pickupDeliveryLocation = pdp.PickupDeliveryLocation;
-
-      IMultiDepotProblemInstance mdp = instance as IMultiDepotProblemInstance;
-      IntArray vehicleAssignment = mdp.VehicleDepotAssignment;
-      int depots = mdp.Depots.Value;
-
-      double time = 0.0;
-      double waitingTime = 0.0;
-      double serviceTime = 0.0;
-      double tardiness = 0.0;
-      double overweight = 0.0;
-      double distance = 0.0;
-
-      int tourIndex = solution.GetTourIndex(tour);
-      int vehicle = solution.GetVehicleAssignment(tourIndex);
-      int depot = vehicleAssignment[vehicle];
-
-      double capacity = cvrpInstance.Capacity[vehicle];
-
-      double currentLoad = 0.0;
-      Dictionary<int, bool> stops = new Dictionary<int, bool>();
-      int pickupViolations = 0;
-
-      double tourStartTime = readyTime[0];
-      time = tourStartTime;
-
-      //simulate a tour, start and end at depot
-      for (int i = 0; i <= tour.Stops.Count; i++) {
-        int start = 0;
-        if (i > 0)
-          start = tour.Stops[i - 1];
-        int end = 0;
-        if (i < tour.Stops.Count)
-          end = tour.Stops[i];
-
-        //drive there
-        double currentDistace = vrptw.GetDistance(start, end, solution);
-        time += currentDistace;
-        distance += currentDistace;
-
-        double arrivalTime = time;
-
-        int endIndex;
-        if (end == 0)
-          endIndex = depot;
-        else
-          endIndex = end + depots - 1;
-
-        //check if it was serviced on time
-        if (time > dueTime[endIndex])
-          tardiness += time - dueTime[endIndex];
-
-        //wait
-        double currentWaitingTime = 0.0;
-        if (time < readyTime[endIndex])
-          currentWaitingTime = readyTime[endIndex] - time;
-
-        double waitTime = readyTime[endIndex] - time;
-
-        waitingTime += currentWaitingTime;
-        time += currentWaitingTime;
-
-        double spareTime = dueTime[endIndex] - time;
-        double arrivalSpareCapacity = capacity - currentLoad;
-
-        if (end > 0) {
-          //service
-          double currentServiceTime = serviceTimes[end - 1];
-          serviceTime += currentServiceTime;
-          time += currentServiceTime;
-
-          //Pickup / deliver
-          bool validPickupDelivery =
-            validPickupDelivery =
-            ((demand[end - 1] >= 0) ||
-             (stops.ContainsKey(pickupDeliveryLocation[end - 1])));
-
-          if (validPickupDelivery) {
-            currentLoad += demand[end - 1];
-          } else {
-            pickupViolations++;
-          }
-
-          if (currentLoad > capacity)
-            overweight += currentLoad - capacity;
-        }
-
-        double spareCapacity = capacity - currentLoad;
-        CVRPPDTWInsertionInfo stopInfo = new CVRPPDTWInsertionInfo(start, end, spareCapacity, tourStartTime,
-          arrivalTime, time, spareTime, waitTime, new List<int>(stops.Keys), arrivalSpareCapacity);
-        tourInfo.AddStopInsertionInfo(stopInfo);
-
-        stops.Add(end, true);
-      }
-
-      eval.Quality += instance.FleetUsageFactor.Value;
-      eval.Quality += instance.DistanceFactor.Value * distance;
-      eval.Distance += distance;
-      eval.VehicleUtilization += 1;
-
-      (eval as CVRPEvaluation).Overload += overweight;
-      double tourPenalty = 0;
-      double penalty = overweight * cvrpInstance.OverloadPenalty.Value;
-      eval.Penalty += penalty;
-      eval.Quality += penalty;
-      tourPenalty += penalty;
-
-      (eval as CVRPTWEvaluation).Tardiness += tardiness;
-      (eval as CVRPTWEvaluation).TravelTime += time;
-
-      penalty = tardiness * vrptw.TardinessPenalty.Value;
-      eval.Penalty += penalty;
-      eval.Quality += penalty;
-      tourPenalty += penalty;
-
-      (eval as CVRPPDTWEvaluation).PickupViolations += pickupViolations;
-      penalty = pickupViolations * pdp.PickupViolationPenalty.Value;
-      eval.Penalty += penalty;
-      tourPenalty += penalty;
-
-      eval.Quality += penalty;
-      eval.Quality += time * vrptw.TimeFactor.Value;
-      tourInfo.Penalty = tourPenalty;
-      tourInfo.Quality = eval.Quality - originalQuality;
-    }
-
-    protected override double GetTourInsertionCosts(IVRPProblemInstance instance, IVRPEncodedSolution solution, TourInsertionInfo tourInsertionInfo, int index, int customer,
-      out bool feasible) {
-      CVRPPDTWInsertionInfo insertionInfo = tourInsertionInfo.GetStopInsertionInfo(index) as CVRPPDTWInsertionInfo;
-
-      double costs = 0;
-      feasible = tourInsertionInfo.Penalty < double.Epsilon;
-      bool tourFeasible = true;
-
-      ICapacitatedProblemInstance cvrp = instance as ICapacitatedProblemInstance;
-      double overloadPenalty = cvrp.OverloadPenalty.Value;
-
-      ITimeWindowedProblemInstance vrptw = instance as ITimeWindowedProblemInstance;
-      DoubleArray dueTime = vrptw.DueTime;
-      DoubleArray readyTime = vrptw.ReadyTime;
-      DoubleArray serviceTimes = vrptw.ServiceTime;
-      double tardinessPenalty = vrptw.TardinessPenalty.Value;
-
-      IMultiDepotProblemInstance mdp = instance as IMultiDepotProblemInstance;
-      int depots = mdp.Depots.Value;
-
-      IPickupAndDeliveryProblemInstance pdp = instance as IPickupAndDeliveryProblemInstance;
-      IntArray pickupDeliveryLocation = pdp.PickupDeliveryLocation;
-      double pickupPenalty = pdp.PickupViolationPenalty.Value;
-
-      double startDistance, endDistance;
-      costs += instance.GetInsertionDistance(insertionInfo.Start, customer, insertionInfo.End, solution, out startDistance, out endDistance);
-
-      double demand = instance.GetDemand(customer);
-      if (demand > insertionInfo.ArrivalSpareCapacity) {
-        tourFeasible = feasible = false;
-        if (insertionInfo.ArrivalSpareCapacity >= 0)
-          costs += (demand - insertionInfo.ArrivalSpareCapacity) * overloadPenalty;
-        else
-          costs += demand * overloadPenalty;
-      }
-      int destination = pickupDeliveryLocation[customer - 1];
-
-      bool validPickup = true;
-      if (demand < 0 && !insertionInfo.Visited.Contains(destination)) {
-        tourFeasible = feasible = false;
-        validPickup = false;
-        costs += pickupPenalty;
-      }
-
-      double time = 0;
-      double tardiness = 0;
-
-      if (index > 0)
-        time = (tourInsertionInfo.GetStopInsertionInfo(index - 1) as CVRPTWInsertionInfo).LeaveTime;
-      else
-        time = insertionInfo.TourStartTime;
-
-      time += startDistance;
-
-      int customerIndex = customer + depots - 1;
-
-      if (time > dueTime[customerIndex]) {
-        tardiness += time - dueTime[customerIndex];
-      }
-      if (time < readyTime[customerIndex])
-        time += readyTime[customerIndex] - time;
-      time += serviceTimes[customer - 1];
-      time += endDistance;
-
-      double additionalTime = time - (tourInsertionInfo.GetStopInsertionInfo(index) as CVRPTWInsertionInfo).ArrivalTime;
-      for (int i = index; i < tourInsertionInfo.GetStopCount(); i++) {
-        CVRPTWInsertionInfo nextStop = tourInsertionInfo.GetStopInsertionInfo(i) as CVRPTWInsertionInfo;
-
-        if (demand >= 0) {
-          if (nextStop.End == destination) {
-            demand = 0;
-            costs -= pickupPenalty;
-            if (tourInsertionInfo.Penalty == pickupPenalty && tourFeasible)
-              feasible = true;
-          } else if (nextStop.SpareCapacity < 0) {
-            costs += demand * overloadPenalty;
-          } else if (nextStop.SpareCapacity < demand) {
-            tourFeasible = feasible = false;
-            costs += (demand - nextStop.SpareCapacity) * overloadPenalty;
-          }
-        } else if (validPickup) {
-          if (nextStop.SpareCapacity < 0) {
-            costs += Math.Max(demand, nextStop.SpareCapacity) * overloadPenalty;
-          }
-        }
-
-        if (additionalTime < 0) {
-          //arrive earlier than before
-          //wait probably
-          if (nextStop.WaitingTime < 0) {
-            double wait = nextStop.WaitingTime - additionalTime;
-            if (wait > 0)
-              additionalTime += wait;
-          } else {
-            additionalTime = 0;
-          }
-
-          //check due date, decrease tardiness
-          if (nextStop.SpareTime < 0) {
-            costs += Math.Max(nextStop.SpareTime, additionalTime) * tardinessPenalty;
-          }
-        } else {
-          //arrive later than before, probably don't have to wait
-          if (nextStop.WaitingTime > 0) {
-            additionalTime -= Math.Min(additionalTime, nextStop.WaitingTime);
-          }
-
-          //check due date
-          if (nextStop.SpareTime > 0) {
-            double spare = nextStop.SpareTime - additionalTime;
-            if (spare < 0)
-              tardiness += -spare;
-          } else {
-            tardiness += additionalTime;
-          }
-        }
-      }
-
-      costs += additionalTime * vrptw.TimeFactor.Value;
-
-      if (tardiness > 0) {
-        tourFeasible = feasible = false;
-      }
-
-      costs += tardiness * tardinessPenalty;
-
-      return costs;
-    }
-
-    protected override void InitResultParameters() {
-      base.InitResultParameters();
-
-      PickupViolationsParameter.ActualValue = new IntValue(0);
-    }
-
-    protected override void SetResultParameters(VRPEvaluation tourEvaluation) {
-      base.SetResultParameters(tourEvaluation);
-
-      PickupViolationsParameter.ActualValue.Value = (tourEvaluation as CVRPPDTWEvaluation).PickupViolations;
-    }
-
-    [StorableConstructor]
-    protected MDCVRPPDTWEvaluator(StorableConstructorFlag _) : base(_) { }
-
-    public MDCVRPPDTWEvaluator() {
-      Parameters.Add(new LookupParameter<IntValue>("PickupViolations", "The number of pickup violations."));
-    }
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new MDCVRPPDTWEvaluator(this, cloner);
-    }
-
-    protected MDCVRPPDTWEvaluator(MDCVRPPDTWEvaluator original, Cloner cloner)
-      : base(original, cloner) {
-    }
-  }
-}
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/MultiDepotVRP/MDCVRP/MDCVRPTW/MDCVRPPDTW/MDCVRPPDTWProblemInstance.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/MultiDepotVRP/MDCVRP/MDCVRPTW/MDCVRPPDTW/MDCVRPPDTWProblemInstance.cs	(revision 17710)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/MultiDepotVRP/MDCVRP/MDCVRPTW/MDCVRPPDTW/MDCVRPPDTWProblemInstance.cs	(revision 17711)
@@ -23,11 +23,9 @@
 using System.Collections.Generic;
 using System.Linq;
+using HEAL.Attic;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
 using HeuristicLab.Data;
-using HeuristicLab.Optimization;
 using HeuristicLab.Parameters;
-using HEAL.Attic;
-using HeuristicLab.PluginInfrastructure;
 using HeuristicLab.Problems.VehicleRouting.Interfaces;
 using HeuristicLab.Problems.VehicleRouting.Variants;
@@ -67,25 +65,263 @@
     }
 
-    protected override IEnumerable<IOperator> GetOperators() {
-      return
-        ApplicationManager.Manager.GetInstances<IPickupAndDeliveryOperator>()
-        .Where(o => !(o is IAnalyzer))
-        .Cast<IOperator>().Union(base.GetOperators());
-    }
-
-    protected override IEnumerable<IOperator> GetAnalyzers() {
-      return ApplicationManager.Manager.GetInstances<IPickupAndDeliveryOperator>()
-        .Where(o => o is IAnalyzer)
-        .Cast<IOperator>().Union(base.GetAnalyzers());
-    }
-
-    protected override IVRPEvaluator Evaluator {
-      get {
-        return new MDCVRPPDTWEvaluator();
-      }
-    }
-
     public int GetPickupDeliveryLocation(int city) {
       return PickupDeliveryLocation[city - 1];
+    }
+
+    public override IEnumerable<IOperator> FilterOperators(IEnumerable<IOperator> operators) {
+      return base.FilterOperators(operators).Where(x => x is IPickupAndDeliveryOperator);
+    }
+
+    protected override VRPEvaluation CreateTourEvaluation() {
+      return new CVRPPDTWEvaluation();
+    }
+
+    protected override void EvaluateTour(VRPEvaluation eval, Tour tour, IVRPEncodedSolution solution) {
+      TourInsertionInfo tourInfo = new TourInsertionInfo(solution.GetVehicleAssignment(solution.GetTourIndex(tour)));
+      eval.InsertionInfo.AddTourInsertionInfo(tourInfo);
+      double originalQuality = eval.Quality;
+
+      int depots = Depots.Value;
+
+      double time = 0.0;
+      double waitingTime = 0.0;
+      double serviceTime = 0.0;
+      double tardiness = 0.0;
+      double overweight = 0.0;
+      double distance = 0.0;
+
+      int tourIndex = solution.GetTourIndex(tour);
+      int vehicle = solution.GetVehicleAssignment(tourIndex);
+      int depot = VehicleDepotAssignment[vehicle];
+
+      double capacity = Capacity[vehicle];
+
+      double currentLoad = 0.0;
+      Dictionary<int, bool> stops = new Dictionary<int, bool>();
+      int pickupViolations = 0;
+
+      double tourStartTime = ReadyTime[0];
+      time = tourStartTime;
+
+      //simulate a tour, start and end at depot
+      for (int i = 0; i <= tour.Stops.Count; i++) {
+        int start = 0;
+        if (i > 0)
+          start = tour.Stops[i - 1];
+        int end = 0;
+        if (i < tour.Stops.Count)
+          end = tour.Stops[i];
+
+        //drive there
+        double currentDistace = GetDistance(start, end, solution);
+        time += currentDistace;
+        distance += currentDistace;
+
+        double arrivalTime = time;
+
+        int endIndex;
+        if (end == 0)
+          endIndex = depot;
+        else
+          endIndex = end + depots - 1;
+
+        //check if it was serviced on time
+        if (time > DueTime[endIndex])
+          tardiness += time - DueTime[endIndex];
+
+        //wait
+        double currentWaitingTime = 0.0;
+        if (time < ReadyTime[endIndex])
+          currentWaitingTime = ReadyTime[endIndex] - time;
+
+        double waitTime = ReadyTime[endIndex] - time;
+
+        waitingTime += currentWaitingTime;
+        time += currentWaitingTime;
+
+        double spareTime = DueTime[endIndex] - time;
+        double arrivalSpareCapacity = capacity - currentLoad;
+
+        if (end > 0) {
+          //service
+          double currentServiceTime = ServiceTime[end - 1];
+          serviceTime += currentServiceTime;
+          time += currentServiceTime;
+
+          //Pickup / deliver
+          bool validPickupDelivery =
+            validPickupDelivery =
+            ((Demand[end - 1] >= 0) ||
+             (stops.ContainsKey(PickupDeliveryLocation[end - 1])));
+
+          if (validPickupDelivery) {
+            currentLoad += Demand[end - 1];
+          } else {
+            pickupViolations++;
+          }
+
+          if (currentLoad > capacity)
+            overweight += currentLoad - capacity;
+        }
+
+        double spareCapacity = capacity - currentLoad;
+        CVRPPDTWInsertionInfo stopInfo = new CVRPPDTWInsertionInfo(start, end, spareCapacity, tourStartTime,
+          arrivalTime, time, spareTime, waitTime, new List<int>(stops.Keys), arrivalSpareCapacity);
+        tourInfo.AddStopInsertionInfo(stopInfo);
+
+        stops.Add(end, true);
+      }
+
+      eval.Quality += FleetUsageFactor.Value;
+      eval.Quality += DistanceFactor.Value * distance;
+      eval.Distance += distance;
+      eval.VehicleUtilization += 1;
+
+      (eval as CVRPEvaluation).Overload += overweight;
+      double tourPenalty = 0;
+      double penalty = overweight * OverloadPenalty.Value;
+      eval.Penalty += penalty;
+      eval.Quality += penalty;
+      tourPenalty += penalty;
+
+      (eval as CVRPTWEvaluation).Tardiness += tardiness;
+      (eval as CVRPTWEvaluation).TravelTime += time;
+
+      penalty = tardiness * TardinessPenalty.Value;
+      eval.Penalty += penalty;
+      eval.Quality += penalty;
+      tourPenalty += penalty;
+
+      (eval as CVRPPDTWEvaluation).PickupViolations += pickupViolations;
+      penalty = pickupViolations * PickupViolationPenalty.Value;
+      eval.Penalty += penalty;
+      tourPenalty += penalty;
+
+      eval.Quality += penalty;
+      eval.Quality += time * TimeFactor.Value;
+      tourInfo.Penalty = tourPenalty;
+      tourInfo.Quality = eval.Quality - originalQuality;
+
+      eval.IsFeasible = overweight == 0 && tardiness == 0 && pickupViolations == 0;
+    }
+
+    protected override double GetTourInsertionCosts(IVRPEncodedSolution solution, TourInsertionInfo tourInsertionInfo, int index, int customer,
+      out bool feasible) {
+      CVRPPDTWInsertionInfo insertionInfo = tourInsertionInfo.GetStopInsertionInfo(index) as CVRPPDTWInsertionInfo;
+
+      double costs = 0;
+      feasible = tourInsertionInfo.Penalty < double.Epsilon;
+      bool tourFeasible = true;
+
+      double overloadPenalty = OverloadPenalty.Value;
+      double tardinessPenalty = TardinessPenalty.Value;
+
+      int depots = Depots.Value;
+
+      double pickupPenalty = PickupViolationPenalty.Value;
+
+      double startDistance, endDistance;
+      costs += GetInsertionDistance(insertionInfo.Start, customer, insertionInfo.End, solution, out startDistance, out endDistance);
+
+      double demand = GetDemand(customer);
+      if (demand > insertionInfo.ArrivalSpareCapacity) {
+        tourFeasible = feasible = false;
+        if (insertionInfo.ArrivalSpareCapacity >= 0)
+          costs += (demand - insertionInfo.ArrivalSpareCapacity) * overloadPenalty;
+        else
+          costs += demand * overloadPenalty;
+      }
+      int destination = PickupDeliveryLocation[customer - 1];
+
+      bool validPickup = true;
+      if (demand < 0 && !insertionInfo.Visited.Contains(destination)) {
+        tourFeasible = feasible = false;
+        validPickup = false;
+        costs += pickupPenalty;
+      }
+
+      double time = 0;
+      double tardiness = 0;
+
+      if (index > 0)
+        time = (tourInsertionInfo.GetStopInsertionInfo(index - 1) as CVRPTWInsertionInfo).LeaveTime;
+      else
+        time = insertionInfo.TourStartTime;
+
+      time += startDistance;
+
+      int customerIndex = customer + depots - 1;
+
+      if (time > DueTime[customerIndex]) {
+        tardiness += time - DueTime[customerIndex];
+      }
+      if (time < ReadyTime[customerIndex])
+        time += ReadyTime[customerIndex] - time;
+      time += ServiceTime[customer - 1];
+      time += endDistance;
+
+      double additionalTime = time - (tourInsertionInfo.GetStopInsertionInfo(index) as CVRPTWInsertionInfo).ArrivalTime;
+      for (int i = index; i < tourInsertionInfo.GetStopCount(); i++) {
+        CVRPTWInsertionInfo nextStop = tourInsertionInfo.GetStopInsertionInfo(i) as CVRPTWInsertionInfo;
+
+        if (demand >= 0) {
+          if (nextStop.End == destination) {
+            demand = 0;
+            costs -= pickupPenalty;
+            if (tourInsertionInfo.Penalty == pickupPenalty && tourFeasible)
+              feasible = true;
+          } else if (nextStop.SpareCapacity < 0) {
+            costs += demand * overloadPenalty;
+          } else if (nextStop.SpareCapacity < demand) {
+            tourFeasible = feasible = false;
+            costs += (demand - nextStop.SpareCapacity) * overloadPenalty;
+          }
+        } else if (validPickup) {
+          if (nextStop.SpareCapacity < 0) {
+            costs += Math.Max(demand, nextStop.SpareCapacity) * overloadPenalty;
+          }
+        }
+
+        if (additionalTime < 0) {
+          //arrive earlier than before
+          //wait probably
+          if (nextStop.WaitingTime < 0) {
+            double wait = nextStop.WaitingTime - additionalTime;
+            if (wait > 0)
+              additionalTime += wait;
+          } else {
+            additionalTime = 0;
+          }
+
+          //check due date, decrease tardiness
+          if (nextStop.SpareTime < 0) {
+            costs += Math.Max(nextStop.SpareTime, additionalTime) * tardinessPenalty;
+          }
+        } else {
+          //arrive later than before, probably don't have to wait
+          if (nextStop.WaitingTime > 0) {
+            additionalTime -= Math.Min(additionalTime, nextStop.WaitingTime);
+          }
+
+          //check due date
+          if (nextStop.SpareTime > 0) {
+            double spare = nextStop.SpareTime - additionalTime;
+            if (spare < 0)
+              tardiness += -spare;
+          } else {
+            tardiness += additionalTime;
+          }
+        }
+      }
+
+      costs += additionalTime * TimeFactor.Value;
+
+      if (tardiness > 0) {
+        tourFeasible = feasible = false;
+      }
+
+      costs += tardiness * tardinessPenalty;
+
+      return costs;
     }
 
Index: anches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/MultiDepotVRP/MDCVRP/MDCVRPTW/MDCVRPTWEvaluator.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/MultiDepotVRP/MDCVRP/MDCVRPTW/MDCVRPTWEvaluator.cs	(revision 17710)
+++ 	(revision )
@@ -1,292 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 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 HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-using HeuristicLab.Parameters;
-using HEAL.Attic;
-using HeuristicLab.Problems.VehicleRouting.Interfaces;
-using HeuristicLab.Problems.VehicleRouting.Variants;
-
-namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances {
-  [Item("MDCVRPTWEvaluator", "Represents a multi depot CVRPTW evaluator.")]
-  [StorableType("D3E40FC1-17FA-4C0E-AD1A-10C98ACCE27D")]
-  public class MDCVRPTWEvaluator : MDCVRPEvaluator {
-    public ILookupParameter<DoubleValue> TardinessParameter {
-      get { return (ILookupParameter<DoubleValue>)Parameters["Tardiness"]; }
-    }
-
-    public ILookupParameter<DoubleValue> TravelTimeParameter {
-      get { return (ILookupParameter<DoubleValue>)Parameters["TravelTime"]; }
-    }
-
-    protected override VRPEvaluation CreateTourEvaluation() {
-      return new CVRPTWEvaluation();
-    }
-
-    protected override void EvaluateTour(VRPEvaluation eval, IVRPProblemInstance instance, Tour tour, IVRPEncodedSolution solution) {
-      TourInsertionInfo tourInfo = new TourInsertionInfo(solution.GetVehicleAssignment(solution.GetTourIndex(tour)));
-      eval.InsertionInfo.AddTourInsertionInfo(tourInfo);
-      double originalQuality = eval.Quality;
-
-      IHeterogenousCapacitatedProblemInstance cvrpInstance = instance as IHeterogenousCapacitatedProblemInstance;
-      DoubleArray demand = instance.Demand;
-
-      ITimeWindowedProblemInstance vrptw = instance as ITimeWindowedProblemInstance;
-      DoubleArray dueTime = vrptw.DueTime;
-      DoubleArray readyTime = vrptw.ReadyTime;
-      DoubleArray serviceTimes = vrptw.ServiceTime;
-
-      IMultiDepotProblemInstance mdp = instance as IMultiDepotProblemInstance;
-      IntArray vehicleAssignment = mdp.VehicleDepotAssignment;
-      int depots = mdp.Depots.Value;
-
-      double time = 0.0;
-      double waitingTime = 0.0;
-      double serviceTime = 0.0;
-      double tardiness = 0.0;
-      double delivered = 0.0;
-      double overweight = 0.0;
-      double distance = 0.0;
-
-      int tourIndex = solution.GetTourIndex(tour);
-      int vehicle = solution.GetVehicleAssignment(tourIndex);
-      int depot = vehicleAssignment[vehicle];
-
-      double capacity = cvrpInstance.Capacity[vehicle];
-      for (int i = 0; i < tour.Stops.Count; i++) {
-        delivered += instance.GetDemand(tour.Stops[i]);
-      }
-
-      double spareCapacity = capacity - delivered;
-
-      double tourStartTime = vrptw.ReadyTime[depot];
-      time = tourStartTime;
-
-      //simulate a tour, start and end at depot
-      for (int i = 0; i <= tour.Stops.Count; i++) {
-        int start = 0;
-        if (i > 0)
-          start = tour.Stops[i - 1];
-        int end = 0;
-        if (i < tour.Stops.Count)
-          end = tour.Stops[i];
-
-        //drive there
-        double currentDistace = vrptw.GetDistance(start, end, solution);
-        time += currentDistace;
-        distance += currentDistace;
-
-        double arrivalTime = time;
-
-        int endIndex;
-        if (end == 0)
-          endIndex = depot;
-        else
-          endIndex = end + depots - 1;
-
-        //check if it was serviced on time
-        if (time > dueTime[endIndex])
-          tardiness += time - dueTime[endIndex];
-
-        //wait
-        double currentWaitingTime = 0.0;
-        if (time < readyTime[endIndex])
-          currentWaitingTime = readyTime[endIndex] - time;
-
-        double waitTime = readyTime[endIndex] - time;
-
-        waitingTime += currentWaitingTime;
-        time += currentWaitingTime;
-
-        double spareTime = dueTime[endIndex] - time;
-
-        //service
-        double currentServiceTime = 0;
-        if (end > 0)
-          currentServiceTime = serviceTimes[end - 1];
-        serviceTime += currentServiceTime;
-        time += currentServiceTime;
-
-        CVRPTWInsertionInfo stopInfo = new CVRPTWInsertionInfo(start, end, spareCapacity, tourStartTime, arrivalTime, time, spareTime, waitTime);
-        tourInfo.AddStopInsertionInfo(stopInfo);
-      }
-
-      eval.Quality += instance.FleetUsageFactor.Value;
-      eval.Quality += instance.DistanceFactor.Value * distance;
-      eval.Distance += distance;
-      eval.VehicleUtilization += 1;
-
-      if (delivered > capacity) {
-        overweight = delivered - capacity;
-      }
-
-      (eval as CVRPEvaluation).Overload += overweight;
-      double tourPenalty = 0;
-      double penalty = overweight * cvrpInstance.OverloadPenalty.Value;
-      eval.Penalty += penalty;
-      eval.Quality += penalty;
-      tourPenalty += penalty;
-
-      (eval as CVRPTWEvaluation).Tardiness += tardiness;
-      (eval as CVRPTWEvaluation).TravelTime += time;
-
-      penalty = tardiness * vrptw.TardinessPenalty.Value;
-      eval.Penalty += penalty;
-      eval.Quality += penalty;
-      tourPenalty += penalty;
-      eval.Quality += time * vrptw.TimeFactor.Value;
-      tourInfo.Penalty = tourPenalty;
-      tourInfo.Quality = eval.Quality - originalQuality;
-    }
-
-    protected override double GetTourInsertionCosts(IVRPProblemInstance instance, IVRPEncodedSolution solution, TourInsertionInfo tourInsertionInfo, int index, int customer,
-      out bool feasible) {
-      CVRPTWInsertionInfo insertionInfo = tourInsertionInfo.GetStopInsertionInfo(index) as CVRPTWInsertionInfo;
-
-      double costs = 0;
-      feasible = tourInsertionInfo.Penalty < double.Epsilon;
-
-      ICapacitatedProblemInstance cvrp = instance as ICapacitatedProblemInstance;
-      double overloadPenalty = cvrp.OverloadPenalty.Value;
-
-      ITimeWindowedProblemInstance vrptw = instance as ITimeWindowedProblemInstance;
-      DoubleArray dueTime = vrptw.DueTime;
-      DoubleArray readyTime = vrptw.ReadyTime;
-      DoubleArray serviceTimes = vrptw.ServiceTime;
-      double tardinessPenalty = vrptw.TardinessPenalty.Value;
-
-      IMultiDepotProblemInstance mdp = instance as IMultiDepotProblemInstance;
-      int depots = mdp.Depots.Value;
-
-      double startDistance, endDistance;
-      costs += instance.GetInsertionDistance(insertionInfo.Start, customer, insertionInfo.End, solution, out startDistance, out endDistance);
-
-      double demand = instance.GetDemand(customer);
-      if (demand > insertionInfo.SpareCapacity) {
-        feasible = false;
-
-        if (insertionInfo.SpareCapacity >= 0)
-          costs += (demand - insertionInfo.SpareCapacity) * overloadPenalty;
-        else
-          costs += demand * overloadPenalty;
-      }
-
-      double time = 0;
-      double tardiness = 0;
-
-      if (index > 0)
-        time = (tourInsertionInfo.GetStopInsertionInfo(index - 1) as CVRPTWInsertionInfo).LeaveTime;
-      else
-        time = insertionInfo.TourStartTime;
-
-      time += startDistance;
-
-      int customerIndex = customer + depots - 1;
-
-      if (time > dueTime[customerIndex]) {
-        tardiness += time - dueTime[customerIndex];
-      }
-      if (time < readyTime[customerIndex])
-        time += readyTime[customerIndex] - time;
-      time += serviceTimes[customer - 1];
-      time += endDistance;
-
-      double additionalTime = time - (tourInsertionInfo.GetStopInsertionInfo(index) as CVRPTWInsertionInfo).ArrivalTime;
-      for (int i = index; i < tourInsertionInfo.GetStopCount(); i++) {
-        CVRPTWInsertionInfo nextStop = tourInsertionInfo.GetStopInsertionInfo(i) as CVRPTWInsertionInfo;
-
-        if (additionalTime < 0) {
-          //arrive earlier than before
-          //wait probably
-          if (nextStop.WaitingTime < 0) {
-            double wait = nextStop.WaitingTime - additionalTime;
-            if (wait > 0)
-              additionalTime += wait;
-          } else {
-            additionalTime = 0;
-          }
-
-          //check due date, decrease tardiness
-          if (nextStop.SpareTime < 0) {
-            costs += Math.Max(nextStop.SpareTime, additionalTime) * tardinessPenalty;
-          }
-        } else {
-          //arrive later than before, probably don't have to wait
-          if (nextStop.WaitingTime > 0) {
-            additionalTime -= Math.Min(additionalTime, nextStop.WaitingTime);
-          }
-
-          //check due date
-          if (nextStop.SpareTime > 0) {
-            double spare = nextStop.SpareTime - additionalTime;
-            if (spare < 0)
-              tardiness += -spare;
-          } else {
-            tardiness += additionalTime;
-          }
-        }
-      }
-
-      costs += additionalTime * vrptw.TimeFactor.Value;
-
-      if (tardiness > 0) {
-        feasible = false;
-      }
-
-      costs += tardiness * tardinessPenalty;
-
-      return costs;
-    }
-
-    protected override void InitResultParameters() {
-      base.InitResultParameters();
-
-      TardinessParameter.ActualValue = new DoubleValue(0);
-      TravelTimeParameter.ActualValue = new DoubleValue(0);
-    }
-
-    protected override void SetResultParameters(VRPEvaluation tourEvaluation) {
-      base.SetResultParameters(tourEvaluation);
-
-      TardinessParameter.ActualValue.Value = (tourEvaluation as CVRPTWEvaluation).Tardiness;
-      TravelTimeParameter.ActualValue.Value = (tourEvaluation as CVRPTWEvaluation).TravelTime;
-    }
-
-    [StorableConstructor]
-    protected MDCVRPTWEvaluator(StorableConstructorFlag _) : base(_) { }
-
-    public MDCVRPTWEvaluator() {
-      Parameters.Add(new LookupParameter<DoubleValue>("Tardiness", "The tardiness."));
-      Parameters.Add(new LookupParameter<DoubleValue>("TravelTime", "The travel time."));
-    }
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new MDCVRPTWEvaluator(this, cloner);
-    }
-
-    protected MDCVRPTWEvaluator(MDCVRPTWEvaluator original, Cloner cloner)
-      : base(original, cloner) {
-    }
-  }
-}
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/MultiDepotVRP/MDCVRP/MDCVRPTW/MDCVRPTWProblemInstance.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/MultiDepotVRP/MDCVRP/MDCVRPTW/MDCVRPTWProblemInstance.cs	(revision 17710)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/MultiDepotVRP/MDCVRP/MDCVRPTW/MDCVRPTWProblemInstance.cs	(revision 17711)
@@ -23,11 +23,9 @@
 using System.Collections.Generic;
 using System.Linq;
+using HEAL.Attic;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
 using HeuristicLab.Data;
-using HeuristicLab.Optimization;
 using HeuristicLab.Parameters;
-using HEAL.Attic;
-using HeuristicLab.PluginInfrastructure;
 using HeuristicLab.Problems.VehicleRouting.Interfaces;
 using HeuristicLab.Problems.VehicleRouting.Variants;
@@ -89,19 +87,209 @@
     }
 
-    protected override IEnumerable<IOperator> GetOperators() {
-      return base.GetOperators()
-        .Where(o => o is ITimeWindowedOperator).Cast<IOperator>();
-    }
-
-    protected override IEnumerable<IOperator> GetAnalyzers() {
-      return ApplicationManager.Manager.GetInstances<ITimeWindowedOperator>()
-        .Where(o => o is IAnalyzer)
-        .Cast<IOperator>().Union(base.GetAnalyzers());
-    }
-
-    protected override IVRPEvaluator Evaluator {
-      get {
-        return new MDCVRPTWEvaluator();
-      }
+    public override IEnumerable<IOperator> FilterOperators(IEnumerable<IOperator> operators) {
+      return base.FilterOperators(operators).Where(x => x is ITimeWindowedOperator);
+    }
+
+    protected override VRPEvaluation CreateTourEvaluation() {
+      return new CVRPTWEvaluation();
+    }
+
+    protected override void EvaluateTour(VRPEvaluation eval, Tour tour, IVRPEncodedSolution solution) {
+      TourInsertionInfo tourInfo = new TourInsertionInfo(solution.GetVehicleAssignment(solution.GetTourIndex(tour)));
+      eval.InsertionInfo.AddTourInsertionInfo(tourInfo);
+      double originalQuality = eval.Quality;
+
+      int depots = Depots.Value;
+
+      double time = 0.0;
+      double waitingTime = 0.0;
+      double serviceTime = 0.0;
+      double tardiness = 0.0;
+      double delivered = 0.0;
+      double overweight = 0.0;
+      double distance = 0.0;
+
+      int tourIndex = solution.GetTourIndex(tour);
+      int vehicle = solution.GetVehicleAssignment(tourIndex);
+      int depot = VehicleDepotAssignment[vehicle];
+
+      double capacity = Capacity[vehicle];
+      for (int i = 0; i < tour.Stops.Count; i++) {
+        delivered += GetDemand(tour.Stops[i]);
+      }
+
+      double spareCapacity = capacity - delivered;
+
+      double tourStartTime = ReadyTime[depot];
+      time = tourStartTime;
+
+      //simulate a tour, start and end at depot
+      for (int i = 0; i <= tour.Stops.Count; i++) {
+        int start = 0;
+        if (i > 0)
+          start = tour.Stops[i - 1];
+        int end = 0;
+        if (i < tour.Stops.Count)
+          end = tour.Stops[i];
+
+        //drive there
+        double currentDistace = GetDistance(start, end, solution);
+        time += currentDistace;
+        distance += currentDistace;
+
+        double arrivalTime = time;
+
+        int endIndex;
+        if (end == 0)
+          endIndex = depot;
+        else
+          endIndex = end + depots - 1;
+
+        //check if it was serviced on time
+        if (time > DueTime[endIndex])
+          tardiness += time - DueTime[endIndex];
+
+        //wait
+        double currentWaitingTime = 0.0;
+        if (time < ReadyTime[endIndex])
+          currentWaitingTime = ReadyTime[endIndex] - time;
+
+        double waitTime = ReadyTime[endIndex] - time;
+
+        waitingTime += currentWaitingTime;
+        time += currentWaitingTime;
+
+        double spareTime = DueTime[endIndex] - time;
+
+        //service
+        double currentServiceTime = 0;
+        if (end > 0)
+          currentServiceTime = ServiceTime[end - 1];
+        serviceTime += currentServiceTime;
+        time += currentServiceTime;
+
+        CVRPTWInsertionInfo stopInfo = new CVRPTWInsertionInfo(start, end, spareCapacity, tourStartTime, arrivalTime, time, spareTime, waitTime);
+        tourInfo.AddStopInsertionInfo(stopInfo);
+      }
+
+      eval.Quality += FleetUsageFactor.Value;
+      eval.Quality += DistanceFactor.Value * distance;
+      eval.Distance += distance;
+      eval.VehicleUtilization += 1;
+
+      if (delivered > capacity) {
+        overweight = delivered - capacity;
+      }
+
+      (eval as CVRPEvaluation).Overload += overweight;
+      double tourPenalty = 0;
+      double penalty = overweight * OverloadPenalty.Value;
+      eval.Penalty += penalty;
+      eval.Quality += penalty;
+      tourPenalty += penalty;
+
+      (eval as CVRPTWEvaluation).Tardiness += tardiness;
+      (eval as CVRPTWEvaluation).TravelTime += time;
+
+      penalty = tardiness * TardinessPenalty.Value;
+      eval.Penalty += penalty;
+      eval.Quality += penalty;
+      tourPenalty += penalty;
+      eval.Quality += time * TimeFactor.Value;
+      tourInfo.Penalty = tourPenalty;
+      tourInfo.Quality = eval.Quality - originalQuality;
+
+      eval.IsFeasible = overweight == 0 && tardiness == 0;
+    }
+
+    protected override double GetTourInsertionCosts(IVRPEncodedSolution solution, TourInsertionInfo tourInsertionInfo, int index, int customer,
+      out bool feasible) {
+      CVRPTWInsertionInfo insertionInfo = tourInsertionInfo.GetStopInsertionInfo(index) as CVRPTWInsertionInfo;
+
+      double costs = 0;
+      feasible = tourInsertionInfo.Penalty < double.Epsilon;
+
+      double overloadPenalty = OverloadPenalty.Value;
+      double tardinessPenalty = TardinessPenalty.Value;
+      int depots = Depots.Value;
+
+      double startDistance, endDistance;
+      costs += GetInsertionDistance(insertionInfo.Start, customer, insertionInfo.End, solution, out startDistance, out endDistance);
+
+      double demand = GetDemand(customer);
+      if (demand > insertionInfo.SpareCapacity) {
+        feasible = false;
+
+        if (insertionInfo.SpareCapacity >= 0)
+          costs += (demand - insertionInfo.SpareCapacity) * overloadPenalty;
+        else
+          costs += demand * overloadPenalty;
+      }
+
+      double time = 0;
+      double tardiness = 0;
+
+      if (index > 0)
+        time = (tourInsertionInfo.GetStopInsertionInfo(index - 1) as CVRPTWInsertionInfo).LeaveTime;
+      else
+        time = insertionInfo.TourStartTime;
+
+      time += startDistance;
+
+      int customerIndex = customer + depots - 1;
+
+      if (time > DueTime[customerIndex]) {
+        tardiness += time - DueTime[customerIndex];
+      }
+      if (time < ReadyTime[customerIndex])
+        time += ReadyTime[customerIndex] - time;
+      time += ServiceTime[customer - 1];
+      time += endDistance;
+
+      double additionalTime = time - (tourInsertionInfo.GetStopInsertionInfo(index) as CVRPTWInsertionInfo).ArrivalTime;
+      for (int i = index; i < tourInsertionInfo.GetStopCount(); i++) {
+        CVRPTWInsertionInfo nextStop = tourInsertionInfo.GetStopInsertionInfo(i) as CVRPTWInsertionInfo;
+
+        if (additionalTime < 0) {
+          //arrive earlier than before
+          //wait probably
+          if (nextStop.WaitingTime < 0) {
+            double wait = nextStop.WaitingTime - additionalTime;
+            if (wait > 0)
+              additionalTime += wait;
+          } else {
+            additionalTime = 0;
+          }
+
+          //check due date, decrease tardiness
+          if (nextStop.SpareTime < 0) {
+            costs += Math.Max(nextStop.SpareTime, additionalTime) * tardinessPenalty;
+          }
+        } else {
+          //arrive later than before, probably don't have to wait
+          if (nextStop.WaitingTime > 0) {
+            additionalTime -= Math.Min(additionalTime, nextStop.WaitingTime);
+          }
+
+          //check due date
+          if (nextStop.SpareTime > 0) {
+            double spare = nextStop.SpareTime - additionalTime;
+            if (spare < 0)
+              tardiness += -spare;
+          } else {
+            tardiness += additionalTime;
+          }
+        }
+      }
+
+      costs += additionalTime * TimeFactor.Value;
+
+      if (tardiness > 0) {
+        feasible = false;
+      }
+
+      costs += tardiness * tardinessPenalty;
+
+      return costs;
     }
 
Index: anches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/MultiDepotVRP/MultiDepotVRPEvaluator.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/MultiDepotVRP/MultiDepotVRPEvaluator.cs	(revision 17710)
+++ 	(revision )
@@ -1,95 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 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 HeuristicLab.Common;
-using HeuristicLab.Core;
-using HEAL.Attic;
-using HeuristicLab.Problems.VehicleRouting.Interfaces;
-
-
-namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances {
-  [Item("SingleDepotVRPEvaluator", "Represents a single depot VRP evaluator.")]
-  [StorableType("AFC33483-2E8A-4469-8216-1F4FEE0AEB51")]
-  public class MultiDepotVRPEvaluator : VRPEvaluator {
-    protected override void EvaluateTour(VRPEvaluation eval, IVRPProblemInstance instance, Tour tour, IVRPEncodedSolution solution) {
-      TourInsertionInfo tourInfo = new TourInsertionInfo(solution.GetVehicleAssignment(solution.GetTourIndex(tour)));
-      eval.InsertionInfo.AddTourInsertionInfo(tourInfo);
-
-      double distance = 0.0;
-      double quality = 0.0;
-
-      //simulate a tour, start and end at depot
-      for (int i = 0; i <= tour.Stops.Count; i++) {
-        int start = 0;
-        if (i > 0)
-          start = tour.Stops[i - 1];
-        int end = 0;
-        if (i < tour.Stops.Count)
-          end = tour.Stops[i];
-
-        //drive there
-        double currentDistace = instance.GetDistance(start, end, solution);
-        distance += currentDistace;
-
-        StopInsertionInfo stopInfo = new StopInsertionInfo(start, end);
-        tourInfo.AddStopInsertionInfo(stopInfo);
-      }
-
-      //Fleet usage
-      quality += instance.FleetUsageFactor.Value;
-      //Distance
-      quality += instance.DistanceFactor.Value * distance;
-
-      eval.Distance += distance;
-      eval.VehicleUtilization += 1;
-
-      eval.Quality += quality;
-      tourInfo.Quality = quality;
-    }
-
-    protected override double GetTourInsertionCosts(IVRPProblemInstance instance, IVRPEncodedSolution solution, TourInsertionInfo tourInsertionInfo, int index, int customer,
-      out bool feasible) {
-      StopInsertionInfo insertionInfo = tourInsertionInfo.GetStopInsertionInfo(index);
-
-      double costs = 0;
-      feasible = true;
-      double startDistance, endDistance;
-
-      costs += instance.GetInsertionDistance(insertionInfo.Start, customer, insertionInfo.End, solution, out startDistance, out endDistance);
-
-      return costs;
-    }
-
-    [StorableConstructor]
-    protected MultiDepotVRPEvaluator(StorableConstructorFlag _) : base(_) { }
-
-    public MultiDepotVRPEvaluator() {
-    }
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new MultiDepotVRPEvaluator(this, cloner);
-    }
-
-    protected MultiDepotVRPEvaluator(MultiDepotVRPEvaluator original, Cloner cloner)
-      : base(original, cloner) {
-    }
-  }
-}
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/MultiDepotVRP/MultiDepotVRPProblemInstance.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/MultiDepotVRP/MultiDepotVRPProblemInstance.cs	(revision 17710)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/MultiDepotVRP/MultiDepotVRPProblemInstance.cs	(revision 17711)
@@ -23,11 +23,9 @@
 using System.Collections.Generic;
 using System.Linq;
+using HEAL.Attic;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
 using HeuristicLab.Data;
-using HeuristicLab.Optimization;
 using HeuristicLab.Parameters;
-using HEAL.Attic;
-using HeuristicLab.PluginInfrastructure;
 using HeuristicLab.Problems.VehicleRouting.Interfaces;
 using HeuristicLab.Problems.VehicleRouting.Variants;
@@ -60,31 +58,10 @@
     }
 
-    protected override IEnumerable<IOperator> GetOperators() {
-      return ApplicationManager.Manager.GetInstances<IMultiDepotOperator>().Cast<IOperator>();
-    }
-
-    protected override IEnumerable<IOperator> GetAnalyzers() {
-      return ApplicationManager.Manager.GetInstances<IMultiDepotOperator>()
-        .Where(o => o is IAnalyzer)
-        .Cast<IOperator>();
-    }
-
-    public override IntValue Cities {
-      get {
-        return new IntValue(Demand.Length);
-      }
-    }
-
-    protected override IVRPEvaluator Evaluator {
-      get {
-        return new MultiDepotVRPEvaluator();
-      }
-    }
-
-    protected override IVRPCreator Creator {
-      get {
-        return new HeuristicLab.Problems.VehicleRouting.Encodings.Alba.RandomCreator();
-      }
-    }
+    public override IEnumerable<IOperator> FilterOperators(IEnumerable<IOperator> operators) {
+      return base.FilterOperators(operators).Where(x => x is IMultiDepotOperator);
+    }
+
+    public override IntValue Cities => new IntValue(Demand.Length);
+
 
     public override double GetDemand(int city) {
@@ -172,4 +149,52 @@
       return newDistance - distance;
     }
+    protected override void EvaluateTour(VRPEvaluation eval, Tour tour, IVRPEncodedSolution solution) {
+      TourInsertionInfo tourInfo = new TourInsertionInfo(solution.GetVehicleAssignment(solution.GetTourIndex(tour)));
+      eval.InsertionInfo.AddTourInsertionInfo(tourInfo);
+
+      double distance = 0.0;
+      double quality = 0.0;
+
+      //simulate a tour, start and end at depot
+      for (int i = 0; i <= tour.Stops.Count; i++) {
+        int start = 0;
+        if (i > 0)
+          start = tour.Stops[i - 1];
+        int end = 0;
+        if (i < tour.Stops.Count)
+          end = tour.Stops[i];
+
+        //drive there
+        double currentDistace = GetDistance(start, end, solution);
+        distance += currentDistace;
+
+        StopInsertionInfo stopInfo = new StopInsertionInfo(start, end);
+        tourInfo.AddStopInsertionInfo(stopInfo);
+      }
+
+      //Fleet usage
+      quality += FleetUsageFactor.Value;
+      //Distance
+      quality += DistanceFactor.Value * distance;
+
+      eval.Distance += distance;
+      eval.VehicleUtilization += 1;
+
+      eval.Quality += quality;
+      tourInfo.Quality = quality;
+    }
+
+    protected override double GetTourInsertionCosts(IVRPEncodedSolution solution, TourInsertionInfo tourInsertionInfo, int index, int customer,
+      out bool feasible) {
+      StopInsertionInfo insertionInfo = tourInsertionInfo.GetStopInsertionInfo(index);
+
+      double costs = 0;
+      feasible = true;
+      double startDistance, endDistance;
+
+      costs += GetInsertionDistance(insertionInfo.Start, customer, insertionInfo.End, solution, out startDistance, out endDistance);
+
+      return costs;
+    }
 
     [StorableConstructor]
Index: anches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPEvaluator.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPEvaluator.cs	(revision 17710)
+++ 	(revision )
@@ -1,156 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 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 HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-using HeuristicLab.Parameters;
-using HEAL.Attic;
-using HeuristicLab.Problems.VehicleRouting.Interfaces;
-using HeuristicLab.Problems.VehicleRouting.Variants;
-
-namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances {
-  [Item("CVRPEvaluator", "Represents a single depot CVRP evaluator.")]
-  [StorableType("7253D8EC-5F91-4E5F-99E0-45AF10AEA9AF")]
-  public class CVRPEvaluator : VRPEvaluator {
-    public ILookupParameter<DoubleValue> OverloadParameter {
-      get { return (ILookupParameter<DoubleValue>)Parameters["Overload"]; }
-    }
-
-    protected override VRPEvaluation CreateTourEvaluation() {
-      return new CVRPEvaluation();
-    }
-
-    protected override void EvaluateTour(VRPEvaluation eval, IVRPProblemInstance instance, Tour tour, IVRPEncodedSolution solution) {
-      TourInsertionInfo tourInfo = new TourInsertionInfo(solution.GetVehicleAssignment(solution.GetTourIndex(tour))); ;
-      eval.InsertionInfo.AddTourInsertionInfo(tourInfo);
-      double originalQuality = eval.Quality;
-
-      IHomogenousCapacitatedProblemInstance cvrpInstance = instance as IHomogenousCapacitatedProblemInstance;
-      DoubleArray demand = instance.Demand;
-
-      double delivered = 0.0;
-      double overweight = 0.0;
-      double distance = 0.0;
-
-      double capacity = cvrpInstance.Capacity.Value;
-      for (int i = 0; i <= tour.Stops.Count; i++) {
-        int end = 0;
-        if (i < tour.Stops.Count)
-          end = tour.Stops[i];
-
-        delivered += demand[end];
-      }
-
-      double spareCapacity = capacity - delivered;
-
-      //simulate a tour, start and end at depot
-      for (int i = 0; i <= tour.Stops.Count; i++) {
-        int start = 0;
-        if (i > 0)
-          start = tour.Stops[i - 1];
-        int end = 0;
-        if (i < tour.Stops.Count)
-          end = tour.Stops[i];
-
-        //drive there
-        double currentDistace = instance.GetDistance(start, end, solution);
-        distance += currentDistace;
-
-        CVRPInsertionInfo stopInfo = new CVRPInsertionInfo(start, end, spareCapacity);
-        tourInfo.AddStopInsertionInfo(stopInfo);
-      }
-
-      eval.Quality += instance.FleetUsageFactor.Value;
-      eval.Quality += instance.DistanceFactor.Value * distance;
-
-      eval.Distance += distance;
-      eval.VehicleUtilization += 1;
-
-      if (delivered > capacity) {
-        overweight = delivered - capacity;
-      }
-
-      (eval as CVRPEvaluation).Overload += overweight;
-      double penalty = overweight * cvrpInstance.OverloadPenalty.Value;
-      eval.Penalty += penalty;
-      eval.Quality += penalty;
-      tourInfo.Penalty = penalty;
-      tourInfo.Quality = eval.Quality - originalQuality;
-    }
-
-    protected override double GetTourInsertionCosts(IVRPProblemInstance instance, IVRPEncodedSolution solution, TourInsertionInfo tourInsertionInfo, int index, int customer,
-      out bool feasible) {
-      CVRPInsertionInfo insertionInfo = tourInsertionInfo.GetStopInsertionInfo(index) as CVRPInsertionInfo;
-
-      double costs = 0;
-      feasible = tourInsertionInfo.Penalty < double.Epsilon;
-
-      ICapacitatedProblemInstance cvrp = instance as ICapacitatedProblemInstance;
-      double overloadPenalty = cvrp.OverloadPenalty.Value;
-
-      double distance = instance.GetDistance(insertionInfo.Start, insertionInfo.End, solution);
-      double newDistance =
-        instance.GetDistance(insertionInfo.Start, customer, solution) +
-        instance.GetDistance(customer, insertionInfo.End, solution);
-      costs += instance.DistanceFactor.Value * (newDistance - distance);
-
-      double demand = instance.Demand[customer];
-      if (demand > insertionInfo.SpareCapacity) {
-        feasible = false;
-
-        if (insertionInfo.SpareCapacity >= 0)
-          costs += (demand - insertionInfo.SpareCapacity) * overloadPenalty;
-        else
-          costs += demand * overloadPenalty;
-      }
-
-      return costs;
-    }
-
-    protected override void InitResultParameters() {
-      base.InitResultParameters();
-
-      OverloadParameter.ActualValue = new DoubleValue(0);
-    }
-
-    protected override void SetResultParameters(VRPEvaluation tourEvaluation) {
-      base.SetResultParameters(tourEvaluation);
-
-      OverloadParameter.ActualValue.Value = (tourEvaluation as CVRPEvaluation).Overload;
-    }
-
-    [StorableConstructor]
-    protected CVRPEvaluator(StorableConstructorFlag _) : base(_) { }
-
-    public CVRPEvaluator() {
-      Parameters.Add(new LookupParameter<DoubleValue>("Overload", "The overload."));
-    }
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new CVRPEvaluator(this, cloner);
-    }
-
-    protected CVRPEvaluator(CVRPEvaluator original, Cloner cloner)
-      : base(original, cloner) {
-    }
-  }
-}
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPProblemInstance.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPProblemInstance.cs	(revision 17710)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPProblemInstance.cs	(revision 17711)
@@ -23,11 +23,9 @@
 using System.Collections.Generic;
 using System.Linq;
+using HEAL.Attic;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
 using HeuristicLab.Data;
-using HeuristicLab.Optimization;
 using HeuristicLab.Parameters;
-using HEAL.Attic;
-using HeuristicLab.PluginInfrastructure;
 using HeuristicLab.Problems.VehicleRouting.Interfaces;
 using HeuristicLab.Problems.VehicleRouting.Variants;
@@ -67,19 +65,94 @@
     }
 
-    protected override IEnumerable<IOperator> GetOperators() {
-      return base.GetOperators()
-        .Where(o => o is IHomogenousCapacitatedOperator).Cast<IOperator>();
-    }
-
-    protected override IEnumerable<IOperator> GetAnalyzers() {
-      return ApplicationManager.Manager.GetInstances<ICapacitatedOperator>()
-        .Where(o => o is IAnalyzer)
-        .Cast<IOperator>().Union(base.GetAnalyzers());
-    }
-
-    protected override IVRPEvaluator Evaluator {
-      get {
-        return new CVRPEvaluator();
-      }
+    public override IEnumerable<IOperator> FilterOperators(IEnumerable<IOperator> operators) {
+      return base.FilterOperators(operators).Where(x => x is IHomogenousCapacitatedOperator);
+    }
+    protected override VRPEvaluation CreateTourEvaluation() {
+      return new CVRPEvaluation();
+    }
+
+    protected override void EvaluateTour(VRPEvaluation eval, Tour tour, IVRPEncodedSolution solution) {
+      TourInsertionInfo tourInfo = new TourInsertionInfo(solution.GetVehicleAssignment(solution.GetTourIndex(tour))); ;
+      eval.InsertionInfo.AddTourInsertionInfo(tourInfo);
+      double originalQuality = eval.Quality;
+
+      double delivered = 0.0;
+      double overweight = 0.0;
+      double distance = 0.0;
+
+      double capacity = Capacity.Value;
+      for (int i = 0; i <= tour.Stops.Count; i++) {
+        int end = 0;
+        if (i < tour.Stops.Count)
+          end = tour.Stops[i];
+
+        delivered += Demand[end];
+      }
+
+      double spareCapacity = capacity - delivered;
+
+      //simulate a tour, start and end at depot
+      for (int i = 0; i <= tour.Stops.Count; i++) {
+        int start = 0;
+        if (i > 0)
+          start = tour.Stops[i - 1];
+        int end = 0;
+        if (i < tour.Stops.Count)
+          end = tour.Stops[i];
+
+        //drive there
+        double currentDistace = GetDistance(start, end, solution);
+        distance += currentDistace;
+
+        CVRPInsertionInfo stopInfo = new CVRPInsertionInfo(start, end, spareCapacity);
+        tourInfo.AddStopInsertionInfo(stopInfo);
+      }
+
+      eval.Quality += FleetUsageFactor.Value;
+      eval.Quality += DistanceFactor.Value * distance;
+
+      eval.Distance += distance;
+      eval.VehicleUtilization += 1;
+
+      if (delivered > capacity) {
+        overweight = delivered - capacity;
+      }
+
+      (eval as CVRPEvaluation).Overload += overweight;
+      double penalty = overweight * OverloadPenalty.Value;
+      eval.Penalty += penalty;
+      eval.Quality += penalty;
+      tourInfo.Penalty = penalty;
+      tourInfo.Quality = eval.Quality - originalQuality;
+
+      eval.IsFeasible = overweight == 0;
+    }
+
+    protected override double GetTourInsertionCosts(IVRPEncodedSolution solution, TourInsertionInfo tourInsertionInfo, int index, int customer,
+      out bool feasible) {
+      CVRPInsertionInfo insertionInfo = tourInsertionInfo.GetStopInsertionInfo(index) as CVRPInsertionInfo;
+
+      double costs = 0;
+      feasible = tourInsertionInfo.Penalty < double.Epsilon;
+
+      double overloadPenalty = OverloadPenalty.Value;
+
+      double distance = GetDistance(insertionInfo.Start, insertionInfo.End, solution);
+      double newDistance =
+        GetDistance(insertionInfo.Start, customer, solution) +
+        GetDistance(customer, insertionInfo.End, solution);
+      costs += DistanceFactor.Value * (newDistance - distance);
+
+      double demand = Demand[customer];
+      if (demand > insertionInfo.SpareCapacity) {
+        feasible = false;
+
+        if (insertionInfo.SpareCapacity >= 0)
+          costs += (demand - insertionInfo.SpareCapacity) * overloadPenalty;
+        else
+          costs += demand * overloadPenalty;
+      }
+
+      return costs;
     }
 
Index: anches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPTW/CVRPPDTW/CVRPPDTWEvaluator.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPTW/CVRPPDTW/CVRPPDTWEvaluator.cs	(revision 17710)
+++ 	(revision )
@@ -1,322 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 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 HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-using HeuristicLab.Parameters;
-using HEAL.Attic;
-using HeuristicLab.Problems.VehicleRouting.Interfaces;
-using HeuristicLab.Problems.VehicleRouting.Variants;
-
-namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances {
-  [Item("CVRPPDTWEvaluator", "Represents a single depot CVRPPDTW evaluator.")]
-  [StorableType("6324F32C-727E-4593-BB21-4625755F844A")]
-  public class CVRPPDTWEvaluator : CVRPTWEvaluator {
-    public ILookupParameter<IntValue> PickupViolationsParameter {
-      get { return (ILookupParameter<IntValue>)Parameters["PickupViolations"]; }
-    }
-
-    protected override VRPEvaluation CreateTourEvaluation() {
-      return new CVRPPDTWEvaluation();
-    }
-
-    protected override void EvaluateTour(VRPEvaluation eval, IVRPProblemInstance instance, Tour tour, IVRPEncodedSolution solution) {
-      TourInsertionInfo tourInfo = new TourInsertionInfo(solution.GetVehicleAssignment(solution.GetTourIndex(tour)));
-      eval.InsertionInfo.AddTourInsertionInfo(tourInfo);
-      double originalQuality = eval.Quality;
-
-      IHomogenousCapacitatedProblemInstance cvrpInstance = instance as IHomogenousCapacitatedProblemInstance;
-      DoubleArray demand = instance.Demand;
-
-      ITimeWindowedProblemInstance vrptw = instance as ITimeWindowedProblemInstance;
-      DoubleArray dueTime = vrptw.DueTime;
-      DoubleArray readyTime = vrptw.ReadyTime;
-      DoubleArray serviceTimes = vrptw.ServiceTime;
-
-      IPickupAndDeliveryProblemInstance pdp = instance as IPickupAndDeliveryProblemInstance;
-      IntArray pickupDeliveryLocation = pdp.PickupDeliveryLocation;
-
-      double capacity = cvrpInstance.Capacity.Value;
-
-      double time = 0.0;
-      double waitingTime = 0.0;
-      double serviceTime = 0.0;
-      double tardiness = 0.0;
-      double overweight = 0.0;
-      double distance = 0.0;
-
-      double currentLoad = 0.0;
-      Dictionary<int, bool> stops = new Dictionary<int, bool>();
-      int pickupViolations = 0;
-
-      double tourStartTime = readyTime[0];
-      time = tourStartTime;
-
-      //simulate a tour, start and end at depot
-      for (int i = 0; i <= tour.Stops.Count; i++) {
-        int start = 0;
-        if (i > 0)
-          start = tour.Stops[i - 1];
-        int end = 0;
-        if (i < tour.Stops.Count)
-          end = tour.Stops[i];
-
-        //drive there
-        double currentDistace = vrptw.GetDistance(start, end, solution);
-        time += currentDistace;
-        distance += currentDistace;
-
-        double arrivalTime = time;
-
-        //check if it was serviced on time
-        if (time > dueTime[end])
-          tardiness += time - dueTime[end];
-
-        //wait
-        double currentWaitingTime = 0.0;
-        if (time < readyTime[end])
-          currentWaitingTime = readyTime[end] - time;
-
-        double waitTime = readyTime[end] - time;
-
-        waitingTime += currentWaitingTime;
-        time += currentWaitingTime;
-
-        double spareTime = dueTime[end] - time;
-
-        //service
-        double currentServiceTime = serviceTimes[end];
-        serviceTime += currentServiceTime;
-        time += currentServiceTime;
-
-        //Pickup / deliver
-        double arrivalSpareCapacity = capacity - currentLoad;
-
-        bool validPickupDelivery =
-          validPickupDelivery =
-          ((demand[end] >= 0) ||
-           (stops.ContainsKey(pickupDeliveryLocation[end])));
-
-        if (validPickupDelivery) {
-          currentLoad += demand[end];
-        } else {
-          pickupViolations++;
-        }
-
-        if (currentLoad > capacity)
-          overweight += currentLoad - capacity;
-
-        double spareCapacity = capacity - currentLoad;
-        CVRPPDTWInsertionInfo stopInfo = new CVRPPDTWInsertionInfo(start, end, spareCapacity, tourStartTime,
-          arrivalTime, time, spareTime, waitTime, new List<int>(stops.Keys), arrivalSpareCapacity);
-        tourInfo.AddStopInsertionInfo(stopInfo);
-
-        stops.Add(end, true);
-      }
-
-      eval.Quality += instance.FleetUsageFactor.Value;
-      eval.Quality += instance.DistanceFactor.Value * distance;
-      eval.Distance += distance;
-      eval.VehicleUtilization += 1;
-
-      (eval as CVRPEvaluation).Overload += overweight;
-      double tourPenalty = 0;
-      double penalty = overweight * cvrpInstance.OverloadPenalty.Value;
-      eval.Penalty += penalty;
-      eval.Quality += penalty;
-      tourPenalty += penalty;
-
-      (eval as CVRPTWEvaluation).Tardiness += tardiness;
-      (eval as CVRPTWEvaluation).TravelTime += time;
-
-      penalty = tardiness * vrptw.TardinessPenalty.Value;
-      eval.Penalty += penalty;
-      eval.Quality += penalty;
-      tourPenalty += penalty;
-
-      (eval as CVRPPDTWEvaluation).PickupViolations += pickupViolations;
-      penalty = pickupViolations * pdp.PickupViolationPenalty.Value;
-      eval.Penalty += penalty;
-      tourPenalty += penalty;
-
-      eval.Quality += penalty;
-      eval.Quality += time * vrptw.TimeFactor.Value;
-      tourInfo.Penalty = tourPenalty;
-      tourInfo.Quality = eval.Quality - originalQuality;
-    }
-
-    protected override double GetTourInsertionCosts(IVRPProblemInstance instance, IVRPEncodedSolution solution, TourInsertionInfo tourInsertionInfo, int index, int customer,
-      out bool feasible) {
-      CVRPPDTWInsertionInfo insertionInfo = tourInsertionInfo.GetStopInsertionInfo(index) as CVRPPDTWInsertionInfo;
-
-      double costs = 0;
-      feasible = tourInsertionInfo.Penalty < double.Epsilon;
-      bool tourFeasible = true;
-
-      ICapacitatedProblemInstance cvrp = instance as ICapacitatedProblemInstance;
-      double overloadPenalty = cvrp.OverloadPenalty.Value;
-
-      ITimeWindowedProblemInstance vrptw = instance as ITimeWindowedProblemInstance;
-      DoubleArray dueTime = vrptw.DueTime;
-      DoubleArray readyTime = vrptw.ReadyTime;
-      DoubleArray serviceTimes = vrptw.ServiceTime;
-      double tardinessPenalty = vrptw.TardinessPenalty.Value;
-
-      IPickupAndDeliveryProblemInstance pdp = instance as IPickupAndDeliveryProblemInstance;
-      IntArray pickupDeliveryLocation = pdp.PickupDeliveryLocation;
-      double pickupPenalty = pdp.PickupViolationPenalty.Value;
-
-      double distance = instance.GetDistance(insertionInfo.Start, insertionInfo.End, solution);
-      double newDistance =
-        instance.GetDistance(insertionInfo.Start, customer, solution) +
-        instance.GetDistance(customer, insertionInfo.End, solution);
-      costs += instance.DistanceFactor.Value * (newDistance - distance);
-
-      double demand = instance.Demand[customer];
-      if (demand > insertionInfo.ArrivalSpareCapacity) {
-        tourFeasible = feasible = false;
-        if (insertionInfo.ArrivalSpareCapacity >= 0)
-          costs += (demand - insertionInfo.ArrivalSpareCapacity) * overloadPenalty;
-        else
-          costs += demand * overloadPenalty;
-      }
-      int destination = pickupDeliveryLocation[customer];
-
-      bool validPickup = true;
-      if (demand < 0 && !insertionInfo.Visited.Contains(destination)) {
-        tourFeasible = feasible = false;
-        validPickup = false;
-        costs += pickupPenalty;
-      }
-
-      double time = 0;
-      double tardiness = 0;
-
-      if (index > 0)
-        time = (tourInsertionInfo.GetStopInsertionInfo(index - 1) as CVRPTWInsertionInfo).LeaveTime;
-      else
-        time = insertionInfo.TourStartTime;
-
-      time += instance.GetDistance(insertionInfo.Start, customer, solution);
-      if (time > dueTime[customer]) {
-        tardiness += time - dueTime[customer];
-      }
-      if (time < readyTime[customer])
-        time += readyTime[customer] - time;
-      time += serviceTimes[customer];
-      time += instance.GetDistance(customer, insertionInfo.End, solution);
-
-      double additionalTime = time - (tourInsertionInfo.GetStopInsertionInfo(index) as CVRPTWInsertionInfo).ArrivalTime;
-      for (int i = index; i < tourInsertionInfo.GetStopCount(); i++) {
-        CVRPTWInsertionInfo nextStop = tourInsertionInfo.GetStopInsertionInfo(i) as CVRPTWInsertionInfo;
-
-        if (demand >= 0) {
-          if (nextStop.End == destination) {
-            demand = 0;
-            costs -= pickupPenalty;
-            if (tourInsertionInfo.Penalty == pickupPenalty && tourFeasible)
-              feasible = true;
-          } else if (nextStop.SpareCapacity < 0) {
-            costs += demand * overloadPenalty;
-          } else if (nextStop.SpareCapacity < demand) {
-            tourFeasible = feasible = false;
-            costs += (demand - nextStop.SpareCapacity) * overloadPenalty;
-          }
-        } else if (validPickup) {
-          if (nextStop.SpareCapacity < 0) {
-            costs += Math.Max(demand, nextStop.SpareCapacity) * overloadPenalty;
-          }
-        }
-
-        if (additionalTime < 0) {
-          //arrive earlier than before
-          //wait probably
-          if (nextStop.WaitingTime < 0) {
-            double wait = nextStop.WaitingTime - additionalTime;
-            if (wait > 0)
-              additionalTime += wait;
-          } else {
-            additionalTime = 0;
-          }
-
-          //check due date, decrease tardiness
-          if (nextStop.SpareTime < 0) {
-            costs += Math.Max(nextStop.SpareTime, additionalTime) * tardinessPenalty;
-          }
-        } else {
-          //arrive later than before, probably don't have to wait
-          if (nextStop.WaitingTime > 0) {
-            additionalTime -= Math.Min(additionalTime, nextStop.WaitingTime);
-          }
-
-          //check due date
-          if (nextStop.SpareTime > 0) {
-            double spare = nextStop.SpareTime - additionalTime;
-            if (spare < 0)
-              tardiness += -spare;
-          } else {
-            tardiness += additionalTime;
-          }
-        }
-      }
-
-      costs += additionalTime * vrptw.TimeFactor.Value;
-
-      if (tardiness > 0) {
-        tourFeasible = feasible = false;
-      }
-
-      costs += tardiness * tardinessPenalty;
-
-      return costs;
-    }
-
-    protected override void InitResultParameters() {
-      base.InitResultParameters();
-
-      PickupViolationsParameter.ActualValue = new IntValue(0);
-    }
-
-    protected override void SetResultParameters(VRPEvaluation tourEvaluation) {
-      base.SetResultParameters(tourEvaluation);
-
-      PickupViolationsParameter.ActualValue.Value = (tourEvaluation as CVRPPDTWEvaluation).PickupViolations;
-    }
-
-    [StorableConstructor]
-    protected CVRPPDTWEvaluator(StorableConstructorFlag _) : base(_) { }
-
-    public CVRPPDTWEvaluator() {
-      Parameters.Add(new LookupParameter<IntValue>("PickupViolations", "The number of pickup violations."));
-    }
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new CVRPPDTWEvaluator(this, cloner);
-    }
-
-    protected CVRPPDTWEvaluator(CVRPPDTWEvaluator original, Cloner cloner)
-      : base(original, cloner) {
-    }
-  }
-}
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPTW/CVRPPDTW/CVRPPDTWProblemInstance.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPTW/CVRPPDTW/CVRPPDTWProblemInstance.cs	(revision 17710)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPTW/CVRPPDTW/CVRPPDTWProblemInstance.cs	(revision 17711)
@@ -23,11 +23,9 @@
 using System.Collections.Generic;
 using System.Linq;
+using HEAL.Attic;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
 using HeuristicLab.Data;
-using HeuristicLab.Optimization;
 using HeuristicLab.Parameters;
-using HEAL.Attic;
-using HeuristicLab.PluginInfrastructure;
 using HeuristicLab.Problems.VehicleRouting.Interfaces;
 using HeuristicLab.Problems.VehicleRouting.Variants;
@@ -67,25 +65,247 @@
     }
 
-    protected override IEnumerable<IOperator> GetOperators() {
-      return
-        ApplicationManager.Manager.GetInstances<IPickupAndDeliveryOperator>()
-        .Where(o => !(o is IAnalyzer))
-        .Cast<IOperator>().Union(base.GetOperators());
-    }
-
-    protected override IEnumerable<IOperator> GetAnalyzers() {
-      return ApplicationManager.Manager.GetInstances<IPickupAndDeliveryOperator>()
-        .Where(o => o is IAnalyzer)
-        .Cast<IOperator>().Union(base.GetAnalyzers());
-    }
-
-    protected override IVRPEvaluator Evaluator {
-      get {
-        return new CVRPPDTWEvaluator();
-      }
-    }
-
     public int GetPickupDeliveryLocation(int city) {
       return PickupDeliveryLocation[city];
+    }
+
+    public override IEnumerable<IOperator> FilterOperators(IEnumerable<IOperator> operators) {
+      return base.FilterOperators(operators).Where(x => x is IPickupAndDeliveryOperator);
+    }
+
+    protected override VRPEvaluation CreateTourEvaluation() {
+      return new CVRPPDTWEvaluation();
+    }
+
+    protected override void EvaluateTour(VRPEvaluation eval, Tour tour, IVRPEncodedSolution solution) {
+      TourInsertionInfo tourInfo = new TourInsertionInfo(solution.GetVehicleAssignment(solution.GetTourIndex(tour)));
+      eval.InsertionInfo.AddTourInsertionInfo(tourInfo);
+      double originalQuality = eval.Quality;
+
+      double capacity = Capacity.Value;
+
+      double time = 0.0;
+      double waitingTime = 0.0;
+      double serviceTime = 0.0;
+      double tardiness = 0.0;
+      double overweight = 0.0;
+      double distance = 0.0;
+
+      double currentLoad = 0.0;
+      Dictionary<int, bool> stops = new Dictionary<int, bool>();
+      int pickupViolations = 0;
+
+      double tourStartTime = ReadyTime[0];
+      time = tourStartTime;
+
+      //simulate a tour, start and end at depot
+      for (int i = 0; i <= tour.Stops.Count; i++) {
+        int start = 0;
+        if (i > 0)
+          start = tour.Stops[i - 1];
+        int end = 0;
+        if (i < tour.Stops.Count)
+          end = tour.Stops[i];
+
+        //drive there
+        double currentDistace = GetDistance(start, end, solution);
+        time += currentDistace;
+        distance += currentDistace;
+
+        double arrivalTime = time;
+
+        //check if it was serviced on time
+        if (time > DueTime[end])
+          tardiness += time - DueTime[end];
+
+        //wait
+        double currentWaitingTime = 0.0;
+        if (time < ReadyTime[end])
+          currentWaitingTime = ReadyTime[end] - time;
+
+        double waitTime = ReadyTime[end] - time;
+
+        waitingTime += currentWaitingTime;
+        time += currentWaitingTime;
+
+        double spareTime = DueTime[end] - time;
+
+        //service
+        double currentServiceTime = ServiceTime[end];
+        serviceTime += currentServiceTime;
+        time += currentServiceTime;
+
+        //Pickup / deliver
+        double arrivalSpareCapacity = capacity - currentLoad;
+
+        bool validPickupDelivery =
+          validPickupDelivery =
+          ((Demand[end] >= 0) ||
+           (stops.ContainsKey(PickupDeliveryLocation[end])));
+
+        if (validPickupDelivery) {
+          currentLoad += Demand[end];
+        } else {
+          pickupViolations++;
+        }
+
+        if (currentLoad > capacity)
+          overweight += currentLoad - capacity;
+
+        double spareCapacity = capacity - currentLoad;
+        CVRPPDTWInsertionInfo stopInfo = new CVRPPDTWInsertionInfo(start, end, spareCapacity, tourStartTime,
+          arrivalTime, time, spareTime, waitTime, new List<int>(stops.Keys), arrivalSpareCapacity);
+        tourInfo.AddStopInsertionInfo(stopInfo);
+
+        stops.Add(end, true);
+      }
+
+      eval.Quality += FleetUsageFactor.Value;
+      eval.Quality += DistanceFactor.Value * distance;
+      eval.Distance += distance;
+      eval.VehicleUtilization += 1;
+
+      (eval as CVRPEvaluation).Overload += overweight;
+      double tourPenalty = 0;
+      double penalty = overweight * OverloadPenalty.Value;
+      eval.Penalty += penalty;
+      eval.Quality += penalty;
+      tourPenalty += penalty;
+
+      (eval as CVRPTWEvaluation).Tardiness += tardiness;
+      (eval as CVRPTWEvaluation).TravelTime += time;
+
+      penalty = tardiness * TardinessPenalty.Value;
+      eval.Penalty += penalty;
+      eval.Quality += penalty;
+      tourPenalty += penalty;
+
+      (eval as CVRPPDTWEvaluation).PickupViolations += pickupViolations;
+      penalty = pickupViolations * PickupViolationPenalty.Value;
+      eval.Penalty += penalty;
+      tourPenalty += penalty;
+
+      eval.Quality += penalty;
+      eval.Quality += time * TimeFactor.Value;
+      tourInfo.Penalty = tourPenalty;
+      tourInfo.Quality = eval.Quality - originalQuality;
+
+      eval.IsFeasible = overweight == 0 && tardiness == 0 && pickupViolations == 0;
+    }
+
+    protected override double GetTourInsertionCosts(IVRPEncodedSolution solution, TourInsertionInfo tourInsertionInfo, int index, int customer,
+      out bool feasible) {
+      CVRPPDTWInsertionInfo insertionInfo = tourInsertionInfo.GetStopInsertionInfo(index) as CVRPPDTWInsertionInfo;
+
+      double costs = 0;
+      feasible = tourInsertionInfo.Penalty < double.Epsilon;
+      bool tourFeasible = true;
+
+      double overloadPenalty = OverloadPenalty.Value;
+      double tardinessPenalty = TardinessPenalty.Value;
+      double pickupPenalty = PickupViolationPenalty.Value;
+
+      double distance = GetDistance(insertionInfo.Start, insertionInfo.End, solution);
+      double newDistance =
+        GetDistance(insertionInfo.Start, customer, solution) +
+        GetDistance(customer, insertionInfo.End, solution);
+      costs += DistanceFactor.Value * (newDistance - distance);
+
+      double demand = Demand[customer];
+      if (demand > insertionInfo.ArrivalSpareCapacity) {
+        tourFeasible = feasible = false;
+        if (insertionInfo.ArrivalSpareCapacity >= 0)
+          costs += (demand - insertionInfo.ArrivalSpareCapacity) * overloadPenalty;
+        else
+          costs += demand * overloadPenalty;
+      }
+      int destination = PickupDeliveryLocation[customer];
+
+      bool validPickup = true;
+      if (demand < 0 && !insertionInfo.Visited.Contains(destination)) {
+        tourFeasible = feasible = false;
+        validPickup = false;
+        costs += pickupPenalty;
+      }
+
+      double time = 0;
+      double tardiness = 0;
+
+      if (index > 0)
+        time = (tourInsertionInfo.GetStopInsertionInfo(index - 1) as CVRPTWInsertionInfo).LeaveTime;
+      else
+        time = insertionInfo.TourStartTime;
+
+      time += GetDistance(insertionInfo.Start, customer, solution);
+      if (time > DueTime[customer]) {
+        tardiness += time - DueTime[customer];
+      }
+      if (time < ReadyTime[customer])
+        time += ReadyTime[customer] - time;
+      time += ServiceTime[customer];
+      time += GetDistance(customer, insertionInfo.End, solution);
+
+      double additionalTime = time - (tourInsertionInfo.GetStopInsertionInfo(index) as CVRPTWInsertionInfo).ArrivalTime;
+      for (int i = index; i < tourInsertionInfo.GetStopCount(); i++) {
+        CVRPTWInsertionInfo nextStop = tourInsertionInfo.GetStopInsertionInfo(i) as CVRPTWInsertionInfo;
+
+        if (demand >= 0) {
+          if (nextStop.End == destination) {
+            demand = 0;
+            costs -= pickupPenalty;
+            if (tourInsertionInfo.Penalty == pickupPenalty && tourFeasible)
+              feasible = true;
+          } else if (nextStop.SpareCapacity < 0) {
+            costs += demand * overloadPenalty;
+          } else if (nextStop.SpareCapacity < demand) {
+            tourFeasible = feasible = false;
+            costs += (demand - nextStop.SpareCapacity) * overloadPenalty;
+          }
+        } else if (validPickup) {
+          if (nextStop.SpareCapacity < 0) {
+            costs += Math.Max(demand, nextStop.SpareCapacity) * overloadPenalty;
+          }
+        }
+
+        if (additionalTime < 0) {
+          //arrive earlier than before
+          //wait probably
+          if (nextStop.WaitingTime < 0) {
+            double wait = nextStop.WaitingTime - additionalTime;
+            if (wait > 0)
+              additionalTime += wait;
+          } else {
+            additionalTime = 0;
+          }
+
+          //check due date, decrease tardiness
+          if (nextStop.SpareTime < 0) {
+            costs += Math.Max(nextStop.SpareTime, additionalTime) * tardinessPenalty;
+          }
+        } else {
+          //arrive later than before, probably don't have to wait
+          if (nextStop.WaitingTime > 0) {
+            additionalTime -= Math.Min(additionalTime, nextStop.WaitingTime);
+          }
+
+          //check due date
+          if (nextStop.SpareTime > 0) {
+            double spare = nextStop.SpareTime - additionalTime;
+            if (spare < 0)
+              tardiness += -spare;
+          } else {
+            tardiness += additionalTime;
+          }
+        }
+      }
+
+      costs += additionalTime * TimeFactor.Value;
+
+      if (tardiness > 0) {
+        tourFeasible = feasible = false;
+      }
+
+      costs += tardiness * tardinessPenalty;
+
+      return costs;
     }
 
Index: anches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPTW/CVRPTWEvaluator.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPTW/CVRPTWEvaluator.cs	(revision 17710)
+++ 	(revision )
@@ -1,276 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 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 HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-using HeuristicLab.Parameters;
-using HEAL.Attic;
-using HeuristicLab.Problems.VehicleRouting.Interfaces;
-using HeuristicLab.Problems.VehicleRouting.Variants;
-
-namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances {
-  [Item("CVRPTWEvaluator", "Represents a single depot CVRPTW evaluator.")]
-  [StorableType("BB258008-7ECC-488A-BB2A-B38AE0023CFD")]
-  public class CVRPTWEvaluator : CVRPEvaluator {
-    public ILookupParameter<DoubleValue> TardinessParameter {
-      get { return (ILookupParameter<DoubleValue>)Parameters["Tardiness"]; }
-    }
-
-    public ILookupParameter<DoubleValue> TravelTimeParameter {
-      get { return (ILookupParameter<DoubleValue>)Parameters["TravelTime"]; }
-    }
-
-    protected override VRPEvaluation CreateTourEvaluation() {
-      return new CVRPTWEvaluation();
-    }
-
-    protected override void EvaluateTour(VRPEvaluation eval, IVRPProblemInstance instance, Tour tour, IVRPEncodedSolution solution) {
-      TourInsertionInfo tourInfo = new TourInsertionInfo(solution.GetVehicleAssignment(solution.GetTourIndex(tour)));
-      eval.InsertionInfo.AddTourInsertionInfo(tourInfo);
-      double originalQuality = eval.Quality;
-
-      IHomogenousCapacitatedProblemInstance cvrpInstance = instance as IHomogenousCapacitatedProblemInstance;
-      DoubleArray demand = instance.Demand;
-
-      ITimeWindowedProblemInstance vrptw = instance as ITimeWindowedProblemInstance;
-      DoubleArray dueTime = vrptw.DueTime;
-      DoubleArray readyTime = vrptw.ReadyTime;
-      DoubleArray serviceTimes = vrptw.ServiceTime;
-
-      double time = 0.0;
-      double waitingTime = 0.0;
-      double serviceTime = 0.0;
-      double tardiness = 0.0;
-      double delivered = 0.0;
-      double overweight = 0.0;
-      double distance = 0.0;
-
-      double capacity = cvrpInstance.Capacity.Value;
-      for (int i = 0; i <= tour.Stops.Count; i++) {
-        int end = 0;
-        if (i < tour.Stops.Count)
-          end = tour.Stops[i];
-
-        delivered += demand[end];
-      }
-
-      double spareCapacity = capacity - delivered;
-
-      double tourStartTime = readyTime[0];
-      time = tourStartTime;
-
-      //simulate a tour, start and end at depot
-      for (int i = 0; i <= tour.Stops.Count; i++) {
-        int start = 0;
-        if (i > 0)
-          start = tour.Stops[i - 1];
-        int end = 0;
-        if (i < tour.Stops.Count)
-          end = tour.Stops[i];
-
-        //drive there
-        double currentDistace = vrptw.GetDistance(start, end, solution);
-        time += currentDistace;
-        distance += currentDistace;
-
-        double arrivalTime = time;
-
-        //check if it was serviced on time
-        if (time > dueTime[end])
-          tardiness += time - dueTime[end];
-
-        //wait
-        double currentWaitingTime = 0.0;
-        if (time < readyTime[end])
-          currentWaitingTime = readyTime[end] - time;
-
-        double waitTime = readyTime[end] - time;
-
-        waitingTime += currentWaitingTime;
-        time += currentWaitingTime;
-
-        double spareTime = dueTime[end] - time;
-
-        //service
-        double currentServiceTime = serviceTimes[end];
-        serviceTime += currentServiceTime;
-        time += currentServiceTime;
-
-        CVRPTWInsertionInfo stopInfo = new CVRPTWInsertionInfo(start, end, spareCapacity, tourStartTime, arrivalTime, time, spareTime, waitTime);
-        tourInfo.AddStopInsertionInfo(stopInfo);
-      }
-
-      eval.Quality += instance.FleetUsageFactor.Value;
-      eval.Quality += instance.DistanceFactor.Value * distance;
-      eval.Distance += distance;
-      eval.VehicleUtilization += 1;
-
-      if (delivered > capacity) {
-        overweight = delivered - capacity;
-      }
-
-      (eval as CVRPEvaluation).Overload += overweight;
-      double tourPenalty = 0;
-      double penalty = overweight * cvrpInstance.OverloadPenalty.Value;
-      eval.Penalty += penalty;
-      eval.Quality += penalty;
-      tourPenalty += penalty;
-
-      (eval as CVRPTWEvaluation).Tardiness += tardiness;
-      (eval as CVRPTWEvaluation).TravelTime += time;
-
-      penalty = tardiness * vrptw.TardinessPenalty.Value;
-      eval.Penalty += penalty;
-      eval.Quality += penalty;
-      tourPenalty += penalty;
-      eval.Quality += time * vrptw.TimeFactor.Value;
-      tourInfo.Penalty = tourPenalty;
-      tourInfo.Quality = eval.Quality - originalQuality;
-    }
-
-    protected override double GetTourInsertionCosts(IVRPProblemInstance instance, IVRPEncodedSolution solution, TourInsertionInfo tourInsertionInfo, int index, int customer,
-      out bool feasible) {
-      CVRPTWInsertionInfo insertionInfo = tourInsertionInfo.GetStopInsertionInfo(index) as CVRPTWInsertionInfo;
-
-      double costs = 0;
-      feasible = tourInsertionInfo.Penalty < double.Epsilon;
-
-      ICapacitatedProblemInstance cvrp = instance as ICapacitatedProblemInstance;
-      double overloadPenalty = cvrp.OverloadPenalty.Value;
-
-      ITimeWindowedProblemInstance vrptw = instance as ITimeWindowedProblemInstance;
-      DoubleArray dueTime = vrptw.DueTime;
-      DoubleArray readyTime = vrptw.ReadyTime;
-      DoubleArray serviceTimes = vrptw.ServiceTime;
-      double tardinessPenalty = vrptw.TardinessPenalty.Value;
-
-      double distance = instance.GetDistance(insertionInfo.Start, insertionInfo.End, solution);
-      double newDistance =
-        instance.GetDistance(insertionInfo.Start, customer, solution) +
-        instance.GetDistance(customer, insertionInfo.End, solution);
-      costs += instance.DistanceFactor.Value * (newDistance - distance);
-
-      double demand = instance.Demand[customer];
-      if (demand > insertionInfo.SpareCapacity) {
-        feasible = false;
-        if (insertionInfo.SpareCapacity >= 0)
-          costs += (demand - insertionInfo.SpareCapacity) * overloadPenalty;
-        else
-          costs += demand * overloadPenalty;
-      }
-
-      double time = 0;
-      double tardiness = 0;
-
-      if (index > 0)
-        time = (tourInsertionInfo.GetStopInsertionInfo(index - 1) as CVRPTWInsertionInfo).LeaveTime;
-      else
-        time = insertionInfo.TourStartTime;
-
-      time += instance.GetDistance(insertionInfo.Start, customer, solution);
-      if (time > dueTime[customer]) {
-        tardiness += time - dueTime[customer];
-      }
-      if (time < readyTime[customer])
-        time += readyTime[customer] - time;
-      time += serviceTimes[customer];
-      time += instance.GetDistance(customer, insertionInfo.End, solution);
-
-      double additionalTime = time - (tourInsertionInfo.GetStopInsertionInfo(index) as CVRPTWInsertionInfo).ArrivalTime;
-      for (int i = index; i < tourInsertionInfo.GetStopCount(); i++) {
-        CVRPTWInsertionInfo nextStop = tourInsertionInfo.GetStopInsertionInfo(i) as CVRPTWInsertionInfo;
-
-        if (additionalTime < 0) {
-          //arrive earlier than before
-          //wait probably
-          if (nextStop.WaitingTime < 0) {
-            double wait = nextStop.WaitingTime - additionalTime;
-            if (wait > 0)
-              additionalTime += wait;
-          } else {
-            additionalTime = 0;
-          }
-
-          //check due date, decrease tardiness
-          if (nextStop.SpareTime < 0) {
-            costs += Math.Max(nextStop.SpareTime, additionalTime) * tardinessPenalty;
-          }
-        } else {
-          //arrive later than before, probably don't have to wait
-          if (nextStop.WaitingTime > 0) {
-            additionalTime -= Math.Min(additionalTime, nextStop.WaitingTime);
-          }
-
-          //check due date
-          if (nextStop.SpareTime > 0) {
-            double spare = nextStop.SpareTime - additionalTime;
-            if (spare < 0)
-              tardiness += -spare;
-          } else {
-            tardiness += additionalTime;
-          }
-        }
-      }
-
-      costs += additionalTime * vrptw.TimeFactor.Value;
-
-      if (tardiness > 0) {
-        feasible = false;
-      }
-
-      costs += tardiness * tardinessPenalty;
-
-      return costs;
-    }
-
-    protected override void InitResultParameters() {
-      base.InitResultParameters();
-
-      TardinessParameter.ActualValue = new DoubleValue(0);
-      TravelTimeParameter.ActualValue = new DoubleValue(0);
-    }
-
-    protected override void SetResultParameters(VRPEvaluation tourEvaluation) {
-      base.SetResultParameters(tourEvaluation);
-
-      TardinessParameter.ActualValue.Value = (tourEvaluation as CVRPTWEvaluation).Tardiness;
-      TravelTimeParameter.ActualValue.Value = (tourEvaluation as CVRPTWEvaluation).TravelTime;
-    }
-
-    [StorableConstructor]
-    protected CVRPTWEvaluator(StorableConstructorFlag _) : base(_) { }
-
-    public CVRPTWEvaluator() {
-      Parameters.Add(new LookupParameter<DoubleValue>("Tardiness", "The tardiness."));
-      Parameters.Add(new LookupParameter<DoubleValue>("TravelTime", "The travel time."));
-    }
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new CVRPTWEvaluator(this, cloner);
-    }
-
-    protected CVRPTWEvaluator(CVRPTWEvaluator original, Cloner cloner)
-      : base(original, cloner) {
-    }
-  }
-}
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPTW/CVRPTWProblemInstance.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPTW/CVRPTWProblemInstance.cs	(revision 17710)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPTW/CVRPTWProblemInstance.cs	(revision 17711)
@@ -23,11 +23,9 @@
 using System.Collections.Generic;
 using System.Linq;
+using HEAL.Attic;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
 using HeuristicLab.Data;
-using HeuristicLab.Optimization;
 using HeuristicLab.Parameters;
-using HEAL.Attic;
-using HeuristicLab.PluginInfrastructure;
 using HeuristicLab.Problems.VehicleRouting.Interfaces;
 using HeuristicLab.Problems.VehicleRouting.Variants;
@@ -89,19 +87,198 @@
     }
 
-    protected override IEnumerable<IOperator> GetOperators() {
-      return base.GetOperators()
-        .Where(o => o is ITimeWindowedOperator).Cast<IOperator>();
-    }
-
-    protected override IEnumerable<IOperator> GetAnalyzers() {
-      return ApplicationManager.Manager.GetInstances<ITimeWindowedOperator>()
-        .Where(o => o is IAnalyzer)
-        .Cast<IOperator>().Union(base.GetAnalyzers());
-    }
-
-    protected override IVRPEvaluator Evaluator {
-      get {
-        return new CVRPTWEvaluator();
-      }
+    public override IEnumerable<IOperator> FilterOperators(IEnumerable<IOperator> operators) {
+      return base.FilterOperators(operators).Where(x => x is ITimeWindowedOperator);
+    }
+
+    protected override VRPEvaluation CreateTourEvaluation() {
+      return new CVRPTWEvaluation();
+    }
+
+    protected override void EvaluateTour(VRPEvaluation eval, Tour tour, IVRPEncodedSolution solution) {
+      TourInsertionInfo tourInfo = new TourInsertionInfo(solution.GetVehicleAssignment(solution.GetTourIndex(tour)));
+      eval.InsertionInfo.AddTourInsertionInfo(tourInfo);
+      double originalQuality = eval.Quality;
+
+      double time = 0.0;
+      double waitingTime = 0.0;
+      double serviceTime = 0.0;
+      double tardiness = 0.0;
+      double delivered = 0.0;
+      double overweight = 0.0;
+      double distance = 0.0;
+
+      double capacity = Capacity.Value;
+      for (int i = 0; i <= tour.Stops.Count; i++) {
+        int end = 0;
+        if (i < tour.Stops.Count)
+          end = tour.Stops[i];
+
+        delivered += Demand[end];
+      }
+
+      double spareCapacity = capacity - delivered;
+
+      double tourStartTime = ReadyTime[0];
+      time = tourStartTime;
+
+      //simulate a tour, start and end at depot
+      for (int i = 0; i <= tour.Stops.Count; i++) {
+        int start = 0;
+        if (i > 0)
+          start = tour.Stops[i - 1];
+        int end = 0;
+        if (i < tour.Stops.Count)
+          end = tour.Stops[i];
+
+        //drive there
+        double currentDistace = GetDistance(start, end, solution);
+        time += currentDistace;
+        distance += currentDistace;
+
+        double arrivalTime = time;
+
+        //check if it was serviced on time
+        if (time > DueTime[end]) {
+          tardiness += time - DueTime[end];
+        }
+
+        //wait
+        double currentWaitingTime = 0.0;
+        if (time < ReadyTime[end])
+          currentWaitingTime = ReadyTime[end] - time;
+
+        double waitTime = ReadyTime[end] - time;
+
+        waitingTime += currentWaitingTime;
+        time += currentWaitingTime;
+
+        double spareTime = DueTime[end] - time;
+
+        //service
+        double currentServiceTime = ServiceTime[end];
+        serviceTime += currentServiceTime;
+        time += currentServiceTime;
+
+        CVRPTWInsertionInfo stopInfo = new CVRPTWInsertionInfo(start, end, spareCapacity, tourStartTime, arrivalTime, time, spareTime, waitTime);
+        tourInfo.AddStopInsertionInfo(stopInfo);
+      }
+
+      eval.Quality += FleetUsageFactor.Value;
+      eval.Quality += DistanceFactor.Value * distance;
+      eval.Distance += distance;
+      eval.VehicleUtilization += 1;
+
+      if (delivered > capacity) {
+        overweight = delivered - capacity;
+      }
+
+      (eval as CVRPEvaluation).Overload += overweight;
+      double tourPenalty = 0;
+      double penalty = overweight * OverloadPenalty.Value;
+      eval.Penalty += penalty;
+      eval.Quality += penalty;
+      tourPenalty += penalty;
+
+      (eval as CVRPTWEvaluation).Tardiness += tardiness;
+      (eval as CVRPTWEvaluation).TravelTime += time;
+
+      penalty = tardiness * TardinessPenalty.Value;
+      eval.Penalty += penalty;
+      eval.Quality += penalty;
+      tourPenalty += penalty;
+      eval.Quality += time * TimeFactor.Value;
+      tourInfo.Penalty = tourPenalty;
+      tourInfo.Quality = eval.Quality - originalQuality;
+
+      eval.IsFeasible = overweight == 0 && tardiness == 0;
+    }
+
+    protected override double GetTourInsertionCosts(IVRPEncodedSolution solution, TourInsertionInfo tourInsertionInfo, int index, int customer,
+      out bool feasible) {
+      CVRPTWInsertionInfo insertionInfo = tourInsertionInfo.GetStopInsertionInfo(index) as CVRPTWInsertionInfo;
+
+      double costs = 0;
+      feasible = tourInsertionInfo.Penalty < double.Epsilon;
+
+      double overloadPenalty = OverloadPenalty.Value;
+      double tardinessPenalty = TardinessPenalty.Value;
+
+      double distance = GetDistance(insertionInfo.Start, insertionInfo.End, solution);
+      double newDistance =
+        GetDistance(insertionInfo.Start, customer, solution) +
+        GetDistance(customer, insertionInfo.End, solution);
+      costs += DistanceFactor.Value * (newDistance - distance);
+
+      double demand = Demand[customer];
+      if (demand > insertionInfo.SpareCapacity) {
+        feasible = false;
+        if (insertionInfo.SpareCapacity >= 0)
+          costs += (demand - insertionInfo.SpareCapacity) * overloadPenalty;
+        else
+          costs += demand * overloadPenalty;
+      }
+
+      double time = 0;
+      double tardiness = 0;
+
+      if (index > 0)
+        time = (tourInsertionInfo.GetStopInsertionInfo(index - 1) as CVRPTWInsertionInfo).LeaveTime;
+      else
+        time = insertionInfo.TourStartTime;
+
+      time += GetDistance(insertionInfo.Start, customer, solution);
+      if (time > DueTime[customer]) {
+        tardiness += time - DueTime[customer];
+      }
+      if (time < ReadyTime[customer])
+        time += ReadyTime[customer] - time;
+      time += ServiceTime[customer];
+      time += GetDistance(customer, insertionInfo.End, solution);
+
+      double additionalTime = time - (tourInsertionInfo.GetStopInsertionInfo(index) as CVRPTWInsertionInfo).ArrivalTime;
+      for (int i = index; i < tourInsertionInfo.GetStopCount(); i++) {
+        CVRPTWInsertionInfo nextStop = tourInsertionInfo.GetStopInsertionInfo(i) as CVRPTWInsertionInfo;
+
+        if (additionalTime < 0) {
+          //arrive earlier than before
+          //wait probably
+          if (nextStop.WaitingTime < 0) {
+            double wait = nextStop.WaitingTime - additionalTime;
+            if (wait > 0)
+              additionalTime += wait;
+          } else {
+            additionalTime = 0;
+          }
+
+          //check due date, decrease tardiness
+          if (nextStop.SpareTime < 0) {
+            costs += Math.Max(nextStop.SpareTime, additionalTime) * tardinessPenalty;
+          }
+        } else {
+          //arrive later than before, probably don't have to wait
+          if (nextStop.WaitingTime > 0) {
+            additionalTime -= Math.Min(additionalTime, nextStop.WaitingTime);
+          }
+
+          //check due date
+          if (nextStop.SpareTime > 0) {
+            double spare = nextStop.SpareTime - additionalTime;
+            if (spare < 0)
+              tardiness += -spare;
+          } else {
+            tardiness += additionalTime;
+          }
+        }
+      }
+
+      costs += additionalTime * TimeFactor.Value;
+
+      if (tardiness > 0) {
+        feasible = false;
+      }
+
+      costs += tardiness * tardinessPenalty;
+
+      return costs;
     }
 
Index: anches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/SingleDepotVRPEvaluator.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/SingleDepotVRPEvaluator.cs	(revision 17710)
+++ 	(revision )
@@ -1,99 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 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 HeuristicLab.Common;
-using HeuristicLab.Core;
-using HEAL.Attic;
-using HeuristicLab.Problems.VehicleRouting.Interfaces;
-
-
-namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances {
-  [Item("SingleDepotVRPEvaluator", "Represents a single depot VRP evaluator.")]
-  [StorableType("1E0DECD9-54BF-4F69-A743-228C481749A0")]
-  public class SingleDepotVRPEvaluator : VRPEvaluator {
-    protected override void EvaluateTour(VRPEvaluation eval, IVRPProblemInstance instance, Tour tour, IVRPEncodedSolution solution) {
-      TourInsertionInfo tourInfo = new TourInsertionInfo(solution.GetVehicleAssignment(solution.GetTourIndex(tour)));
-      eval.InsertionInfo.AddTourInsertionInfo(tourInfo);
-
-      double distance = 0.0;
-      double quality = 0.0;
-
-      //simulate a tour, start and end at depot
-      for (int i = 0; i <= tour.Stops.Count; i++) {
-        int start = 0;
-        if (i > 0)
-          start = tour.Stops[i - 1];
-        int end = 0;
-        if (i < tour.Stops.Count)
-          end = tour.Stops[i];
-
-        //drive there
-        double currentDistace = instance.GetDistance(start, end, solution);
-        distance += currentDistace;
-
-        StopInsertionInfo stopInfo = new StopInsertionInfo(start, end);
-        tourInfo.AddStopInsertionInfo(stopInfo);
-      }
-
-      //Fleet usage
-      quality += instance.FleetUsageFactor.Value;
-      //Distance
-      quality += instance.DistanceFactor.Value * distance;
-
-      eval.Distance += distance;
-      eval.VehicleUtilization += 1;
-
-      tourInfo.Quality = quality;
-      eval.Quality += quality;
-    }
-
-    protected override double GetTourInsertionCosts(IVRPProblemInstance instance, IVRPEncodedSolution solution, TourInsertionInfo tourInsertionInfo, int index, int customer,
-      out bool feasible) {
-      StopInsertionInfo insertionInfo = tourInsertionInfo.GetStopInsertionInfo(index);
-
-      double costs = 0;
-      feasible = true;
-
-      double distance = instance.GetDistance(insertionInfo.Start, insertionInfo.End, solution);
-      double newDistance =
-        instance.GetDistance(insertionInfo.Start, customer, solution) +
-        instance.GetDistance(customer, insertionInfo.End, solution);
-
-      costs += instance.DistanceFactor.Value * (newDistance - distance);
-
-      return costs;
-    }
-
-    [StorableConstructor]
-    protected SingleDepotVRPEvaluator(StorableConstructorFlag _) : base(_) { }
-
-    public SingleDepotVRPEvaluator() {
-    }
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new SingleDepotVRPEvaluator(this, cloner);
-    }
-
-    protected SingleDepotVRPEvaluator(SingleDepotVRPEvaluator original, Cloner cloner)
-      : base(original, cloner) {
-    }
-  }
-}
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/SingleDepotVRPProblemInstance.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/SingleDepotVRPProblemInstance.cs	(revision 17710)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/SingleDepotVRPProblemInstance.cs	(revision 17711)
@@ -26,6 +26,4 @@
 using HeuristicLab.Core;
 using HeuristicLab.Data;
-using HeuristicLab.Optimization;
-using HeuristicLab.PluginInfrastructure;
 using HeuristicLab.Problems.VehicleRouting.Interfaces;
 using HeuristicLab.Problems.VehicleRouting.Variants;
@@ -35,12 +33,7 @@
   [StorableType("A45435DD-F615-45C6-8456-5A49EE5D3C8E")]
   public class SingleDepotVRPProblemInstance : VRPProblemInstance, ISingleDepotProblemInstance {
-    protected override IEnumerable<IOperator> GetOperators() {
-      return ApplicationManager.Manager.GetInstances<ISingleDepotOperator>().Cast<IOperator>();
-    }
 
-    protected override IEnumerable<IOperator> GetAnalyzers() {
-      return ApplicationManager.Manager.GetInstances<ISingleDepotOperator>()
-        .Where(o => o is IAnalyzer)
-        .Cast<IOperator>();
+    public override IEnumerable<IOperator> FilterOperators(IEnumerable<IOperator> operators) {
+      return base.FilterOperators(operators).Where(x => x is ISingleDepotOperator);
     }
 
@@ -50,16 +43,57 @@
       }
     }
+    protected override void EvaluateTour(VRPEvaluation eval, Tour tour, IVRPEncodedSolution solution) {
+      TourInsertionInfo tourInfo = new TourInsertionInfo(solution.GetVehicleAssignment(solution.GetTourIndex(tour)));
+      eval.InsertionInfo.AddTourInsertionInfo(tourInfo);
 
-    protected override IVRPEvaluator Evaluator {
-      get {
-        return new SingleDepotVRPEvaluator();
+      double distance = 0.0;
+      double quality = 0.0;
+
+      //simulate a tour, start and end at depot
+      for (int i = 0; i <= tour.Stops.Count; i++) {
+        int start = 0;
+        if (i > 0)
+          start = tour.Stops[i - 1];
+        int end = 0;
+        if (i < tour.Stops.Count)
+          end = tour.Stops[i];
+
+        //drive there
+        double currentDistace = GetDistance(start, end, solution);
+        distance += currentDistace;
+
+        StopInsertionInfo stopInfo = new StopInsertionInfo(start, end);
+        tourInfo.AddStopInsertionInfo(stopInfo);
       }
+
+      //Fleet usage
+      quality += FleetUsageFactor.Value;
+      //Distance
+      quality += DistanceFactor.Value * distance;
+
+      eval.Distance += distance;
+      eval.VehicleUtilization += 1;
+
+      tourInfo.Quality = quality;
+      eval.Quality += quality;
     }
 
-    protected override IVRPCreator Creator {
-      get {
-        return new HeuristicLab.Problems.VehicleRouting.Encodings.Alba.RandomCreator();
-      }
+    protected override double GetTourInsertionCosts(IVRPEncodedSolution solution, TourInsertionInfo tourInsertionInfo, int index, int customer,
+      out bool feasible) {
+      StopInsertionInfo insertionInfo = tourInsertionInfo.GetStopInsertionInfo(index);
+
+      double costs = 0;
+      feasible = true;
+
+      double distance = GetDistance(insertionInfo.Start, insertionInfo.End, solution);
+      double newDistance =
+        GetDistance(insertionInfo.Start, customer, solution) +
+        GetDistance(customer, insertionInfo.End, solution);
+
+      costs += DistanceFactor.Value * (newDistance - distance);
+
+      return costs;
     }
+
 
     [StorableConstructor]
Index: anches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/VRPEvaluator.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/VRPEvaluator.cs	(revision 17710)
+++ 	(revision )
@@ -1,147 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 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 HEAL.Attic;
-using HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-using HeuristicLab.Parameters;
-using HeuristicLab.Problems.VehicleRouting.Encodings;
-using HeuristicLab.Problems.VehicleRouting.Interfaces;
-
-namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances {
-  [Item("VRPEvaluator", "Represents a VRP evaluator.")]
-  [StorableType("164315D4-BCCF-4A79-B75B-11A49C56C5E1")]
-  public abstract class VRPEvaluator : VRPOperator, IVRPEvaluator {
-    public ILookupParameter<IVRPEncodedSolution> VRPToursParameter {
-      get { return (ILookupParameter<IVRPEncodedSolution>)Parameters["VRPTours"]; }
-    }
-
-    #region ISingleObjectiveEvaluator Members
-    public ILookupParameter<DoubleValue> QualityParameter {
-      get { return (ILookupParameter<DoubleValue>)Parameters["Quality"]; }
-    }
-    #endregion
-
-    public ILookupParameter<DoubleValue> DistanceParameter {
-      get { return (ILookupParameter<DoubleValue>)Parameters["Distance"]; }
-    }
-    public ILookupParameter<DoubleValue> VehcilesUtilizedParameter {
-      get { return (ILookupParameter<DoubleValue>)Parameters["VehiclesUtilized"]; }
-    }
-
-    public ILookupParameter<DoubleValue> PenaltyParameter {
-      get { return (ILookupParameter<DoubleValue>)Parameters["Penalty"]; }
-    }
-
-    [StorableConstructor]
-    protected VRPEvaluator(StorableConstructorFlag _) : base(_) { }
-
-    public VRPEvaluator() {
-      Parameters.Add(new LookupParameter<IVRPEncodedSolution>("VRPTours", "The VRP tours which should be evaluated."));
-
-      Parameters.Add(new LookupParameter<DoubleValue>("Quality", "The evaluated quality of the VRP solution."));
-      Parameters.Add(new LookupParameter<DoubleValue>("Distance", "The distance."));
-      Parameters.Add(new LookupParameter<DoubleValue>("VehiclesUtilized", "The number of vehicles utilized."));
-
-      Parameters.Add(new LookupParameter<DoubleValue>("Penalty", "The applied penalty."));
-    }
-
-    protected VRPEvaluator(VRPEvaluator original, Cloner cloner)
-      : base(original, cloner) {
-    }
-
-    protected virtual VRPEvaluation CreateTourEvaluation() {
-      return new VRPEvaluation();
-    }
-
-    protected abstract void EvaluateTour(VRPEvaluation eval, IVRPProblemInstance instance, Tour tour, IVRPEncodedSolution solution);
-
-    protected virtual void InitResultParameters() {
-      QualityParameter.ActualValue = new DoubleValue(0);
-      VehcilesUtilizedParameter.ActualValue = new DoubleValue(0);
-      DistanceParameter.ActualValue = new DoubleValue(0);
-      PenaltyParameter.ActualValue = new DoubleValue(0);
-    }
-
-    protected virtual void SetResultParameters(VRPEvaluation tourEvaluation) {
-      QualityParameter.ActualValue.Value = tourEvaluation.Quality;
-      VehcilesUtilizedParameter.ActualValue.Value = tourEvaluation.VehicleUtilization;
-      DistanceParameter.ActualValue.Value = tourEvaluation.Distance;
-      PenaltyParameter.ActualValue.Value = tourEvaluation.Penalty;
-    }
-
-    #region IVRPEvaluator Members
-
-    public bool Feasible(VRPEvaluation evaluation) {
-      return evaluation.Penalty < double.Epsilon;
-    }
-
-    protected abstract double GetTourInsertionCosts(IVRPProblemInstance instance, IVRPEncodedSolution solution, TourInsertionInfo tourInsertionInfo, int index, int customer, out bool feasible);
-
-    public double GetInsertionCosts(IVRPProblemInstance instance, IVRPEncodedSolution solution, VRPEvaluation eval, int customer, int tour, int index, out bool feasible) {
-      bool tourFeasible;
-      double costs = GetTourInsertionCosts(
-        instance,
-        solution,
-        eval.InsertionInfo.GetTourInsertionInfo(tour),
-        index,
-        customer, out tourFeasible);
-
-      feasible = tourFeasible;
-
-      return costs;
-    }
-
-    public VRPEvaluation EvaluateTour(IVRPProblemInstance instance, Tour tour, IVRPEncodedSolution solution) {
-      VRPEvaluation evaluation = CreateTourEvaluation();
-      EvaluateTour(evaluation, instance, tour, solution);
-      return evaluation;
-    }
-
-    public virtual VRPEvaluation Evaluate(IVRPProblemInstance instance, IVRPEncodedSolution solution) {
-      VRPEvaluation evaluation = CreateTourEvaluation();
-
-      foreach (Tour tour in solution.GetTours()) {
-        EvaluateTour(evaluation, instance, tour, solution);
-      }
-      evaluation.IsFeasible = Feasible(evaluation);
-      return evaluation;
-    }
-
-    public override IOperation InstrumentedApply() {
-      InitResultParameters();
-
-      VRPEvaluation evaluation = CreateTourEvaluation();
-      IVRPEncodedSolution solution = VRPToursParameter.ActualValue;
-      foreach (Tour tour in solution.GetTours()) {
-        EvaluateTour(evaluation, ProblemInstance, tour, solution);
-      }
-      SetResultParameters(evaluation);
-
-      QualityParameter.ActualValue = new DoubleValue(evaluation.Quality);
-
-      return base.InstrumentedApply();
-    }
-
-    #endregion
-  }
-}
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/VRPProblemInstance.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/VRPProblemInstance.cs	(revision 17710)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/VRPProblemInstance.cs	(revision 17711)
@@ -28,5 +28,4 @@
 using HeuristicLab.Data;
 using HeuristicLab.Parameters;
-using HeuristicLab.Problems.VehicleRouting.Encodings.General;
 using HeuristicLab.Problems.VehicleRouting.Interfaces;
 
@@ -35,42 +34,4 @@
   [StorableType("9A6CCE89-A4B6-4FA3-A150-181FC315B713")]
   public abstract class VRPProblemInstance : ParameterizedNamedItem, IVRPProblemInstance, IStatefulItem {
-    IVRPEvaluator moveEvaluator;
-
-    private object locker = new object();
-
-    public IVRPEvaluator MoveEvaluator {
-      get {
-        lock (locker) {
-          if (evaluator == null)
-            return null;
-          else {
-            if (moveEvaluator == null) {
-              moveEvaluator = evaluator.Clone() as IVRPEvaluator;
-
-              foreach (IParameter parameter in moveEvaluator.Parameters) {
-                if (parameter is ILookupParameter
-                  && parameter != moveEvaluator.ProblemInstanceParameter
-                  && parameter != moveEvaluator.VRPToursParameter) {
-                  (parameter as ILookupParameter).ActualName =
-                    VRPMoveEvaluator.MovePrefix +
-                    (parameter as ILookupParameter).ActualName;
-                }
-              }
-            }
-
-            return moveEvaluator;
-          }
-        }
-      }
-    }
-
-    protected abstract IEnumerable<IOperator> GetOperators();
-    protected abstract IEnumerable<IOperator> GetAnalyzers();
-
-    public IEnumerable<IOperator> Operators {
-      get {
-        return GetOperators().Union(GetAnalyzers());
-      }
-    }
 
     protected ValueParameter<DoubleMatrix> CoordinatesParameter {
@@ -131,8 +92,10 @@
     }
 
+    public virtual IEnumerable<IOperator> FilterOperators(IEnumerable<IOperator> operators) {
+      return operators.Where(x => x is IVRPOperator);
+    }
+
     protected virtual double CalculateDistance(int start, int end) {
-      double distance = 0.0;
-
-      distance =
+      var distance =
           Math.Sqrt(
             Math.Pow(Coordinates[start, 0] - Coordinates[end, 0], 2) +
@@ -172,18 +135,5 @@
     //cache for performance improvement
     private DoubleMatrix distanceMatrix = null;
-    private IVRPEvaluator evaluator = null;
-
-    public IVRPEvaluator SolutionEvaluator {
-      get {
-        return evaluator;
-      }
-      set {
-        lock (locker) {
-          moveEvaluator = null;
-          evaluator = value;
-          EvalBestKnownSolution();
-        }
-      }
-    }
+    
 
     public virtual double GetDistance(int start, int end, IVRPEncodedSolution solution) {
@@ -208,31 +158,39 @@
     }
 
-    public bool Feasible(IVRPEncodedSolution solution) {
-      return evaluator.Feasible(
-        evaluator.Evaluate(
-          this, solution));
-    }
-
-    public bool TourFeasible(Tour tour, IVRPEncodedSolution solution) {
-      return evaluator.Feasible(
-        evaluator.EvaluateTour(
-        this, tour, solution));
+    protected virtual VRPEvaluation CreateTourEvaluation() {
+      return new VRPEvaluation();
     }
 
     public VRPEvaluation Evaluate(IVRPEncodedSolution solution) {
-      return evaluator.Evaluate(this, solution);
+      VRPEvaluation evaluation = CreateTourEvaluation();
+      evaluation.IsFeasible = true;
+      foreach (Tour tour in solution.GetTours()) {
+        EvaluateTour(evaluation, tour, solution);
+      }
+      return evaluation;
     }
 
     public VRPEvaluation EvaluateTour(Tour tour, IVRPEncodedSolution solution) {
-      return evaluator.EvaluateTour(this, tour, solution);
-    }
-
-    public bool Feasible(VRPEvaluation eval) {
-      return evaluator.Feasible(eval);
+      VRPEvaluation evaluation = CreateTourEvaluation();
+      evaluation.IsFeasible = true;
+      EvaluateTour(evaluation, tour, solution);
+      return evaluation;
     }
 
     public double GetInsertionCosts(VRPEvaluation eval, IVRPEncodedSolution solution, int customer, int tour, int index, out bool feasible) {
-      return evaluator.GetInsertionCosts(this, solution, eval, customer, tour, index, out feasible);
-    }
+      bool tourFeasible;
+      double costs = GetTourInsertionCosts(
+        solution,
+        eval.InsertionInfo.GetTourInsertionInfo(tour),
+        index,
+        customer, out tourFeasible);
+
+      feasible = tourFeasible;
+
+      return costs;
+    }
+    protected abstract double GetTourInsertionCosts(IVRPEncodedSolution solution, TourInsertionInfo tourInsertionInfo, int index, int customer, out bool feasible);
+
+    protected abstract void EvaluateTour(VRPEvaluation eval, Tour tour, IVRPEncodedSolution solution);
 
 
@@ -241,10 +199,6 @@
     protected void EvalBestKnownSolution() {
       EventHandler tmp = EvaluationChanged;
-      if (tmp != null)
-        tmp(this, null);
-    }
-
-    protected abstract IVRPEvaluator Evaluator { get; }
-    protected abstract IVRPCreator Creator { get; }
+      if (tmp != null) tmp(this, null);
+    }
 
     [StorableConstructor]
@@ -262,5 +216,4 @@
       Parameters.Add(new ValueParameter<DoubleValue>("EvalDistanceFactor", "The distance factor considered in the evaluation.", new DoubleValue(1)));
 
-      evaluator = Evaluator;
       AttachEventHandlers();
     }
@@ -268,5 +221,4 @@
     protected VRPProblemInstance(VRPProblemInstance original, Cloner cloner)
       : base(original, cloner) {
-      evaluator = Evaluator;
       AttachEventHandlers();
     }
@@ -274,5 +226,4 @@
     [StorableHook(HookType.AfterDeserialization)]
     private void AfterDeserialization() {
-      evaluator = Evaluator;
       AttachEventHandlers();
     }
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/VehicleRoutingProblem.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/VehicleRoutingProblem.cs	(revision 17710)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/VehicleRoutingProblem.cs	(revision 17711)
@@ -75,4 +75,6 @@
     public VehicleRoutingProblem()
       : base(new PotvinEncoding()) {
+      EncodingParameter.Hidden = false;
+
       Parameters.Add(new ValueParameter<IVRPProblemInstance>("ProblemInstance", "The VRP problem instance"));
       Parameters.Add(new OptionalValueParameter<VRPSolution>("BestKnownSolution", "The best known solution of this VRP instance."));
@@ -211,4 +213,6 @@
 
     private void InitializeOperators() {
+      Encoding.FilterOperators(ProblemInstance);
+
       Operators.Add(new VRPSimilarityCalculator());
       Operators.Add(new QualitySimilarityCalculator());
