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 5267)
+++ branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/ParameterConfigurations/ParameterConfiguration.cs	(revision 5277)
@@ -12,4 +12,5 @@
 using System.Reflection;
 using HeuristicLab.Optimization;
+using HeuristicLab.Collections;
 
 namespace HeuristicLab.Problems.MetaOptimization {
@@ -78,6 +79,6 @@
 
     [Storable]
-    protected ICheckedValueConfigurationCollection valueConfigurations;
-    public ICheckedValueConfigurationCollection ValueConfigurations {
+    protected ICheckedValueConfigurationList valueConfigurations;
+    public ICheckedValueConfigurationList ValueConfigurations {
       get { return this.valueConfigurations; }
       protected set {
@@ -135,5 +136,5 @@
         validTypes = new List<Type>(validTypes) { typeof(NullValue) }.ToArray();
       }
-      this.ValueConfigurations = new CheckedValueConfigurationCollection();
+      this.ValueConfigurations = new CheckedValueConfigurationList();
       this.ActualValue = new ConstrainedValue(
         valueParameter.Value != null ? (IItem)valueParameter.Value.Clone() : null, 
@@ -173,13 +174,13 @@
 
     private void RegisterValueConfigurationEvents() {
-      this.ValueConfigurations.CheckedItemsChanged += new Collections.CollectionItemsChangedEventHandler<IValueConfiguration>(ValueConfigurations_CheckedItemsChanged);
-      this.ValueConfigurations.ItemsAdded += new Collections.CollectionItemsChangedEventHandler<IValueConfiguration>(ValueConfigurations_ItemsAdded);
-      this.ValueConfigurations.ItemsRemoved += new Collections.CollectionItemsChangedEventHandler<IValueConfiguration>(ValueConfigurations_ItemsRemoved);
+      this.ValueConfigurations.CheckedItemsChanged += new CollectionItemsChangedEventHandler<IndexedItem<IValueConfiguration>>(ValueConfigurations_CheckedItemsChanged);
+      this.ValueConfigurations.ItemsAdded += new CollectionItemsChangedEventHandler<IndexedItem<IValueConfiguration>>(ValueConfigurations_ItemsAdded);
+      this.ValueConfigurations.ItemsRemoved += new CollectionItemsChangedEventHandler<IndexedItem<IValueConfiguration>>(ValueConfigurations_ItemsRemoved);
     }
 
     private void DeregisterValueConfigurationEvents() {
-      this.ValueConfigurations.CheckedItemsChanged -= new Collections.CollectionItemsChangedEventHandler<IValueConfiguration>(ValueConfigurations_CheckedItemsChanged);
-      this.ValueConfigurations.ItemsAdded -= new Collections.CollectionItemsChangedEventHandler<IValueConfiguration>(ValueConfigurations_ItemsAdded);
-      this.ValueConfigurations.ItemsRemoved -= new Collections.CollectionItemsChangedEventHandler<IValueConfiguration>(ValueConfigurations_ItemsRemoved);
+      this.ValueConfigurations.CheckedItemsChanged -= new CollectionItemsChangedEventHandler<IndexedItem<IValueConfiguration>>(ValueConfigurations_CheckedItemsChanged);
+      this.ValueConfigurations.ItemsAdded -= new CollectionItemsChangedEventHandler<IndexedItem<IValueConfiguration>>(ValueConfigurations_ItemsAdded);
+      this.ValueConfigurations.ItemsRemoved -= new CollectionItemsChangedEventHandler<IndexedItem<IValueConfiguration>>(ValueConfigurations_ItemsRemoved);
     }
 
@@ -268,11 +269,11 @@
     }
 
-    void ValueConfigurations_CheckedItemsChanged(object sender, Collections.CollectionItemsChangedEventArgs<IValueConfiguration> e) {
+    void ValueConfigurations_CheckedItemsChanged(object sender, Collections.CollectionItemsChangedEventArgs<IndexedItem<IValueConfiguration>> e) {
       OnToStringChanged();
     }
-    void ValueConfigurations_ItemsRemoved(object sender, Collections.CollectionItemsChangedEventArgs<IValueConfiguration> e) {
+    void ValueConfigurations_ItemsRemoved(object sender, Collections.CollectionItemsChangedEventArgs<IndexedItem<IValueConfiguration>> e) {
       OnToStringChanged();
     }
-    void ValueConfigurations_ItemsAdded(object sender, Collections.CollectionItemsChangedEventArgs<IValueConfiguration> e) {
+    void ValueConfigurations_ItemsAdded(object sender, Collections.CollectionItemsChangedEventArgs<IndexedItem<IValueConfiguration>> e) {
       OnToStringChanged();
     }
@@ -360,5 +361,5 @@
 
           if (this.ActualValue.Value is IParameterizedItem) {
-            string subParams = this.ValueConfigurations.CheckedItems.ElementAt(actualValueConfigurationIndex).ParameterInfoString;
+            string subParams = this.ValueConfigurations[actualValueConfigurationIndex].ParameterInfoString;
             if (!string.IsNullOrEmpty(subParams)) {
               sb.Append(" (");
@@ -383,5 +384,5 @@
       if (Optimize) {
         if (this.ActualValue.Value is IParameterizedItem) {
-          this.ValueConfigurations.CheckedItems.ElementAt(actualValueConfigurationIndex).Parameterize((IParameterizedItem)this.ActualValue.Value);
+          this.ValueConfigurations[actualValueConfigurationIndex].Parameterize((IParameterizedItem)this.ActualValue.Value);
         }
       }
@@ -410,38 +411,42 @@
     public void Randomize(IRandom random) {
       if (Optimize) {
-        foreach (var vc in this.ValueConfigurations.CheckedItems) {
-          vc.Randomize(random);
-        }
-        actualValueConfigurationIndex = random.Next(ValueConfigurations.CheckedItems.Count());
-        this.ActualValue = this.ValueConfigurations.CheckedItems.ElementAt(actualValueConfigurationIndex).ActualValue;
-      }
-    }
-
-    public void Mutate(IRandom random, MutateDelegate mutate, ParameterConfigurationManipulator pcmanip) {
-      if (Optimize) {
-        foreach (IValueConfiguration vc in this.ValueConfigurations.CheckedItems) {
-          vc.Mutate(random, mutate, pcmanip);
-        }
-        mutate(random, this, pcmanip);
-      }
-    }
-
-    public void Cross(IRandom random, IOptimizable other, CrossDelegate cross, ParameterConfigurationCrossover pccross) {
+        foreach (var vc in this.ValueConfigurations) {
+          if (this.ValueConfigurations.ItemChecked(vc)) {
+            vc.Randomize(random);
+          }
+        }
+        do {
+          actualValueConfigurationIndex = random.Next(ValueConfigurations.Count());
+        } while (!this.ValueConfigurations.ItemChecked(this.ValueConfigurations[actualValueConfigurationIndex]));
+        this.ActualValue = this.ValueConfigurations[actualValueConfigurationIndex].ActualValue;
+      }
+    }
+
+    public void Mutate(IRandom random, MutateDelegate mutate, IIntValueManipulator intValueManipulator, IDoubleValueManipulator doubleValueManipulator) {
+      if (Optimize) {
+        foreach (var vc in this.ValueConfigurations) {
+          if (this.ValueConfigurations.ItemChecked(vc)) {
+            vc.Mutate(random, mutate, intValueManipulator, doubleValueManipulator);
+          }
+        }
+        mutate(random, this, intValueManipulator, doubleValueManipulator);
+      }
+    }
+
+    public void Cross(IRandom random, IOptimizable other, CrossDelegate cross, IIntValueCrossover intValueCrossover, IDoubleValueCrossover doubleValueCrossover) {
       if (Optimize) {
         IParameterConfiguration otherPc = (IParameterConfiguration)other;
         for (int i = 0; i < this.ValueConfigurations.Count; i++) {
-          cross(random, other, pccross);
-          //this.ValueConfigurations.ElementAt(i).Cross(otherPc.ValueConfigurations.ElementAt(i), random);
-        }
-        //if (random.NextDouble() > 0.5) {
-        //  actualValueConfigurationIndex = ((ParameterConfiguration)other).actualValueConfigurationIndex;
-        //}
-        //this.ActualValue = this.ValueConfigurations.CheckedItems.ElementAt(actualValueConfigurationIndex).ActualValue;
+          if (this.ValueConfigurations.ItemChecked(this.ValueConfigurations[i])) {
+            this.ValueConfigurations[i].Cross(random, otherPc.ValueConfigurations[i], cross, intValueCrossover, doubleValueCrossover);
+          }
+        }
+        cross(random, this, other, intValueCrossover, doubleValueCrossover);
       }
     }
 
     public void UpdateActualValueIndexToItem(IValueConfiguration vc) {
-      for (int i = 0; i < this.ValueConfigurations.CheckedItems.Count(); i++) {
-        if (this.ValueConfigurations.CheckedItems.ElementAt(i) == vc) {
+      for (int i = 0; i < this.ValueConfigurations.Count(); i++) {
+        if (this.ValueConfigurations.ElementAt(i) == vc) {
           this.actualValueConfigurationIndex = i;
           return;
