Index: /branches/HeuristicLab.MetaOptimization/HeuristicLab.MetaOptimization.Test/HeuristicLab.MetaOptimization.Test.csproj
===================================================================
--- /branches/HeuristicLab.MetaOptimization/HeuristicLab.MetaOptimization.Test/HeuristicLab.MetaOptimization.Test.csproj	(revision 5206)
+++ /branches/HeuristicLab.MetaOptimization/HeuristicLab.MetaOptimization.Test/HeuristicLab.MetaOptimization.Test.csproj	(revision 5207)
@@ -176,4 +176,7 @@
       <HintPath>..\..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Optimizer-3.3.dll</HintPath>
     </Reference>
+    <Reference Include="HeuristicLab.ParallelEngine-3.3">
+      <HintPath>..\..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.ParallelEngine-3.3.dll</HintPath>
+    </Reference>
     <Reference Include="HeuristicLab.Parameters-3.3">
       <HintPath>..\..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Parameters-3.3.dll</HintPath>
@@ -322,4 +325,5 @@
     <Compile Include="Program.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="TableBuilder.cs" />
   </ItemGroup>
   <ItemGroup>
Index: /branches/HeuristicLab.MetaOptimization/HeuristicLab.MetaOptimization.Test/Program.cs
===================================================================
--- /branches/HeuristicLab.MetaOptimization/HeuristicLab.MetaOptimization.Test/Program.cs	(revision 5206)
+++ /branches/HeuristicLab.MetaOptimization/HeuristicLab.MetaOptimization.Test/Program.cs	(revision 5207)
@@ -18,18 +18,26 @@
 using HeuristicLab.Selection;
 using HeuristicLab.Parameters;
+using HeuristicLab.Operators;
+using System.Diagnostics;
+using HeuristicLab.Encodings.RealVectorEncoding;
 
 namespace HeuristicLab.MetaOptimization.Test {
   class Program {
-    private static int metaAlgorithmPopulationSize = 10;
-    private static int metaAlgorithmMaxGenerations = 10;
-    private static int metaProblemRepetitions = 1;
-
-    private static int baseAlgorithmMaxGenerations = 10;
+    private static int metaAlgorithmPopulationSize = 50;
+    private static int metaAlgorithmMaxGenerations = 30;
+    private static int metaProblemRepetitions = 5;
+    private static int baseAlgorithmMaxGenerations = 1000;
+
+    //private static int metaAlgorithmPopulationSize = 10;
+    //private static int metaAlgorithmMaxGenerations = 20;
+    //private static int metaProblemRepetitions = 3;
+    //private static int baseAlgorithmMaxGenerations = 10;
 
     static void Main(string[] args) {
+      //TestTableBuilder();
       //TestShorten();
 
       //TestIntSampling();
-      //TestDoubleSampling();
+      //TestDoubleSampling(); return;
       //TestTypeDiscovery();
       //TestOperators();
@@ -39,31 +47,77 @@
       //TestEnumeratorCollectionEnumerator();
       //TestCombinations4();
+      //TestAlgorithmPerformanceIssue();
 
       GeneticAlgorithm baseLevelAlgorithm = new GeneticAlgorithm();
+
+      MetaOptimizationProblem metaOptimizationProblem = new MetaOptimizationProblem();
+      metaOptimizationProblem.Repetitions = new IntValue(metaProblemRepetitions);
+      //GeneticAlgorithm metaLevelAlgorithm = GetMetaGA(metaOptimizationProblem);
+      GeneticAlgorithm metaLevelAlgorithm = GetParallelMetaGA(metaOptimizationProblem);
+      //EvolutionStrategy metaLevelAlgorithm = GetMetaES(metaOptimizationProblem);
+
+      IValueConfiguration algorithmVc = SetupGAAlgorithm(baseLevelAlgorithm, metaOptimizationProblem);
+
+      //TestToString(algorithmVc);
+
+
+      //Console.WriteLine("Press enter to start");
+      //Console.ReadLine();
+      //TestConfiguration(algorithmVc, baseLevelAlgorithm);
+
+      //Console.WriteLine("Press enter to start");
+      //Console.ReadLine();
+      TestOptimization(metaLevelAlgorithm);
+
+      //TestMemoryLeak(metaLevelAlgorithm);
+
+      Console.ReadLine();
+    }
+
+    private static void TestAlgorithmPerformanceIssue() {
+      ContentManager.Initialize(new PersistenceContentManager());
+      Queue<TimeSpan> latestExecutionTimes = new Queue<TimeSpan>();
+      int size = 10;
+
+      GeneticAlgorithm ga = new GeneticAlgorithm();
+      ga.PopulationSize.Value = 3;
+      ga.MaximumGenerations.Value = 1;
+      ga.Engine = new SequentialEngine.SequentialEngine();
 
       MetaOptimizationProblem metaOptimizationProblem = new MetaOptimizationProblem();
       metaOptimizationProblem.Repetitions = new IntValue(metaProblemRepetitions);
       GeneticAlgorithm metaLevelAlgorithm = GetMetaGA(metaOptimizationProblem);
-      //EvolutionStrategy metaLevelAlgorithm = GetMetaES(metaOptimizationProblem);
-
-      IValueConfiguration algorithmVc = SetupGAAlgorithm(baseLevelAlgorithm, metaOptimizationProblem);
-
-      //TestToString(algorithmVc);
-
-
-      //Console.WriteLine("Press enter to start");
-      //Console.ReadLine();
-      //TestConfiguration(algorithmVc, baseLevelAlgorithm);
-
-      //Console.WriteLine("Press enter to start");
-      //Console.ReadLine();
-      TestOptimization(metaLevelAlgorithm);
-
-      //TestMemoryLeak(metaLevelAlgorithm);
-
-      Console.ReadLine();
-    }
-
-    private static void TestToString(IValueConfiguration algorithmVc) {
+      ParameterConfigurationTree algorithmVc = SetupGAAlgorithm(ga, metaOptimizationProblem);
+      Stopwatch sw = new Stopwatch();
+
+      for (int i = 0; i < 1000; i++) {
+        sw.Start();
+        GeneticAlgorithm clonedGa = (GeneticAlgorithm)ga.Clone();
+        clonedGa.Name = "CLONED GA";
+        algorithmVc.Parameterize(clonedGa);
+        clonedGa.Prepare(true);
+        var executor = new AlgorithmExecutor(clonedGa);
+        executor.StartSync();
+        sw.Stop();
+        latestExecutionTimes.Enqueue(sw.Elapsed);
+        Console.WriteLine("{0}: {1} ({2})", i, sw.Elapsed, latestExecutionTimes.Count > size ? TimeSpan.FromMilliseconds(latestExecutionTimes.Average(t => t.TotalMilliseconds)).ToString() : "-");
+        if (latestExecutionTimes.Count > size) {
+          latestExecutionTimes.Dequeue();
+        }
+        sw.Reset();
+      }
+    }
+
+    private static void TestTableBuilder() {
+      TableBuilder tb = new TableBuilder("column_1", "col2", "col3");
+      tb.AppendRow("1", "humpi", "0.23124");
+      tb.AppendRow("2", "sf", "0.23124");
+      tb.AppendRow("5", "humpi dampti", "0.224");
+      tb.AppendRow("10", "egon asdf", "0.4");
+      tb.AppendRow("15", "MichaelizcMultiVfds", "0.23124564");
+      Console.WriteLine(tb.ToString());
+    }
+
+    private static void TestToInfoString(IValueConfiguration algorithmVc) {
       var random = new MersenneTwister();
       Console.WriteLine(algorithmVc.ParameterInfoString);
@@ -154,5 +208,5 @@
       }
       Console.WriteLine("You are about to create {0} algorithms.", count);
-      
+
       Experiment experiment = vc.GenerateExperiment(ga);
       //foreach (var opt in experiment.Optimizers) {
@@ -170,13 +224,9 @@
     private static void TestOperators() {
       IRandom random = new MersenneTwister();
-      ParameterConfigurationManipulator manip = new ParameterConfigurationManipulator();
-
-      manip.IntValueManipulatorParameter.ActualValue = new UniformIntValueManipulator();
-      manip.DoubleValueManipulatorParameter.ActualValue = new NormalDoubleValueManipulator();
 
       var doubleRange = new DoubleValueRange(new DoubleValue(0), new DoubleValue(100), new DoubleValue(0.1));
       using (var sw = new StreamWriter("out-DoubleValue.txt")) {
         for (int i = 0; i < 10000; i++) {
-          var val = new DoubleValue(50);
+          var val = new DoubleValue(90);
           NormalDoubleValueManipulator.ApplyStatic(random, val, doubleRange);
 
@@ -244,8 +294,21 @@
       metaLevelAlgorithm.Problem = metaOptimizationProblem;
       metaLevelAlgorithm.Engine = new SequentialEngine.SequentialEngine();
-      
+
       metaLevelAlgorithm.Mutator = ((OptionalConstrainedValueParameter<IManipulator>)((IAlgorithm)metaLevelAlgorithm).Parameters["Mutator"]).ValidValues.Last();
-      
+
       metaLevelAlgorithm.MutationProbability.Value = 0.15;
+
+      return metaLevelAlgorithm;
+    }
+
+    private static GeneticAlgorithm GetParallelMetaGA(MetaOptimizationProblem metaOptimizationProblem) {
+      GeneticAlgorithm metaLevelAlgorithm = GetMetaGA(metaOptimizationProblem);
+
+      UniformSubScopesProcessor uniformSubScopesProcessor =
+        (HeuristicLab.Operators.UniformSubScopesProcessor)
+        ((HeuristicLab.Operators.AlgorithmOperator)metaLevelAlgorithm.OperatorGraph.Operators.ElementAt(2)).OperatorGraph.Operators.ElementAt(8);
+      uniformSubScopesProcessor.Parallel.Value = true;
+
+      metaLevelAlgorithm.Engine = new ParallelEngine.ParallelEngine();
 
       return metaLevelAlgorithm;
@@ -265,10 +328,10 @@
     }
 
-    private static IValueConfiguration SetupGAAlgorithm(GeneticAlgorithm baseLevelAlgorithm, MetaOptimizationProblem metaOptimizationProblem) {
+    private static ParameterConfigurationTree SetupGAAlgorithm(GeneticAlgorithm baseLevelAlgorithm, MetaOptimizationProblem metaOptimizationProblem) {
       baseLevelAlgorithm.Problem = new HeuristicLab.Problems.TestFunctions.SingleObjectiveTestFunctionProblem();
       baseLevelAlgorithm.MaximumGenerations.Value = baseAlgorithmMaxGenerations;
 
       metaOptimizationProblem.Algorithm = baseLevelAlgorithm;
-      IValueConfiguration algorithmVc = metaOptimizationProblem.ParameterConfigurationTree;
+      ParameterConfigurationTree algorithmVc = metaOptimizationProblem.ParameterConfigurationTree;
 
       metaOptimizationProblem.Problems.Add(new HeuristicLab.Problems.TestFunctions.SingleObjectiveTestFunctionProblem() {
@@ -276,14 +339,14 @@
         ProblemSize = new IntValue(500)
       });
-      metaOptimizationProblem.Problems.Add(new HeuristicLab.Problems.TestFunctions.SingleObjectiveTestFunctionProblem() {
-        Evaluator = new GriewankEvaluator(),
-        ProblemSize = new IntValue(1000)
-      });
-
-      ConfigurePopulationSize(algorithmVc, 0, 10, 1);
-      //ConfigureMutationRate(algorithmVc, 0.0, 1.0, 0.01);
-      //ConfigureMutationOperator(algorithmVc);
+      //metaOptimizationProblem.Problems.Add(new HeuristicLab.Problems.TestFunctions.SingleObjectiveTestFunctionProblem() {
+      //  Evaluator = new GriewankEvaluator(),
+      //  ProblemSize = new IntValue(1000)
+      //});
+
+      ConfigurePopulationSize(algorithmVc, 0, 100, 1);
+      ConfigureMutationRate(algorithmVc, 0.0, 1.0, 0.01);
+      ConfigureMutationOperator(algorithmVc);
       ConfigureElites(algorithmVc, 0, 10, 1);
-      //ConfigureSelectionOperator(algorithmVc, true);
+      ConfigureSelectionOperator(algorithmVc, true);
       return algorithmVc;
     }
@@ -393,5 +456,5 @@
 
       groupSizePc.ValueConfigurations.First().Optimize = true;
-      groupSizePc.ValueConfigurations.First().RangeConstraint.LowerBound = new IntValue(2);
+      groupSizePc.ValueConfigurations.First().RangeConstraint.LowerBound = new IntValue(0);
       groupSizePc.ValueConfigurations.First().RangeConstraint.UpperBound = new IntValue(10);
       groupSizePc.ValueConfigurations.First().RangeConstraint.StepSize = new IntValue(1);
@@ -441,8 +504,18 @@
 
         StringBuilder sb1 = new StringBuilder();
-        sb1.AppendLine(string.Format("Meta.PopulationSize: {0}", metaAlgorithmPopulationSize));
-        sb1.AppendLine(string.Format("Meta.MaxGenerations: {0}", metaAlgorithmMaxGenerations));
-        sb1.AppendLine(string.Format("Meta.Repetitions   : {0}", metaProblemRepetitions));
-        sb1.AppendLine(string.Format("Base.MaxGenerations: {0}", baseAlgorithmMaxGenerations));
+        sb1.AppendFormat("Meta.PopulationSize: {0}\n", metaAlgorithmPopulationSize);
+        sb1.AppendFormat("Meta.MaxGenerations: {0}\n", metaAlgorithmMaxGenerations);
+        sb1.AppendFormat("Meta.Repetitions   : {0}\n", metaProblemRepetitions);
+        sb1.AppendFormat("Meta.MutProb       : {0}\n", ((GeneticAlgorithm)metaLevelAlgorithm).MutationProbability.Value);
+        sb1.AppendFormat("Base.MaxGenerations: {0}\n", baseAlgorithmMaxGenerations);
+        sb1.AppendLine("Problems:");
+        foreach (var prob in ((MetaOptimizationProblem)metaLevelAlgorithm.Problem).Problems) {
+          sb1.Append(prob.Name);
+          var sotf = prob as SingleObjectiveTestFunctionProblem;
+          if (sotf != null) {
+            sb1.AppendFormat(" {0}", sotf.ProblemSize.Value);
+          }
+          sb1.AppendLine();
+        }
         sw.WriteLine(sb1.ToString());
         Console.WriteLine(sb1.ToString());
@@ -463,5 +536,6 @@
 
             sb.AppendLine(metaLevelAlgorithm.ExecutionState.ToString());
-            foreach (var result in metaLevelAlgorithm.Results) {
+            var rsClone = (ResultCollection)metaLevelAlgorithm.Results.Clone();
+            foreach (var result in rsClone) {
               sb.AppendLine(result.ToString());
               if (result.Name == "Population") {
@@ -469,5 +543,5 @@
                 var orderedRuns = rc.OrderBy(x => x.Results["RunsAverageQuality"]);
 
-                sb.AppendLine("Qual.  PoSi MutRa Eli SelOp MutOp");
+                TableBuilder tb = new TableBuilder("AvgQual", "AvgET", "PoSi", "MutRa", "Eli", "SelOp", "MutOp", "NrSelSubScopes");
                 foreach (IRun run in orderedRuns) {
                   string selector;
@@ -478,20 +552,23 @@
                   }
 
-                  sb.AppendLine(string.Format("{0} {1} {2} {3} {4} {5}",
-                    ((DoubleValue)run.Results["RunsAverageQuality"]).Value.ToString("#0.00").PadLeft(7, ' '),
-                    ((IntValue)run.Parameters["PopulationSize"]).Value.ToString().PadLeft(3, ' ').PadRight(3, ' '),
-                    ((DoubleValue)run.Parameters["MutationProbability"]).Value.ToString("0.00").PadLeft(5, ' '),
-                    ((IntValue)run.Parameters["Elites"]).Value.ToString().PadLeft(3, ' '),
-                    Shorten(selector, 20).PadRight(20, ' '),
-                    run.Parameters.ContainsKey("Mutator") ? run.Parameters["Mutator"].ToString() : "null"));
+                  tb.AppendRow(
+                    ((DoubleValue)run.Results["RunsAverageQuality"]).Value.ToString("#0.00"),
+                    run.Results["RunsAverageExecutionTime"].ToString(),
+                    ((IntValue)run.Parameters["PopulationSize"]).Value.ToString(),
+                    ((DoubleValue)run.Parameters["MutationProbability"]).Value.ToString("0.00"),
+                    ((IntValue)run.Parameters["Elites"]).Value.ToString(),
+                    Shorten(selector, 20),
+                    Shorten(run.Parameters.ContainsKey("Mutator") ? run.Parameters["Mutator"].ToString() : "null", 40),
+                    ((ISelector)run.Parameters["Selector"]).NumberOfSelectedSubScopesParameter.Value.ToString());
                 }
+                sb.AppendLine(tb.ToString());
               }
             } // foreach
-            Console.Clear();
+            //Console.Clear();
             Console.WriteLine(sb.ToString());
             sw.WriteLine(sb.ToString());
             currentGeneration = ((IntValue)metaLevelAlgorithm.Results["Generations"].Value).Value;
           } // if
-          if (i % 30 == 0) GC.Collect();
+          //if (i % 30 == 0) GC.Collect();
           i++;
         } while (metaLevelAlgorithm.ExecutionState != ExecutionState.Stopped);
@@ -545,5 +622,5 @@
       int lower = 10;
       int upper = 20;
-      int stepsize = 7;
+      int stepsize = 1;
       for (int i = 0; i < 100; i++) {
         int val;
@@ -631,6 +708,6 @@
       int i = 0;
       bool ok = false;
-      while(!ok && i < enumerators.Count) {
-        if(enumerators[i].MoveNext()) {
+      while (!ok && i < enumerators.Count) {
+        if (enumerators[i].MoveNext()) {
           ok = true;
         } else {
@@ -640,5 +717,5 @@
 
       if (ok) {
-        for (int k = i-1; k >= 0; k--) {
+        for (int k = i - 1; k >= 0; k--) {
           enumerators[k].Reset();
           enumerators[k].MoveNext();
Index: /branches/HeuristicLab.MetaOptimization/HeuristicLab.MetaOptimization.Test/TableBuilder.cs
===================================================================
--- /branches/HeuristicLab.MetaOptimization/HeuristicLab.MetaOptimization.Test/TableBuilder.cs	(revision 5207)
+++ /branches/HeuristicLab.MetaOptimization/HeuristicLab.MetaOptimization.Test/TableBuilder.cs	(revision 5207)
@@ -0,0 +1,49 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace HeuristicLab.MetaOptimization.Test {
+  public class TableBuilder {
+    private List<string> columnNames;
+    private List<string[]> rows = new List<string[]>();
+
+    public TableBuilder(params string[] columnNames) {
+      this.columnNames = new List<string>(columnNames);
+      AppendRow(columnNames);
+    }
+
+    public void AppendRow(params string[] values) {
+      if (values.Length != columnNames.Count)
+        throw new ArgumentException("Value count does not match column name count");
+      this.rows.Add(values);
+    }
+
+    public override string ToString() {
+      StringBuilder sb = new StringBuilder();
+      int[] columnSizes = GetColumnSizes();
+
+      for (int rowIdx = 0; rowIdx < rows.Count; rowIdx++) {
+        if (rowIdx == 1) {
+          sb.AppendLine(string.Join("", Enumerable.Repeat("-", columnSizes.Sum() + columnSizes.Count())));
+        }
+        for (int colIdx = 0; colIdx < rows[rowIdx].Length; colIdx++) {
+          sb.AppendFormat("{0} ", rows[rowIdx][colIdx].PadLeft(columnSizes[colIdx]));          
+        }
+        sb.AppendLine();
+      }
+      return sb.ToString();
+    }
+
+    private int[] GetColumnSizes() {
+      int[] sizes = new int[columnNames.Count];
+      for (int i = 0; i < columnNames.Count; i++) {
+        foreach (var row in rows) {
+          if (row[i].Length > sizes[i])
+            sizes[i] = row[i].Length;
+        }
+      }
+      return sizes;
+    }
+  }
+}
Index: /branches/HeuristicLab.MetaOptimization/HeuristicLab.MetaOptimization.sln
===================================================================
--- /branches/HeuristicLab.MetaOptimization/HeuristicLab.MetaOptimization.sln	(revision 5206)
+++ /branches/HeuristicLab.MetaOptimization/HeuristicLab.MetaOptimization.sln	(revision 5207)
@@ -12,4 +12,5 @@
 		HeuristicLab.MetaOptimization.vsmdi = HeuristicLab.MetaOptimization.vsmdi
 		Local.testsettings = Local.testsettings
+		Performance1.psess = Performance1.psess
 		PreBuildEvent.cmd = PreBuildEvent.cmd
 		TraceAndTestImpact.testsettings = TraceAndTestImpact.testsettings
Index: /branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization.Views/3.3/ValueConfigurationViews/ValueView.cs
===================================================================
--- /branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization.Views/3.3/ValueConfigurationViews/ValueView.cs	(revision 5206)
+++ /branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization.Views/3.3/ValueConfigurationViews/ValueView.cs	(revision 5207)
@@ -46,6 +46,9 @@
 
     private void setValueButton_Click(object sender, EventArgs e) {
-      var withoutNullValue = Content.ValidValues.Where(x => !(x is NullValue));
-      var objectSelectorDialog = new ObjectSelectorDialog<IItem>(withoutNullValue.GroupBy(x => ApplicationManager.Manager.GetDeclaringPlugin(x.GetType()).Name));
+      var typesWithoutNullValue = Content.ValidTypes.Where(x => x != typeof(NullValue));
+      var instances = typesWithoutNullValue.Select(x => (IItem)Activator.CreateInstance(x));
+      var groupedInstances = instances.GroupBy(x => ApplicationManager.Manager.GetDeclaringPlugin(x.GetType()).Name);
+
+      var objectSelectorDialog = new ObjectSelectorDialog<IItem>(groupedInstances);
       if (objectSelectorDialog.ShowDialog(this) == DialogResult.OK) {
         try {
Index: /branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/Crossovers/ParameterConfigurationCrossover.cs
===================================================================
--- /branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/Crossovers/ParameterConfigurationCrossover.cs	(revision 5206)
+++ /branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/Crossovers/ParameterConfigurationCrossover.cs	(revision 5207)
@@ -8,4 +8,5 @@
 using HeuristicLab.Parameters;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using System;
 
 namespace HeuristicLab.Problems.MetaOptimization {
@@ -57,7 +58,4 @@
       ParameterConfigurationTree child2 = (ParameterConfigurationTree)ParentsParameter.ActualValue[1];
 
-      //child1.Cross(child2, RandomParameter.ActualValue);
-      //this.ChildParameter.ActualValue = child1;
-
       child1.Cross(RandomParameter.ActualValue, child2, Cross, this);
       this.ChildParameter.ActualValue = child1;
Index: /branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/ParameterConfigurationTree.cs
===================================================================
--- /branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/ParameterConfigurationTree.cs	(revision 5206)
+++ /branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/ParameterConfigurationTree.cs	(revision 5207)
@@ -177,6 +177,6 @@
 
     public override void Parameterize(IParameterizedItem item) {
+      this.parameters.Clear();
       base.Parameterize(item);
-      this.parameters.Clear();
       ((IAlgorithm)item).CollectParameterValues(this.Parameters);
     }
Index: /branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/ParameterConfigurations/ParameterConfiguration.cs
===================================================================
--- /branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/ParameterConfigurations/ParameterConfiguration.cs	(revision 5206)
+++ /branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/ParameterConfigurations/ParameterConfiguration.cs	(revision 5207)
@@ -10,10 +10,11 @@
 using HeuristicLab.PluginInfrastructure;
 using System.Text;
+using System.Reflection;
 
 namespace HeuristicLab.Problems.MetaOptimization {
   [StorableClass]
   public class ParameterConfiguration : Item, IParameterConfiguration, IStorableContent {
-    public bool IsOptimizable { 
-      get { return true; } 
+    public bool IsOptimizable {
+      get { return true; }
     }
 
@@ -58,10 +59,10 @@
 
     [Storable]
-    protected IItemSet<IItem> validValues;
-    public IItemSet<IItem> ValidValues {
-      get { return validValues; }
+    protected Type[] validTypes;
+    public Type[] ValidTypes {
+      get { return validTypes; }
       protected set {
-        if (this.validValues != value) {
-          this.validValues = value;
+        if (this.validTypes != value) {
+          this.validTypes = value;
         }
       }
@@ -124,11 +125,11 @@
       this.parameterDataType = valueParameter.GetType();
       this.valueDataType = valueParameter.DataType;
-      this.validValues = GetValidValues(valueParameter);
+      this.validTypes = GetValidTypes(valueParameter).ToArray();
       this.IsNullable = valueParameter.ItemName.StartsWith("Optional");
       if (IsNullable) {
-        validValues.Add(new NullValue());
-      }
-      this.ValueConfigurations = new CheckedValueConfigurationCollection(this.validValues);
-      this.ActualValue = new ConstrainedValue(valueParameter.Value, valueParameter.DataType, this.ValidValues, this.IsNullable);
+        validTypes = new List<Type>(validTypes) { typeof(NullValue) }.ToArray();
+      }
+      this.ValueConfigurations = new CheckedValueConfigurationCollection(this.validTypes);
+      this.ActualValue = new ConstrainedValue(valueParameter.Value != null ? (IItem)valueParameter.Value.Clone() : null, valueParameter.DataType, this.ValidTypes, this.IsNullable);
       if (Optimize) {
         PopulateValueConfigurations();
@@ -139,9 +140,10 @@
     [StorableConstructor]
     protected ParameterConfiguration(bool deserializing) { }
-    protected ParameterConfiguration(ParameterConfiguration original, Cloner cloner) : base(original, cloner) {
+    protected ParameterConfiguration(ParameterConfiguration original, Cloner cloner)
+      : base(original, cloner) {
       this.parameterName = original.ParameterName;
       this.parameterDataType = original.parameterDataType;
       this.valueDataType = original.ValueDataType;
-      this.validValues = cloner.Clone(original.ValidValues);
+      this.validTypes = original.validTypes.ToArray();
       this.valueConfigurations = cloner.Clone(original.ValueConfigurations);
       this.ActualValue = cloner.Clone(original.ActualValue);
@@ -180,13 +182,13 @@
 
     private void PopulateValueConfigurations() {
-      foreach (IItem validValue in this.validValues) {
-        if (validValue is NullValue) {
+      foreach (Type t in this.validTypes) {
+        if (t == typeof(NullValue)) {
           this.ValueConfigurations.Add(new NullValueConfiguration());
         } else {
           IItem val;
-          if (ActualValue.Value != null && ActualValue.ValueDataType == validValue.GetType()) {
+          if (ActualValue.Value != null && ActualValue.ValueDataType == t) {
             val = ActualValue.Value; // use existing value for that type (if available)
           } else {
-            val = validValue;
+            val = (IItem)Activator.CreateInstance(t);
           }
           this.ValueConfigurations.Add(new ValueConfiguration(val, val.GetType()), true);
@@ -195,11 +197,12 @@
     }
 
-    private IItemSet<IItem> GetValidValues(IValueParameter parameter) {
-      if (IsSubclassOfRawGeneric(typeof(OptionalConstrainedValueParameter<>), parameter.GetType())) {
-        var x = (IEnumerable)parameter.GetType().GetProperty("ValidValues").GetValue(parameter, new object[] { });
-        return new ItemSet<IItem>(x.Cast<IItem>());
-      } else {
-        return new ItemSet<IItem>(ApplicationManager.Manager.GetInstances(valueDataType).Select(x => (IItem)x).OrderBy(x => x.ItemName));
-      }
+    private IEnumerable<Type> GetValidTypes(IValueParameter parameter) {
+      //if (IsSubclassOfRawGeneric(typeof(OptionalConstrainedValueParameter<>), parameter.GetType())) {
+      //  var x = (IEnumerable)parameter.GetType().GetProperty("ValidValues").GetValue(parameter, new object[] { });
+      //  return new ItemSet<IItem>(x.Cast<IItem>());
+      //} else {
+      //  return new ItemSet<IItem>(ApplicationManager.Manager.GetInstances(valueDataType).Select(x => (IItem)x).OrderBy(x => x.ItemName));
+      //}
+      return ApplicationManager.Manager.GetTypes(valueDataType, true);
     }
 
@@ -278,5 +281,5 @@
       if (handler != null) handler(sender, e);
     }
-    
+
     public virtual event EventHandler IsOptimizableChanged;
     private void OnIsOptimizableChanged() {
@@ -333,5 +336,24 @@
         }
       }
-      parameter.Value = this.ActualValue.Value;
+      var clonedValue = this.ActualValue.Value != null ? (IItem)this.ActualValue.Value.Clone() : null;
+      AdaptValidValues(parameter, clonedValue);
+      parameter.Value = clonedValue;
+    }
+
+    /// <summary>
+    /// Adds value to the ValidValues of the parameter if they don't contain the value
+    /// </summary>
+    private void AdaptValidValues(IValueParameter parameter, IItem value) {
+      // this requires some tricky reflection, because the type is unknown at runtime so parameter.ValidValues cannot be casted to Collection<?>
+      if (IsSubclassOfRawGeneric(typeof(OptionalConstrainedValueParameter<>), parameter.GetType())) {
+        var validValues = parameter.GetType().GetProperty("ValidValues").GetValue(parameter, new object[] { });
+        Type validValuesType = validValues.GetType();
+
+        var containsMethod = validValuesType.GetMethod("Contains");
+        if (!(bool)containsMethod.Invoke(validValues, new object[] { value })) {
+          var addMethod = validValuesType.GetMethod("Add");
+          addMethod.Invoke(validValues, new object[] { value });
+        }
+      }
     }
 
Index: /branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/RangeConstraints/ConstrainedValue.cs
===================================================================
--- /branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/RangeConstraints/ConstrainedValue.cs	(revision 5206)
+++ /branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/RangeConstraints/ConstrainedValue.cs	(revision 5207)
@@ -33,10 +33,10 @@
 
     [Storable]
-    protected IItemSet<IItem> validValues;
-    public IItemSet<IItem> ValidValues {
-      get { return validValues; }
+    protected Type[] validTypes;
+    public Type[] ValidTypes {
+      get { return validTypes; }
       protected set {
-        if (this.validValues != value) {
-          this.validValues = value;
+        if (this.validTypes != value) {
+          this.validTypes = value;
         }
       }
@@ -65,8 +65,8 @@
     [StorableConstructor]
     protected ConstrainedValue(bool deserializing) : base(deserializing) { }
-    public ConstrainedValue(IItem value, Type valueDataType, IItemSet<IItem> validValues, bool isNullable) {
+    public ConstrainedValue(IItem value, Type valueDataType, Type[] validTypes, bool isNullable) {
       this.Value = value;
       this.ValueDataType = valueDataType;
-      this.ValidValues = validValues;
+      this.ValidTypes = validTypes;
       this.isNullable = isNullable;
     }
@@ -74,5 +74,5 @@
       this.valueDataType = original.valueDataType;
       this.Value = cloner.Clone(original.value);
-      this.ValidValues = cloner.Clone(original.ValidValues);
+      if(original.ValidTypes != null) this.ValidTypes = original.ValidTypes.ToArray();
       this.isNullable = original.isNullable;
     }
Index: /branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/RangeConstraints/DoubleValueRange.cs
===================================================================
--- /branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/RangeConstraints/DoubleValueRange.cs	(revision 5206)
+++ /branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/RangeConstraints/DoubleValueRange.cs	(revision 5207)
@@ -25,21 +25,19 @@
       do {
         val = Math.Round((random.NextDouble() * (UpperBound.Value - LowerBound.Value) + LowerBound.Value) / StepSize.Value, 0) * StepSize.Value;
-      } while (val < LowerBound.Value || val > UpperBound.Value);
+      } while (!IsInRange(val));
       return new DoubleValue(val);
     }
 
-    public void Fix(DoubleValue value) {
-      // apply stepsize
+    public void ApplyStepSize(DoubleValue value) {
       value.Value = ((int)Math.Round(value.Value / this.StepSize.Value, 0)) * this.StepSize.Value;
+    }
 
-      // repair bounds
-      if (value.Value > this.UpperBound.Value) value.Value = this.UpperBound.Value;
-      if (value.Value < this.LowerBound.Value) value.Value = this.LowerBound.Value;
+    public bool IsInRange(double value) {
+      return value <= this.UpperBound.Value && value >= this.LowerBound.Value;
     }
 
     public override IEnumerable<DoubleValue> GetCombinations() {
       var solutions = new List<DoubleValue>();
-      double value = ((int)Math.Round(LowerBound.Value / StepSize.Value, 0)) * StepSize.Value;
-      if (value < LowerBound.Value) value += StepSize.Value;
+      double value = LowerBound.Value;
 
       while (value <= UpperBound.Value) {
Index: /branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/RangeConstraints/IntValueRange.cs
===================================================================
--- /branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/RangeConstraints/IntValueRange.cs	(revision 5206)
+++ /branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/RangeConstraints/IntValueRange.cs	(revision 5207)
@@ -25,21 +25,19 @@
       do {
         val = random.Next(LowerBound.Value / StepSize.Value, UpperBound.Value / StepSize.Value + 1) * StepSize.Value;
-      } while (val < LowerBound.Value || val > UpperBound.Value);
+      } while (!IsInRange(val));
       return new IntValue(val);
     }
 
-    public void Fix(IntValue value) {
-      // apply stepsize
+    public void ApplyStepSize(IntValue value) {
       value.Value = ((int)Math.Round(value.Value / (double)this.StepSize.Value, 0)) * this.StepSize.Value;
+    }
 
-      // repair bounds
-      if (value.Value > this.UpperBound.Value) value.Value = this.UpperBound.Value;
-      if (value.Value < this.LowerBound.Value) value.Value = this.LowerBound.Value;
+    public bool IsInRange(int value) {
+      return value <= this.UpperBound.Value && value >= this.LowerBound.Value;
     }
 
     public override IEnumerable<IntValue> GetCombinations() {
       var solutions = new List<IntValue>();
-      int value = (this.LowerBound.Value / StepSize.Value) * StepSize.Value;
-      if (value < this.LowerBound.Value) value += StepSize.Value;
+      int value = this.LowerBound.Value;
 
       while (value <= this.UpperBound.Value) {
Index: /branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/RangeConstraints/PercentValueRange.cs
===================================================================
--- /branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/RangeConstraints/PercentValueRange.cs	(revision 5206)
+++ /branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/RangeConstraints/PercentValueRange.cs	(revision 5207)
@@ -25,5 +25,5 @@
       do {
         val = Math.Round((random.NextDouble() * (UpperBound.Value - LowerBound.Value) + LowerBound.Value) / StepSize.Value, 0) * StepSize.Value;
-      } while (val < LowerBound.Value || val > UpperBound.Value);
+      } while (!IsInRange(val));
       return new PercentValue(val);
     }
@@ -33,8 +33,15 @@
     }
 
+    public void ApplyStepSize(PercentValue value) {
+      value.Value = ((int)Math.Round(value.Value / this.StepSize.Value, 0)) * this.StepSize.Value;
+    }
+
+    public bool IsInRange(double value) {
+      return value <= this.UpperBound.Value && value >= this.LowerBound.Value;
+    }
+
     public override IEnumerable<PercentValue> GetCombinations() {
       var solutions = new List<PercentValue>();
-      double value = ((int)Math.Round(LowerBound.Value / StepSize.Value, 0)) * StepSize.Value;
-      if (value < LowerBound.Value) value += StepSize.Value;
+      double value = LowerBound.Value;
 
       while (value <= UpperBound.Value) {
Index: /branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/ValueConfigurations/CheckedValueConfigurationCollection.cs
===================================================================
--- /branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/ValueConfigurations/CheckedValueConfigurationCollection.cs	(revision 5206)
+++ /branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/ValueConfigurations/CheckedValueConfigurationCollection.cs	(revision 5207)
@@ -24,6 +24,9 @@
     }
 
-    public CheckedValueConfigurationCollection(IItemSet<IItem> validValues) {
-      this.validValues = validValues;
+    public CheckedValueConfigurationCollection(IEnumerable<Type> validTypes) {
+      this.validValues = new ItemSet<IItem>();
+      foreach (Type t in validTypes) {
+        this.validValues.Add((IItem)Activator.CreateInstance(t));
+      }
       RegisterEvents();
     }
Index: /branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/ValueConfigurations/ValueConfiguration.cs
===================================================================
--- /branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/ValueConfigurations/ValueConfiguration.cs	(revision 5206)
+++ /branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/ValueConfigurations/ValueConfiguration.cs	(revision 5207)
@@ -60,5 +60,5 @@
       set {
         if (this.actualValue != value) {
-          RegisterActualValueEvents();
+          DeregisterActualValueEvents();
           ClearParameterConfigurations();
           this.actualValue = value;
@@ -66,5 +66,5 @@
           OnValueChanged();
           OnToStringChanged();
-          DeregisterActualValueEvents();
+          RegisterActualValueEvents();
         }
       }
@@ -87,6 +87,6 @@
     public ValueConfiguration(IItem value, Type valueDataType) {
       this.ParameterConfigurations = new ItemList<IParameterConfiguration>();
-      var validValues = new ItemSet<IItem>(ApplicationManager.Manager.GetInstances(valueDataType).Select(x => (IItem)x).OrderBy(x => x.ItemName));
-      this.ActualValue = new ConstrainedValue(value, valueDataType, validValues, false);
+      var validTypes = ApplicationManager.Manager.GetTypes(valueDataType).OrderBy(x => x.Name).ToArray();
+      this.ActualValue = new ConstrainedValue(value, valueDataType, validTypes, false);
       this.IsOptimizable = true;
       if (actualValue.ValueDataType == typeof(IntValue)) {
Index: /branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Evaluators/ParameterConfigurationEvaluator.cs
===================================================================
--- /branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Evaluators/ParameterConfigurationEvaluator.cs	(revision 5206)
+++ /branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Evaluators/ParameterConfigurationEvaluator.cs	(revision 5207)
@@ -10,4 +10,8 @@
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
 using System.Collections.Generic;
+using HeuristicLab.Algorithms.GeneticAlgorithm;
+using System.Threading.Tasks;
+using System.Diagnostics;
+using System.Reflection;
 
 namespace HeuristicLab.Problems.MetaOptimization {
@@ -18,6 +22,5 @@
   [StorableClass]
   public class ParameterConfigurationEvaluator : SingleSuccessorOperator, IParameterConfigurationEvaluator {
-    private bool algorithmStopped;
-    private bool algorithmExceptionOccured;
+    private const double PenaltyQuality = 100000.0; // todo: use something better
 
     public ILookupParameter<DoubleValue> QualityParameter {
@@ -54,5 +57,4 @@
     protected ParameterConfigurationEvaluator(ParameterConfigurationEvaluator original, Cloner cloner)
       : base(original, cloner) {
-      this.algorithmStopped = original.algorithmStopped;
     }
     public override IDeepCloneable Clone(Cloner cloner) {
@@ -61,17 +63,10 @@
 
     public override IOperation Apply() {
-      EngineAlgorithm algorithm = AlgorithmParameter.ActualValue;
+      EngineAlgorithm algorithm = (EngineAlgorithm)AlgorithmParameter.ActualValue.Clone();
       IItemList<ISingleObjectiveProblem> problems = ProblemsParameter.ActualValue;
 
       // set parameters
       ParameterConfigurationParameter.ActualValue.Parameterize(algorithm);
-      algorithm.Problem = problems.First();
       algorithm.StoreAlgorithmInEachRun = false;
-
-      algorithmStopped = false;
-      algorithmExceptionOccured = false;
-      algorithm.Stopped += new EventHandler(algorithm_Stopped);
-      algorithm.Paused += new EventHandler(algorithm_Paused);
-      algorithm.ExceptionOccurred += new EventHandler<EventArgs<Exception>>(algorithm_ExceptionOccurred);
 
       List<double> qualities = new List<double>();
@@ -81,16 +76,15 @@
 
       foreach (ISingleObjectiveProblem problem in problems) {
-        algorithm.Problem = problem;
+        algorithm.Problem = (IProblem)problem.Clone();
 
         for (int i = 0; i < Repetitions.Value; i++) {
           algorithm.Prepare();
-          algorithm.Start();
-          while (!algorithmStopped) {
-            Thread.Sleep(200); // 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)
-          }
 
-          if (algorithmExceptionOccured) {
+          AlgorithmExecutor executor = new AlgorithmExecutor(algorithm);
+          executor.StartSync();
+
+          if (algorithm.ExecutionState == ExecutionState.Paused) {
             // this parametercombination was bad. set penalty for this solution
-            qualities.Add(double.MaxValue); // todo: respect Maximization
+            qualities.Add(PenaltyQuality); // todo: respect Maximization; problem: this messes up average value; solution: use currently worst quality*2
             executionTimes.Add(algorithm.ExecutionTime);
           } else {
@@ -103,12 +97,6 @@
             algorithm.Runs.Last().Parameters.Add("Problem", problem);
           }
-          algorithmStopped = false;
-          algorithmExceptionOccured = false;
         }
       }
-
-      algorithm.Stopped -= new EventHandler(algorithm_Stopped);
-      algorithm.Paused -= new EventHandler(algorithm_Paused);
-      algorithm.ExceptionOccurred -= new EventHandler<EventArgs<Exception>>(algorithm_ExceptionOccurred);
       algorithm.Prepare();
 
@@ -130,16 +118,4 @@
     }
 
-    private void algorithm_Paused(object sender, EventArgs e) {
-      algorithmStopped = true;
-    }
-
-    private void algorithm_Stopped(object sender, EventArgs e) {
-      algorithmStopped = true;
-    }
-
-    void algorithm_ExceptionOccurred(object sender, EventArgs<Exception> e) {
-      algorithmExceptionOccured = true;
-    }
-
     public static double Variance(IEnumerable<double> source) {
       double avg = source.Average();
@@ -151,6 +127,31 @@
       return Math.Sqrt(source.Variance());
     }
+  }
 
+  public class AlgorithmExecutor {
+    private EngineAlgorithm algorithm;
+    private AutoResetEvent waitHandle = new AutoResetEvent(false);
 
+    public AlgorithmExecutor(EngineAlgorithm algorithm) {
+      this.algorithm = algorithm;
+    }
+
+    public void StartSync() {
+      algorithm.Stopped += new EventHandler(algorithm_Stopped);
+      algorithm.Paused += new EventHandler(algorithm_Paused);
+      algorithm.Start();
+      waitHandle.WaitOne();
+      waitHandle.Dispose();
+      algorithm.Stopped -= new EventHandler(algorithm_Stopped);
+      algorithm.Paused -= new EventHandler(algorithm_Paused);
+    }
+
+    void algorithm_Paused(object sender, EventArgs e) {
+      waitHandle.Set();
+    }
+
+    void algorithm_Stopped(object sender, EventArgs e) {
+      waitHandle.Set();
+    }
   }
 }
Index: /branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Interfaces/IParameterConfiguration.cs
===================================================================
--- /branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Interfaces/IParameterConfiguration.cs	(revision 5206)
+++ /branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Interfaces/IParameterConfiguration.cs	(revision 5207)
@@ -10,5 +10,5 @@
     Type ParameterDataType { get; }
     ICheckedValueConfigurationCollection ValueConfigurations { get; }
-    IItemSet<IItem> ValidValues { get; }
+    Type[] ValidTypes { get; }
     int ActualValueConfigurationIndex { get; set; }
 
Index: /branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Operators/Manipulators/NormalDoubleValueManipulator.cs
===================================================================
--- /branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Operators/Manipulators/NormalDoubleValueManipulator.cs	(revision 5206)
+++ /branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Operators/Manipulators/NormalDoubleValueManipulator.cs	(revision 5207)
@@ -36,9 +36,16 @@
 
     public static void ApplyStatic(IRandom random, DoubleValue value, DoubleValueRange range) {
-      var vector = new RealVector(new double[] { value.Value });
-      var strategy = new RealVector(new double[] { (range.UpperBound.Value - range.LowerBound.Value) / 5});
-      NormalAllPositionsManipulator.Apply(random, vector, strategy);
-      value.Value = vector[0];
-      range.Fix(value);
+      bool ok = false;
+      RealVector strategy = new RealVector(new double[] { (range.UpperBound.Value - range.LowerBound.Value) / 15});
+      RealVector vector = new RealVector(1);
+      double val = value.Value;
+
+      while (!ok) { 
+        vector[0] = val;
+        NormalAllPositionsManipulator.Apply(random, vector, strategy);
+        value.Value = vector[0];
+        range.ApplyStepSize(value);
+        ok = range.IsInRange(value.Value);
+      }
     }
   }
Index: /branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Operators/Manipulators/UniformDoubleValueManipulator.cs
===================================================================
--- /branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Operators/Manipulators/UniformDoubleValueManipulator.cs	(revision 5206)
+++ /branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Operators/Manipulators/UniformDoubleValueManipulator.cs	(revision 5207)
@@ -36,11 +36,18 @@
 
     public static void ApplyStatic(IRandom random, DoubleValue value, DoubleValueRange range) {
-      var vector = new RealVector(new double[] { value.Value });
+      bool ok = false;
+      var vector = new RealVector(1);
       var bounds = new DoubleMatrix(1, 2);
       bounds[0, 0] = range.LowerBound.Value;
       bounds[0, 1] = range.UpperBound.Value;
-      UniformOnePositionManipulator.Apply(random, vector, bounds);
-      value.Value = vector[0];
-      range.Fix(value);
+      double val = value.Value;
+
+      while (!ok) {
+        vector[0] = val;
+        UniformOnePositionManipulator.Apply(random, vector, bounds);
+        value.Value = vector[0];
+        range.ApplyStepSize(value);
+        ok = range.IsInRange(value.Value);
+      }
     }
   }
Index: /branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Operators/Manipulators/UniformIntValueManipulator.cs
===================================================================
--- /branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Operators/Manipulators/UniformIntValueManipulator.cs	(revision 5206)
+++ /branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Operators/Manipulators/UniformIntValueManipulator.cs	(revision 5207)
@@ -37,8 +37,15 @@
 
     public static void ApplyStatic(IRandom random, IntValue value, IntValueRange range) {
+      bool ok = false;
       var vector = new IntegerVector(new int[] { value.Value });
-      UniformOnePositionManipulator.Apply(random, vector, range.LowerBound, new IntValue(range.UpperBound.Value + 1));
-      value.Value = vector[0];
-      range.Fix(value);
+      int val = value.Value;
+
+      while (!ok) {
+        vector[0] = val;
+        UniformOnePositionManipulator.Apply(random, vector, range.LowerBound, new IntValue(range.UpperBound.Value + 1));
+        value.Value = vector[0];
+        range.ApplyStepSize(value);
+        ok = range.IsInRange(value.Value);
+      }
     }
   }
