Index: branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Evaluators/MetaOptimizationEvaluator.cs
===================================================================
--- branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Evaluators/MetaOptimizationEvaluator.cs	(revision 4539)
+++ branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Evaluators/MetaOptimizationEvaluator.cs	(revision 4830)
@@ -10,4 +10,5 @@
 using HeuristicLab.Optimization;
 using System.Threading;
+using HeuristicLab.Common;
 
 namespace HeuristicLab.Problems.MetaOptimization {
@@ -18,4 +19,6 @@
   [StorableClass]
   public class MetaOptimizationEvaluator : SingleSuccessorOperator, IMetaOptimizationEvaluator {
+    private const string RepetitionsParameterName = "Repetitions";
+
     private bool algorithmStopped;
 
@@ -23,30 +26,62 @@
       get { return (ILookupParameter<DoubleValue>)Parameters["Quality"]; }
     }
-
     public ILookupParameter<IAlgorithm> AlgorithmParameter {
       get { return (ILookupParameter<IAlgorithm>)Parameters["Algorithm"]; }
     }
-    public ILookupParameter<IParameterSet> ParameterSetParameter {
-      get { return (ILookupParameter<IParameterSet>)Parameters["ParameterSet"]; }
+    public ILookupParameter<IItemList<IProblem>> ProblemsParameter {
+      get { return (ILookupParameter<IItemList<IProblem>>)Parameters["Problems"]; }
+    }
+    public ILookupParameter<IParameterConfiguration> ParameterConfigurationParameter {
+      get { return (ILookupParameter<IParameterConfiguration>)Parameters["ParameterConfiguration"]; }
+    }
+    public ValueParameter<IntValue> RepetitionsParameter {
+      get { return (ValueParameter<IntValue>)Parameters[RepetitionsParameterName]; }
     }
 
-    public MetaOptimizationEvaluator()
-      : base() {
-      Parameters.Add(new LookupParameter<DoubleValue>("Quality", "The evaluated quality of the TSP solution."));
+    public IntValue Repetitions {
+      get { return RepetitionsParameter.Value; }
+      set { RepetitionsParameter.Value = value; }
+    }
+
+    public MetaOptimizationEvaluator() : base() {
+      Parameters.Add(new LookupParameter<DoubleValue>("Quality", "The evaluated quality of the ParameterVector."));
       Parameters.Add(new LookupParameter<IAlgorithm>("Algorithm", "Missing description."));
-      Parameters.Add(new LookupParameter<IParameterSet>("ParameterSet", "Missing description."));
+      Parameters.Add(new LookupParameter<IItemList<IProblem>>("Problems", "Missing description."));
+      Parameters.Add(new LookupParameter<IParameterConfiguration>("ParameterConfiguration", "Missing description."));
+      Parameters.Add(new ValueParameter<IntValue>(RepetitionsParameterName, "Number of evaluations for one individual.", new IntValue(3)));
+    }
+
+    [StorableConstructor]
+    protected MetaOptimizationEvaluator(bool deserializing) : base(deserializing) { }
+    protected MetaOptimizationEvaluator(MetaOptimizationEvaluator original, Cloner cloner)
+      : base(original, cloner) {
+      this.algorithmStopped = original.algorithmStopped;
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new MetaOptimizationEvaluator(this, cloner);
     }
 
     public override IOperation Apply() {
       AlgorithmParameter.ActualValue.Prepare();
-      ParametrizeAlgorithm();
+      //ParameterizeAlgorithm();
+      ParameterConfigurationParameter.ActualValue.Parameterize(AlgorithmParameter.ActualValue);
       algorithmStopped = false;
       AlgorithmParameter.ActualValue.Stopped += new EventHandler(ActualValue_Stopped);
-      AlgorithmParameter.ActualValue.Start();
-      while (!algorithmStopped) {
-        Thread.Sleep(1000); // wait for algorithm to complete; do not rely on Algorithm.ExecutionState here, because change of ExecutionState happens before Run is added (which causes problems because Algorithm might get cloned when its started already)
+
+      double qualitySum = 0;
+
+      foreach (IProblem problem in ProblemsParameter.ActualValue) {
+        AlgorithmParameter.ActualValue.Problem = problem;
+        AlgorithmParameter.ActualValue.Start();
+        while (!algorithmStopped) {
+          Thread.Sleep(1000); // wait for algorithm to complete; do not rely on Algorithm.ExecutionState here, because change of ExecutionState happens before Run is added (which causes problems because Algorithm might get cloned when its started already)
+        }
+        AlgorithmParameter.ActualValue.Stopped -= new EventHandler(ActualValue_Stopped);
+        qualitySum += ((DoubleValue)AlgorithmParameter.ActualValue.Results["BestQuality"].Value).Value;
       }
-      AlgorithmParameter.ActualValue.Stopped -= new EventHandler(ActualValue_Stopped);
-      this.QualityParameter.ActualValue = (DoubleValue)AlgorithmParameter.ActualValue.Results["BestQuality"].Value;
+
+      double qualityAvg = qualitySum / ProblemsParameter.ActualValue.Count;
+      this.QualityParameter.ActualValue = new DoubleValue(qualityAvg);
+
       return base.Apply();
     }
@@ -56,13 +91,13 @@
     }
 
-    private void ParametrizeAlgorithm() {
-      foreach (IParameterConfiguration parameter in ParameterSetParameter.ActualValue.Parameters) {
-        if (parameter.Category == "Algorithm") {
-          this.AlgorithmParameter.ActualValue.Parameters[parameter.Parameter.Name].ActualValue = parameter.Parameter.ActualValue;
-        } else if (parameter.Category == "Problem") {
-          this.AlgorithmParameter.ActualValue.Problem.Parameters[parameter.Parameter.Name].ActualValue = parameter.Parameter.ActualValue;
-        }
-      }
-    }
+    //private void ParameterizeAlgorithm() {
+    //  foreach (IParameterConfiguration parameter in ParameterVectorParameter.ActualValue) {
+    //    if (typeof(IAlgorithm).IsAssignableFrom(parameter.OperatorType)) {
+    //      this.AlgorithmParameter.ActualValue.Parameters[parameter.Parameter.Name].ActualValue = parameter.Parameter.ActualValue;
+    //    } else if (typeof(IProblem).IsAssignableFrom(parameter.OperatorType)) {
+    //      this.AlgorithmParameter.ActualValue.Problem.Parameters[parameter.Parameter.Name].ActualValue = parameter.Parameter.ActualValue;
+    //    }
+    //  }
+    //}
   }
 }
