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 5207)
+++ branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/ParameterConfigurations/ParameterConfiguration.cs	(revision 5231)
@@ -11,4 +11,5 @@
 using System.Text;
 using System.Reflection;
+using HeuristicLab.Optimization;
 
 namespace HeuristicLab.Problems.MetaOptimization {
@@ -120,4 +121,6 @@
     }
 
+    protected IItemSet<IItem> validValues;
+
     #region Constructors and Cloning
     public ParameterConfiguration(string parameterName, IValueParameter valueParameter) {
@@ -125,4 +128,5 @@
       this.parameterDataType = valueParameter.GetType();
       this.valueDataType = valueParameter.DataType;
+      this.validValues = GetValidValues(valueParameter);
       this.validTypes = GetValidTypes(valueParameter).ToArray();
       this.IsNullable = valueParameter.ItemName.StartsWith("Optional");
@@ -130,6 +134,6 @@
         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);
+      this.ValueConfigurations = new CheckedValueConfigurationCollection(this.CreateValidValues());
+      this.ActualValue = new ConstrainedValue(valueParameter.Value != null ? (IItem)valueParameter.Value.Clone() : null, valueParameter.DataType, this.CreateValidValues(), this.IsNullable);
       if (Optimize) {
         PopulateValueConfigurations();
@@ -145,4 +149,5 @@
       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);
@@ -186,10 +191,5 @@
           this.ValueConfigurations.Add(new NullValueConfiguration());
         } else {
-          IItem val;
-          if (ActualValue.Value != null && ActualValue.ValueDataType == t) {
-            val = ActualValue.Value; // use existing value for that type (if available)
-          } else {
-            val = (IItem)Activator.CreateInstance(t);
-          }
+          IItem val = CreateItem(t); // (IItem)Activator.CreateInstance(t);
           this.ValueConfigurations.Add(new ValueConfiguration(val, val.GetType()), true);
         }
@@ -198,11 +198,43 @@
 
     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);
+      if (IsSubclassOfRawGeneric(typeof(OptionalConstrainedValueParameter<>), parameter.GetType())) {
+        var parameterValidValues = (IEnumerable)parameter.GetType().GetProperty("ValidValues").GetValue(parameter, new object[] { });
+        return parameterValidValues.Cast<object>().Select(x => x.GetType());
+      } else {
+        return ApplicationManager.Manager.GetTypes(valueDataType, true);
+      }
+    }
+
+    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 null;
+      }
+    }
+
+    public IItem CreateItem(Type type) {
+      // no valid values; just instantiate
+      if (validValues == null)
+        return (IItem)Activator.CreateInstance(type);
+
+      if (type == typeof(NullValue))
+        return new NullValue();
+      
+      // copy value from ValidValues; this ensures that previously set ActualNames for a type are kept
+      IItem value = this.validValues.Where(v => v.GetType() == type).SingleOrDefault();
+      if (value != null) 
+        return (IItem)value.Clone();
+
+      return null;
+    }
+
+    private ItemSet<IItem> CreateValidValues() {
+      var validValues = new ItemSet<IItem>();
+      foreach (Type t in this.validTypes) {
+        validValues.Add(CreateItem(t));
+      }
+      return validValues;
     }
 
