Index: unk/sources/HeuristicLab.SimOpt/DefaultInitializer.cs
===================================================================
--- /trunk/sources/HeuristicLab.SimOpt/DefaultInitializer.cs	(revision 636)
+++ 	(revision )
@@ -1,42 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2008 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 System.Linq;
-using System.Text;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-
-namespace HeuristicLab.SimOpt {
-  public class DefaultInitializer : SimOptInitializationOperatorBase {
-    public override string Description {
-      get { return @"Does not perform initialization of the variable, but leaves it as it is"; }
-    }
-
-    public override IOperation Apply(IScope scope) {
-      return null;
-    }
-
-    protected override void Apply(IScope scope, IRandom random, IItem item) {
-    }
-  }
-}
Index: unk/sources/HeuristicLab.SimOpt/DefaultManipulator.cs
===================================================================
--- /trunk/sources/HeuristicLab.SimOpt/DefaultManipulator.cs	(revision 636)
+++ 	(revision )
@@ -1,42 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2008 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 System.Linq;
-using System.Text;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-
-namespace HeuristicLab.SimOpt {
-  public class DefaultManipulator : SimOptManipulationOperatorBase {
-    public override string Description {
-      get { return @"Does not perform any manipulation, instead leaves the data as it is"; }
-    }
-
-    public override IOperation Apply(IScope scope) {
-      return null;
-    }
-
-    protected override void Apply(IScope scope, IRandom random, IItem item) {
-    }
-  }
-}
Index: /trunk/sources/HeuristicLab.SimOpt/HeuristicLab.SimOpt.csproj
===================================================================
--- /trunk/sources/HeuristicLab.SimOpt/HeuristicLab.SimOpt.csproj	(revision 636)
+++ /trunk/sources/HeuristicLab.SimOpt/HeuristicLab.SimOpt.csproj	(revision 637)
@@ -50,19 +50,7 @@
   </ItemGroup>
   <ItemGroup>
-    <Compile Include="DefaultInitializer.cs" />
-    <Compile Include="DefaultManipulator.cs" />
-    <Compile Include="NormalDoubleManipulator.cs" />
-    <Compile Include="NormalIntManipulator.cs" />
-    <Compile Include="PermutationParameterCyclicCrossover.cs" />
-    <Compile Include="PermutationParameterOrderCrossover.cs" />
-    <Compile Include="PermutationParameterPartiallyMatchedCrossover.cs" />
-    <Compile Include="SimOptCrossoverBase.cs" />
+    <Compile Include="SimOptCrossoverPreparator.cs" />
     <Compile Include="SimOptSequentialSubOperatorProcessor.cs" />
     <Compile Include="SimOptSquentialSubOperatorCrossover.cs" />
-    <Compile Include="Swap2PermutationManipulator.cs" />
-    <Compile Include="RandomDoubleInitializer.cs" />
-    <Compile Include="RandomPermutationInitializer.cs" />
-    <Compile Include="SimOptInitializationOperatorBase.cs" />
-    <Compile Include="SimOptManipulationOperatorBase.cs" />
     <Compile Include="DoubleParameterBoundConstraint.cs" />
     <Compile Include="DoubleParameterBoundConstraintView.cs">
@@ -87,9 +75,4 @@
     </Compile>
     <Compile Include="SimOptSinglePointCrossover.cs" />
-    <Compile Include="TranslocationPermutationAdaptiveManipulator.cs" />
-    <Compile Include="TranslocationPermutationManipulator.cs">
-      <SubType>Code</SubType>
-    </Compile>
-    <Compile Include="UniformIntInitializer.cs" />
   </ItemGroup>
   <ItemGroup>
@@ -127,15 +110,11 @@
       <Name>HeuristicLab.Operators</Name>
     </ProjectReference>
-    <ProjectReference Include="..\HeuristicLab.Permutation\HeuristicLab.Permutation.csproj">
-      <Project>{55FDCFB3-3E8C-4FB0-837C-0CF06BEDED39}</Project>
-      <Name>HeuristicLab.Permutation</Name>
-    </ProjectReference>
     <ProjectReference Include="..\HeuristicLab.PluginInfrastructure\HeuristicLab.PluginInfrastructure.csproj">
       <Project>{94186A6A-5176-4402-AE83-886557B53CCA}</Project>
       <Name>HeuristicLab.PluginInfrastructure</Name>
     </ProjectReference>
-    <ProjectReference Include="..\HeuristicLab.Random\HeuristicLab.Random.csproj">
-      <Project>{47019A74-F7F7-482E-83AA-D3F4F777E879}</Project>
-      <Name>HeuristicLab.Random</Name>
+    <ProjectReference Include="..\HeuristicLab.Selection\HeuristicLab.Selection.csproj">
+      <Project>{F7CF0571-25CB-43D5-8443-0843A1E2861A}</Project>
+      <Name>HeuristicLab.Selection</Name>
     </ProjectReference>
   </ItemGroup>
Index: /trunk/sources/HeuristicLab.SimOpt/HeuristicLabSimOptPlugin.cs
===================================================================
--- /trunk/sources/HeuristicLab.SimOpt/HeuristicLabSimOptPlugin.cs	(revision 636)
+++ /trunk/sources/HeuristicLab.SimOpt/HeuristicLabSimOptPlugin.cs	(revision 637)
@@ -32,8 +32,7 @@
   [Dependency(Dependency = "HeuristicLab.Data-3.2")]
   [Dependency(Dependency = "HeuristicLab.Operators-3.2")]
-  [Dependency(Dependency = "HeuristicLab.Random-3.2")]
   [Dependency(Dependency = "HeuristicLab.Constraints-3.2")]
   [Dependency(Dependency = "HeuristicLab.Evolutionary-3.2")]
-  [Dependency(Dependency = "HeuristicLab.Permutation-3.2")]
+  [Dependency(Dependency = "HeuristicLab.Selection-3.2")]
   public class HeuristicLabSimOptPlugin : PluginBase {
   }
Index: unk/sources/HeuristicLab.SimOpt/NormalDoubleManipulator.cs
===================================================================
--- /trunk/sources/HeuristicLab.SimOpt/NormalDoubleManipulator.cs	(revision 636)
+++ 	(revision )
@@ -1,129 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2008 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 System.Globalization;
-using System.Linq;
-using System.Text;
-using System.Xml;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-using HeuristicLab.Random;
-
-namespace HeuristicLab.SimOpt {
-  public class NormalDoubleManipulator : SimOptManipulationOperatorBase {
-    public override string Description {
-      get { return @"Perturbs a DoubleData or ConstrainedDoubleData by a value normal distributed around 0"; }
-    }
-    /*private NormalDistributedRandom myRandom;
-    public NormalDistributedRandom Random {
-      get { return myRandom; }
-      set { myRandom = value; }
-    }
-
-    private double myShakingFactor;
-    public double ShakingFactor {
-      get { return myShakingFactor; }
-      set { myShakingFactor = value; }
-    }*/
-
-    public NormalDoubleManipulator()
-      : base() {
-      AddVariableInfo(new VariableInfo("ShakingFactor", "", typeof(DoubleData), VariableKind.In));
-      /*myRandom = new NormalDistributedRandom(new MersenneTwister(), 0.0, 1.0);
-      myShakingFactor = 1.0;*/
-    }
-
-    /*public override IView CreateView() {
-      return new NormalDoubleManipulatorView(this);
-    }*/
-
-    protected override void Apply(IScope scope, IRandom random, IItem item) {
-      double shakingFactor = GetVariableValue<DoubleData>("ShakingFactor", scope, true).Data;
-      NormalDistributedRandom normal = new NormalDistributedRandom(random, 0.0, shakingFactor);
-      if (item is DoubleData) {
-        ((DoubleData)item).Data += normal.NextDouble();
-        return;
-      } else if (item is ConstrainedDoubleData) {
-        ConstrainedDoubleData data = (item as ConstrainedDoubleData);
-        for (int tries = 100; tries >= 0; tries--) {
-          double newValue = data.Data + normal.NextDouble();
-
-          if (IsIntegerConstrained(data)) {
-            newValue = Math.Round(newValue);
-          }
-          if (data.TrySetData(newValue)) {
-            return;
-          }
-        }
-        throw new InvalidProgramException("Coudn't find a valid value in 100 tries");
-      } else throw new InvalidOperationException("ERROR: NormalDoubleManipulator does not know how to work with " + ((item != null) ? (item.GetType().ToString()) : ("null")) + " data");
-    }
-
-    /*public override void Visit(DoubleData data) {
-      data.Data += (myRandom.NextDouble() dat* myShakingFactor);
-    }
-
-    public override void Visit(ConstrainedDoubleData data) {
-      for (int tries = 100; tries >= 0; tries--) {
-        double newValue = data.Data + myRandom.NextDouble() * myShakingFactor;
-
-        if (IsIntegerConstrained(data)) {
-          newValue = Math.Round(newValue);
-        }
-        if (data.TrySetData(newValue)) {
-          return;
-        }
-      }
-
-      throw new InvalidProgramException("Coudn't find a valid value in 100 tries");
-    }
-
-    #region clone & persistence
-    public override object Clone(IDictionary<Guid, object> clonedObjects) {
-      NormalDoubleManipulator clone = new NormalDoubleManipulator();
-      clonedObjects.Add(Guid, clone);
-      clone.Random = (NormalDistributedRandom)myRandom.Clone(clonedObjects);
-      clone.ShakingFactor = myShakingFactor;
-      return clone;
-    }
-
-    public override XmlNode GetXmlNode(string name, XmlDocument document, IDictionary<Guid, IStorable> persistedObjects) {
-      XmlNode node = base.GetXmlNode(name, document, persistedObjects);
-      XmlNode randomNode = PersistenceManager.Persist("Random", Random, document, persistedObjects);
-      node.AppendChild(randomNode);
-
-      XmlNode shakingFactorNode = document.CreateNode(XmlNodeType.Element, "ShakingFactor", null);
-      shakingFactorNode.InnerText = myShakingFactor.ToString(CultureInfo.InvariantCulture);
-      node.AppendChild(shakingFactorNode);
-
-      return node;
-    }
-
-    public override void Populate(XmlNode node, IDictionary<Guid, IStorable> restoredObjects) {
-      base.Populate(node, restoredObjects);
-      myRandom = (NormalDistributedRandom)PersistenceManager.Restore(node.SelectSingleNode("Random"), restoredObjects);
-      myShakingFactor = double.Parse(node.SelectSingleNode("ShakingFactor").InnerText, CultureInfo.InvariantCulture);
-    }
-    #endregion*/
-  }
-}
Index: unk/sources/HeuristicLab.SimOpt/NormalIntManipulator.cs
===================================================================
--- /trunk/sources/HeuristicLab.SimOpt/NormalIntManipulator.cs	(revision 636)
+++ 	(revision )
@@ -1,59 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2008 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 System.Globalization;
-using System.Linq;
-using System.Text;
-using System.Xml;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-using HeuristicLab.Random;
-
-namespace HeuristicLab.SimOpt {
-  public class NormalIntManipulator : SimOptManipulationOperatorBase {
-    public override string Description {
-      get { return @"Perturbs an IntData or ConstrainedIntData by a value normally distributed around 0"; }
-    }
-
-    public NormalIntManipulator()
-      : base() {
-      AddVariableInfo(new VariableInfo("ShakingFactor", "Strength of the perturbation", typeof(DoubleData), VariableKind.In));
-    }
-
-    protected override void Apply(IScope scope, IRandom random, IItem item) {
-      double shakingFactor = GetVariableValue<DoubleData>("ShakingFactor", scope, true).Data;
-      NormalDistributedRandom normal = new NormalDistributedRandom(random, 0.0, shakingFactor);
-      if (item is IntData) {
-        ((IntData)item).Data += (int)normal.NextDouble();
-        return;
-      } else if (item is ConstrainedIntData) {
-        ConstrainedIntData data = (item as ConstrainedIntData);
-        for (int tries = 100; tries >= 0; tries--) {
-          int newValue = data.Data + (int)normal.NextDouble();
-          if (data.TrySetData(newValue)) return;
-        }
-        throw new InvalidProgramException("Coudn't find a valid value in 100 tries");
-      } else throw new InvalidOperationException("ERROR: UniformIntManipulator does not know how to work with " + ((item != null) ? (item.GetType().ToString()) : ("null")) + " data");
-    }
-  }
-}
Index: unk/sources/HeuristicLab.SimOpt/PermutationParameterCyclicCrossover.cs
===================================================================
--- /trunk/sources/HeuristicLab.SimOpt/PermutationParameterCyclicCrossover.cs	(revision 636)
+++ 	(revision )
@@ -1,43 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2008 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 System.Linq;
-using System.Text;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-
-namespace HeuristicLab.SimOpt {
-  public class PermutationParameterCyclicCrossover : SimOptCrossoverBase {
-    public override string Description {
-      get { return @"Applies a CX on a permutation parameter"; }
-    }
-
-    public PermutationParameterCyclicCrossover()
-      : base() {
-    }
-
-    protected override object Cross(IRandom random, object parent1, object parent2, IScope scope) {
-      return Permutation.CyclicCrossover.Apply(random, (int[])parent1, (int[])parent2);
-    }
-  }
-}
Index: unk/sources/HeuristicLab.SimOpt/PermutationParameterOrderCrossover.cs
===================================================================
--- /trunk/sources/HeuristicLab.SimOpt/PermutationParameterOrderCrossover.cs	(revision 636)
+++ 	(revision )
@@ -1,43 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2008 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 System.Linq;
-using System.Text;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-
-namespace HeuristicLab.SimOpt {
-  public class PermutationParameterOrderCrossover : SimOptCrossoverBase {
-    public override string Description {
-      get { return @"Applies an OX on a permutation parameter"; }
-    }
-
-    public PermutationParameterOrderCrossover()
-      : base() {
-    }
-
-    protected override object Cross(IRandom random, object parent1, object parent2, IScope scope) {
-      return Permutation.OrderCrossover.Apply(random, (int[])parent1, (int[])parent2);
-    }
-  }
-}
Index: unk/sources/HeuristicLab.SimOpt/PermutationParameterPartiallyMatchedCrossover.cs
===================================================================
--- /trunk/sources/HeuristicLab.SimOpt/PermutationParameterPartiallyMatchedCrossover.cs	(revision 636)
+++ 	(revision )
@@ -1,43 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2008 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 System.Linq;
-using System.Text;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-
-namespace HeuristicLab.SimOpt {
-  class PermutationParameterPartiallyMatchedCrossover : SimOptCrossoverBase {
-    public override string Description {
-      get { return @"Applies a PMX on a permutation parameter"; }
-    }
-
-    public PermutationParameterPartiallyMatchedCrossover()
-      : base() {
-    }
-
-    protected override object Cross(IRandom random, object parent1, object parent2, IScope scope) {
-      return Permutation.PartiallyMatchedCrossover.Apply(random, (int[])parent1, (int[])parent2);
-    }
-  }
-}
Index: unk/sources/HeuristicLab.SimOpt/RandomDoubleInitializer.cs
===================================================================
--- /trunk/sources/HeuristicLab.SimOpt/RandomDoubleInitializer.cs	(revision 636)
+++ 	(revision )
@@ -1,61 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2008 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 System.Linq;
-using System.Text;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-
-namespace HeuristicLab.SimOpt {
-  public class RandomDoubleInitializer : SimOptInitializationOperatorBase {
-    public override string Description {
-      get { return @"Initializes a DoubleData or ConstrainedDoubleData randomly in a given interval"; }
-    }
-
-    public RandomDoubleInitializer()
-      : base() {
-      AddVariableInfo(new VariableInfo("Min", "Minimum of the desired value", typeof(DoubleData), VariableKind.In));
-      AddVariableInfo(new VariableInfo("Max", "Maximum of the desired value", typeof(DoubleData), VariableKind.In));
-    }
-
-    protected override void Apply(IScope scope, IRandom random, IItem item) {
-      double min = GetVariableValue<DoubleData>("Min", scope, true).Data;
-      double max = GetVariableValue<DoubleData>("Max", scope, true).Data;
-      if (item is DoubleData) {
-        double r = random.NextDouble();
-        ((DoubleData)item).Data = min + (r * max - r * min);
-        return;
-      } else if (item is ConstrainedDoubleData) {
-        ConstrainedDoubleData data = (item as ConstrainedDoubleData);
-        for (int tries = 100; tries >= 0; tries--) {
-          double r = random.NextDouble();
-          double newValue = min + (r * max - r * min);
-
-          if (IsIntegerConstrained(data)) newValue = Math.Round(newValue);
-          if (data.TrySetData(newValue)) return;
-        }
-        throw new InvalidProgramException("ERROR: RandomDoubleInitializer couldn't find a valid value in 100 tries");
-      } else throw new InvalidOperationException("ERROR: RandomDoubleInitializer does not know how to work with " + ((item != null) ? (item.GetType().ToString()) : ("null")) + " data");
-    }
-  }
-}
Index: unk/sources/HeuristicLab.SimOpt/RandomPermutationInitializer.cs
===================================================================
--- /trunk/sources/HeuristicLab.SimOpt/RandomPermutationInitializer.cs	(revision 636)
+++ 	(revision )
@@ -1,104 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2008 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 System.Linq;
-using System.Text;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-using HeuristicLab.Random;
-
-namespace HeuristicLab.SimOpt {
-  public class RandomPermutationInitializer : SimOptInitializationOperatorBase {
-    public override string Description {
-      get { return @"Randomly initialize a permutation with values ranging from 0 to n-1"; }
-    }
-
-    /*private MersenneTwister myRandom;
-    public MersenneTwister Random {
-      get { return myRandom; }
-      set { myRandom = value; }
-    }*/
-
-    public RandomPermutationInitializer()
-      : base() {
-      //myRandom = new MersenneTwister();
-    }
-
-    protected override void Apply(IScope scope, IRandom random, IItem item) {
-      if (item is Permutation.Permutation || item is IntArrayData) {
-        IntArrayData data = (item as IntArrayData);
-        IList<int> number = new List<int>(data.Data.Length);
-        for (int i = 0; i < data.Data.Length; i++)
-          number.Add(i);
-        for (int i = 0; i < data.Data.Length; i++) {
-          int index = random.Next(number.Count);
-          data.Data[i] = number[index];
-          number.RemoveAt(index);
-        }
-      } else throw new InvalidOperationException("ERROR: RandomPermutationInitializer does not know how to work with " + ((item != null) ? (item.GetType().ToString()) : ("null")) + " data");
-    }
-
-    /*public override IView CreateView() {
-      return new RandomPermutationInitializerView(this);
-    }
-
-    public override void Visit(IntArrayData data) {
-      IList<int> number = new List<int>(data.Data.Length);
-      for (int i = 0; i < data.Data.Length; i++)
-        number.Add(i);
-      for (int i = 0; i < data.Data.Length; i++) {
-        int index = random.Next(number.Count);
-        data.Data[i] = number[index];
-        number.RemoveAt(index);
-      }
-    }
-
-    public override void Visit(ObjectData objectData) {
-      if (objectData is Permutation) {
-        Visit(objectData as IntArrayData);
-      } else throw new NotImplementedException();
-    }
-
-    #region clone & persistence
-    public override object Clone(IDictionary<Guid, object> clonedObjects) {
-      RandomPermutationInitializer clone = new RandomPermutationInitializer();
-      clonedObjects.Add(Guid, clone);
-      clone.Random = (MersenneTwister)myRandom.Clone(clonedObjects);
-      return clone;
-    }
-
-    public override XmlNode GetXmlNode(string name, XmlDocument document, IDictionary<Guid, IStorable> persistedObjects) {
-      XmlNode node = base.GetXmlNode(name, document, persistedObjects);
-      XmlNode randomNode = PersistenceManager.Persist("Random", Random, document, persistedObjects);
-      node.AppendChild(randomNode);
-
-      return node;
-    }
-
-    public override void Populate(XmlNode node, IDictionary<Guid, IStorable> restoredObjects) {
-      base.Populate(node, restoredObjects);
-      myRandom = (MersenneTwister)PersistenceManager.Restore(node.SelectSingleNode("Random"), restoredObjects);
-    }
-    #endregion*/
-  }
-}
Index: unk/sources/HeuristicLab.SimOpt/SimOptCrossoverBase.cs
===================================================================
--- /trunk/sources/HeuristicLab.SimOpt/SimOptCrossoverBase.cs	(revision 636)
+++ 	(revision )
@@ -1,81 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2008 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 System.Linq;
-using System.Text;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-
-namespace HeuristicLab.SimOpt {
-  public abstract class SimOptCrossoverBase : OperatorBase {
-    public SimOptCrossoverBase()
-      : base() {
-      AddVariableInfo(new VariableInfo("Random", "The PRNG to use", typeof(IRandom), VariableKind.In));
-      AddVariableInfo(new VariableInfo("Items", "Paramter vector", typeof(ConstrainedItemList), VariableKind.In | VariableKind.Out));
-      AddVariableInfo(new VariableInfo("Index", "Which parameter to cross", typeof(IntData), VariableKind.In));
-      GetVariableInfo("Index").Local = true;
-      AddVariable(new Variable("Index", new IntData(-1)));
-    }
-
-    public override IOperation Apply(IScope scope) {
-      IRandom random = GetVariableValue<IRandom>("Random", scope, true);
-      ConstrainedItemList childVector = GetVariableValue<ConstrainedItemList>("Items", scope, false);
-      int index = GetVariableValue<IntData>("Index", scope, false).Data;
-      if (index < 0 || index >= childVector.Count) throw new InvalidOperationException("ERROR in SimOptCrossover: Index is out of range of the parameter vector.");
-
-      for (int i = 1; i < scope.SubScopes.Count; i++) {
-        object parent1, parent2;
-        if (i == 1) {
-          IItem p1 = scope.SubScopes[0].GetVariableValue<ConstrainedItemList>("Items", false)[index];
-          if (p1 is IVariable)
-            parent1 = ((((IVariable)p1).Value as IObjectData).Data as ICloneable).Clone();
-          else
-            parent1 = ((p1 as IObjectData).Data as ICloneable).Clone();
-        } else {
-          IItem p1 = childVector[index];
-          if (p1 is IVariable)
-            parent1 = (((IVariable)p1).Value as IObjectData).Data;
-          else
-            parent1 = ((IObjectData)p1).Data;
-        }
-        IItem p2 = scope.SubScopes[i].GetVariableValue<ConstrainedItemList>("Items", false)[index];
-        if (p2 is IVariable)
-          parent2 = (((IVariable)p2).Value as IObjectData).Data;
-        else
-          parent2 = ((IObjectData)p2).Data;
-        
-        object child = Cross(random, parent1, parent2, scope);
-
-        IItem parameter = childVector[index];
-        if (parameter is IVariable)
-          (((IVariable)parameter).Value as IObjectData).Data = child;
-        else {
-          ((IObjectData)parameter).Data = child;
-        }
-      }
-      return null;
-    }
-
-    protected abstract object Cross(IRandom random, object parent1, object parent2, IScope scope);
-  }
-}
Index: /trunk/sources/HeuristicLab.SimOpt/SimOptCrossoverPreparator.cs
===================================================================
--- /trunk/sources/HeuristicLab.SimOpt/SimOptCrossoverPreparator.cs	(revision 637)
+++ /trunk/sources/HeuristicLab.SimOpt/SimOptCrossoverPreparator.cs	(revision 637)
@@ -0,0 +1,44 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+
+namespace HeuristicLab.SimOpt {
+  public class SimOptCrossoverPreparator : OperatorBase {
+    public override string Description {
+      get {
+        return @"Prepares the parent parameters for crossing";
+      }
+    }
+
+    public SimOptCrossoverPreparator()
+      : base() {
+      AddVariableInfo(new VariableInfo("Parents", "Number of parents per child", typeof(IntData), VariableKind.In));
+    }
+
+    public override IOperation Apply(IScope scope) {
+      int parents = GetVariableValue<IntData>("Parents", scope, true).Data;
+      int populationSize = scope.SubScopes.Count;
+      int childrenSize = populationSize / parents;
+      if (populationSize % parents > 0) throw new ArgumentException("ERROR in SimOptCrossoverPreparator: The number of subscopes is not a multiple of the number of parents per child");
+      for (int i = 0; i < childrenSize; i++) {
+        IScope child = new Scope(i.ToString());
+        int parameters = scope.SubScopes[0].SubScopes.Count;
+        for (int k = 0; k < parameters; k++) {
+          child.AddSubScope(new Scope("Parameter_" + (k+1).ToString()));
+          for (int j = 0; j < parents; j++) {
+            IScope param = scope.SubScopes[j].SubScopes[0]; // take scope containing the parameter from the parent
+            child.SubScopes[k].AddSubScope(param); // add it to the child
+            scope.SubScopes[j].RemoveSubScope(param);
+          }
+        }
+        for (int j = 0; j < parents; j++)
+          scope.RemoveSubScope(scope.SubScopes[0]); // remove the parent
+        scope.SubScopes.Add(child); // add the child to the end of the scope list
+      }
+      return null;
+    }
+  }
+}
Index: /trunk/sources/HeuristicLab.SimOpt/SimOptDiscreteMultiCrossover.cs
===================================================================
--- /trunk/sources/HeuristicLab.SimOpt/SimOptDiscreteMultiCrossover.cs	(revision 636)
+++ /trunk/sources/HeuristicLab.SimOpt/SimOptDiscreteMultiCrossover.cs	(revision 637)
@@ -26,5 +26,4 @@
 using HeuristicLab.Data;
 using HeuristicLab.Operators;
-using HeuristicLab.Random;
 using HeuristicLab.Evolutionary;
 
Index: unk/sources/HeuristicLab.SimOpt/SimOptInitializationOperatorBase.cs
===================================================================
--- /trunk/sources/HeuristicLab.SimOpt/SimOptInitializationOperatorBase.cs	(revision 636)
+++ 	(revision )
@@ -1,69 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2008 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 System.Linq;
-using System.Text;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-using HeuristicLab.Constraints;
-
-namespace HeuristicLab.SimOpt {
-  public abstract class SimOptInitializationOperatorBase : OperatorBase {
-
-    public SimOptInitializationOperatorBase()
-      : base() {
-      AddVariableInfo(new VariableInfo("Random", "A (uniform distributed) pseudo random number generator", typeof(IRandom), VariableKind.In));
-      AddVariableInfo(new VariableInfo("Items", "The parameter vector to initialize", typeof(ConstrainedItemList), VariableKind.In | VariableKind.Out));
-      AddVariableInfo(new VariableInfo("Index", "Which index in the parameter vector to initialize", typeof(IntData), VariableKind.In));
-      GetVariableInfo("Index").Local = true;
-      AddVariable(new Variable("Index", new IntData(-1)));
-    }
-
-    public override IOperation Apply(IScope scope) {
-      IRandom random = GetVariableValue<IRandom>("Random", scope, true);
-      ConstrainedItemList parameterVector = GetVariableValue<ConstrainedItemList>("Items", scope, false);
-      IntData index = GetVariableValue<IntData>("Index", scope, false);
-      int i = index.Data;
-      if (i < 0 || i >= parameterVector.Count) throw new IndexOutOfRangeException("ERROR: Index is out of range of the parameter vector");
-      IItem item = parameterVector[i];
-      if (item is Variable) {
-        item = ((Variable)item).Value;
-      }
-      Apply(scope, random, item);
-      return null;
-    }
-
-    protected abstract void Apply(IScope scope, IRandom random, IItem item);
-
-    #region helper functions
-    protected bool IsIntegerConstrained(ConstrainedDoubleData data) {
-      foreach (IConstraint constraint in data.Constraints) {
-        if (constraint is IsIntegerConstraint) {
-          return true;
-        }
-      }
-      return false;
-    }
-    #endregion
-  }
-}
Index: unk/sources/HeuristicLab.SimOpt/SimOptManipulationOperatorBase.cs
===================================================================
--- /trunk/sources/HeuristicLab.SimOpt/SimOptManipulationOperatorBase.cs	(revision 636)
+++ 	(revision )
@@ -1,69 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2008 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 System.Linq;
-using System.Text;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-using HeuristicLab.Constraints;
-
-namespace HeuristicLab.SimOpt {
-  public abstract class SimOptManipulationOperatorBase : OperatorBase {
-
-    public SimOptManipulationOperatorBase()
-      : base() {
-      AddVariableInfo(new VariableInfo("Random", "A (uniform distributed) pseudo random number generator", typeof(IRandom), VariableKind.In));
-      AddVariableInfo(new VariableInfo("Items", "The parameter vector to manipulate", typeof(ConstrainedItemList), VariableKind.In | VariableKind.Out));
-      AddVariableInfo(new VariableInfo("Index", "Which index in the parameter vector to manipulate", typeof(IntData), VariableKind.In));
-      GetVariableInfo("Index").Local = true;
-      AddVariable(new Variable("Index", new IntData(-1)));
-    }
-
-    public override IOperation Apply(IScope scope) {
-      IRandom random = GetVariableValue<IRandom>("Random", scope, true);
-      ConstrainedItemList parameterVector = GetVariableValue<ConstrainedItemList>("Items", scope, false);
-      IntData index = GetVariableValue<IntData>("Index", scope, false);
-      int i = index.Data;
-      if (i < 0 || i >= parameterVector.Count) throw new IndexOutOfRangeException("ERROR: Index is out of range of the parameter vector");
-      IItem item = parameterVector[i];
-      if (item is Variable) {
-        item = ((Variable)item).Value;
-      }
-      Apply(scope, random, item);
-      return null;
-    }
-
-    protected abstract void Apply(IScope scope, IRandom random, IItem item);
-
-    #region helper functions
-    protected bool IsIntegerConstrained(ConstrainedDoubleData data) {
-      foreach (IConstraint constraint in data.Constraints) {
-        if (constraint is IsIntegerConstraint) {
-          return true;
-        }
-      }
-      return false;
-    }
-    #endregion
-  }
-}
Index: /trunk/sources/HeuristicLab.SimOpt/SimOptParameterExtractor.cs
===================================================================
--- /trunk/sources/HeuristicLab.SimOpt/SimOptParameterExtractor.cs	(revision 636)
+++ /trunk/sources/HeuristicLab.SimOpt/SimOptParameterExtractor.cs	(revision 637)
@@ -31,18 +31,31 @@
   public class SimOptParameterExtractor : OperatorBase {
     public override string Description {
-      get { return @"Injects the contents of a ConstrainedItemList into the scope"; }
+      get { return @"Appends each parameter as subscope to the current scope."; }
     }
 
     public SimOptParameterExtractor()
       : base() {
-      AddVariableInfo(new VariableInfo("Items", "The ConstrainedItemList to be extracted", typeof(ConstrainedItemList), VariableKind.In));
+      AddVariableInfo(new VariableInfo("Items", "The ConstrainedItemList to be extracted", typeof(ConstrainedItemList), VariableKind.In | VariableKind.Deleted));
+      AddVariableInfo(new VariableInfo("DeleteItems", "Whether or not to remove items from the current scope", typeof(BoolData), VariableKind.In));
+      AddVariable(new Variable("DeleteItems", new BoolData(false)));
+      GetVariableInfo("DeleteItems").Local = true;
     }
 
     public override IOperation Apply(IScope scope) {
       ConstrainedItemList cil = GetVariableValue<ConstrainedItemList>("Items", scope, false);
+      bool delete = GetVariableValue<BoolData>("DeleteItems", scope, true).Data;
       for (int i = 0; i < cil.Count; i++) {
-        IVariable var = scope.GetVariable(((Variable)cil[i]).Name);
-        if (var == null) scope.AddVariable((IVariable)cil[i].Clone());
-        else var.Value = (IItem)((Variable)cil[i]).Value.Clone();
+        IScope tmp = new Scope(scope.Name + "_Param" + i.ToString());
+        try {
+          scope.AddVariable(cil[i].Clone() as Variable);
+        } catch (InvalidCastException ice) {
+          throw new InvalidCastException("Parameters in the constrained item list have to be encapsulated in a variable!\r\n\r\n" + ice.Message);
+        }
+        scope.AddSubScope(tmp);
+      }
+      if (delete) {
+        IVariableInfo info = GetVariableInfo("Items");
+        if (info.Local) RemoveVariable(info.ActualName);
+        else scope.RemoveVariable(info.ActualName);
       }
       return null;
Index: /trunk/sources/HeuristicLab.SimOpt/SimOptParameterPacker.cs
===================================================================
--- /trunk/sources/HeuristicLab.SimOpt/SimOptParameterPacker.cs	(revision 636)
+++ /trunk/sources/HeuristicLab.SimOpt/SimOptParameterPacker.cs	(revision 637)
@@ -31,23 +31,63 @@
   public class SimOptParameterPacker : OperatorBase {
     public override string Description {
-      get { return @"Updates a ConstrainedItemList with the variables in the scope and removes them afterwards."; }
+      get { return @"Takes the parameters in the subscope and creates or a updates a parameter vector. The order of the subscopes is assumed to be the same as the parameters appear in the vector.
+If the parameter vector could not be updated due to a constraint violation, the first suboperator is returned as the next operation."; }
     }
 
     public SimOptParameterPacker()
       : base() {
-      AddVariableInfo(new VariableInfo("Items", "The ConstrainedItemList to be updated", typeof(ConstrainedItemList), VariableKind.In | VariableKind.Out));
+      AddVariableInfo(new VariableInfo("Items", "The ConstrainedItemList to be updated or created", typeof(ConstrainedItemList), VariableKind.New | VariableKind.In | VariableKind.Out));
+      AddVariableInfo(new VariableInfo("DeleteParameters", "Whether or not the subscopes containing the parameters should be removed afterwards", typeof(BoolData), VariableKind.In));
+      AddVariable(new Variable("DeleteParameters", new BoolData(true)));
+      GetVariableInfo("DeleteParameters").Local = true;
     }
 
     public override IOperation Apply(IScope scope) {
-      ConstrainedItemList cil = GetVariableValue<ConstrainedItemList>("Items", scope, false);
-      for (int i = 0; i < cil.Count; i++) {
-        IVariable var = scope.GetVariable(((Variable)cil[i]).Name);
-        if (var == null) throw new InvalidOperationException("ERROR in SimOptParameterPacker: Cannot find variable " + ((Variable)cil[i]).Name + " in scope");
-        else {
-          ((Variable)cil[i]).Value = (IItem)var.Value.Clone();
-          scope.RemoveVariable(var.Name);
+      // ----- FETCH THE PARAMETER VECTOR ----- //
+      bool updateVector = true;
+      ConstrainedItemList cil;
+      try {
+        cil = GetVariableValue<ConstrainedItemList>("Items", scope, false);
+      } catch (ArgumentException) {
+        updateVector = false;
+        // the parameter vector is fetched from a higher scope and added locally
+        cil = GetVariableValue<ConstrainedItemList>("Items", scope, true);
+      }
+      ConstrainedItemList tempcil = (ConstrainedItemList)cil.Clone();
+      bool delete = GetVariableValue<BoolData>("DeleteParameters", scope, true).Data;
+
+      ICollection<IConstraint> violatedConstraints;
+
+      tempcil.BeginCombinedOperation();
+      // ----- FETCH PARAMETERS AND UPDATE TEMPORARY VECTOR ----- //
+      for (int i = 0; i < scope.SubScopes.Count; i++) {
+        IVariable var = scope.SubScopes[i].GetVariable(((IVariable)tempcil[i]).Name);
+        if (var == null) throw new ArgumentNullException(scope.SubScopes[i].Name, "Could not find parameter " + ((IVariable)tempcil[i]).Name + " in this scope");
+        tempcil.TrySetAt(i, var, out violatedConstraints);
+      }
+
+      // ----- CONSTRAINT HANDLING ----- //
+      IVariableInfo info = GetVariableInfo("Items");
+      bool error = tempcil.EndCombinedOperation(out violatedConstraints);
+      if (!error) {
+        if (!updateVector) {
+          if (info.Local) AddVariable(new Variable(info.ActualName, tempcil));
+          else scope.AddVariable(new Variable(scope.TranslateName("Items"), tempcil));
+        } else {
+          if (info.Local) GetVariable(info.ActualName).Value = tempcil;
+          else scope.GetVariable(scope.TranslateName("Items")).Value = tempcil;
         }
+      } else if (!updateVector) { // in case there was an error and the parameter vector is not in the current scope, add it
+        if (info.Local) AddVariable(new Variable(info.ActualName, cil));
+        else scope.AddVariable(new Variable(scope.TranslateName("Items"), cil));
       }
-      return null;
+
+      // ----- DELETE SUBSCOPES ----- //
+      if (delete) {
+        scope.SubScopes.Clear();
+      }
+
+      if (error) return new AtomicOperation(SubOperators[0], scope);
+      else return null;
     }
   }
Index: /trunk/sources/HeuristicLab.SimOpt/SimOptSequentialSubOperatorProcessor.cs
===================================================================
--- /trunk/sources/HeuristicLab.SimOpt/SimOptSequentialSubOperatorProcessor.cs	(revision 636)
+++ /trunk/sources/HeuristicLab.SimOpt/SimOptSequentialSubOperatorProcessor.cs	(revision 637)
@@ -26,4 +26,5 @@
 using HeuristicLab.Core;
 using HeuristicLab.Data;
+using HeuristicLab.Operators;
 
 namespace HeuristicLab.SimOpt {
@@ -31,5 +32,10 @@
     public override string Description {
       get {
-        return @"Applies its suboperators on the parameter vector one for each index, afterwards it checks if the parameter vector satisfies all the constraints. If not it restores the old parameter vector and tries again until a maximum amount of tries (default: 100) has been reached.";
+        return @"This operator encapsulates the functionality of processing the parameters of a simulation parameter vector. It works as follows:
+1. The parameters are extracted [SimOptParameterExtractor]
+2. The parameters are processed [SequentialSubScopeProcessor which applies the SubOperators of this operator on each parameter]
+3. The parameters are updated again [SimOptParameterPacker]
+
+Should the packing fail due to constraint violations, the operator will retry as often as specified in the variable MaximumTries.";
       }
     }
@@ -42,48 +48,34 @@
       GetVariableInfo("MaximumTries").Local = true;
       AddVariable(new Variable("MaximumTries", new IntData(100)));
-      AddVariable(new Variable("Tries", new IntData(0)));
+      AddVariable(new Variable("Tries", new IntData(1)));
     }
 
     public override IOperation Apply(IScope scope) {
-      ConstrainedItemList parameterVector = GetVariableValue<ConstrainedItemList>("Items", scope, false, false);
-      // Mode: The parameter vector does not yet exist in the current scope
-      if (parameterVector == null) { // the parameter does not yet exist in the current scope
-        parameterVector = GetVariableValue<ConstrainedItemList>("Items", scope, true); // search for it
-        parameterVector = (ConstrainedItemList)parameterVector.Clone(); // clone it
-        scope.AddVariable(new Variable(scope.TranslateName("Items"), parameterVector)); // and add it to the current scope
+
+      int tries = (GetVariable("Tries").Value as IntData).Data;
+      int maxTries = GetVariableValue<IntData>("MaximumTries", scope, true).Data;
+
+      IVariableInfo itemsInfo = GetVariableInfo("Items");
+      SimOptParameterExtractor extractor = new SimOptParameterExtractor();
+      extractor.GetVariableInfo("Items").ActualName = itemsInfo.ActualName;
+
+      SequentialSubScopesProcessor sssp = new SequentialSubScopesProcessor();
+      foreach (IOperator op in SubOperators)
+        sssp.AddSubOperator(op);
+
+      SimOptParameterPacker packer = new SimOptParameterPacker();
+      packer.GetVariableInfo("Items").ActualName = itemsInfo.ActualName;
+      if (tries < maxTries) {
+        SimOptSequentialSubOperatorProcessor sssop = (SimOptSequentialSubOperatorProcessor)this.Clone();
+        (sssop.GetVariable("Tries").Value as IntData).Data = tries + 1;
+        packer.AddSubOperator(this);
       }
-      // Mode: The parameter vector is marked for manipulation/initialization (constraint check is suspended)
-      if (parameterVector.ConstraintCheckSuspended) {
-        ICollection<IConstraint> violatedConstraints;
-        if (parameterVector.EndCombinedOperation(out violatedConstraints)) {
-          ((IntData)GetVariable("Tries").Value).Data = 0;
-          GetVariable("ItemsBackup").Value = new NullData();
-          return null; // manipulation/initialization was successful
-        } else { // restore old vector
-          int maximumTries = GetVariableValue<IntData>("MaximumTries", scope, true).Data;
-          IntData tries = (GetVariable("Tries").Value as IntData);
-          if (tries.Data >= maximumTries) throw new InvalidOperationException("ERROR: no valid solution in " + maximumTries.ToString() + " tries");
-          parameterVector = (ConstrainedItemList)GetVariable("ItemsBackup").Value;
-          scope.GetVariable(scope.TranslateName("Items")).Value = parameterVector;
-          ((IntData)GetVariable("Tries").Value).Data++;
-        }
-      }
-      // perform the sub operators in sequential order on the indices of the parameter vector
-      GetVariable("ItemsBackup").Value = (ConstrainedItemList)parameterVector.Clone();
-      CompositeOperation co = new CompositeOperation();
-      for (int i = 0; i < SubOperators.Count; i++) {
-        if (SubOperators[i].GetVariable("Index") != null) {
-          SubOperators[i].GetVariable("Index").Value = new IntData(i);
-        }
-        if (SubOperators[i].GetVariableInfo("Items") != null) {
-          SubOperators[i].GetVariableInfo("Items").ActualName = GetVariableInfo("Items").ActualName;
-        }
-      }
-      for (int i = 0; i < SubOperators.Count; i++)
-        co.AddOperation(new AtomicOperation(SubOperators[i], scope));
-      // add self to check if the manipulation/initialization did not violate any constraints
-      co.AddOperation(new AtomicOperation(this, scope));
-      parameterVector.BeginCombinedOperation();
-      return co;
+
+      CompositeOperation operation = new CompositeOperation();
+      operation.AddOperation(new AtomicOperation(extractor, scope));
+      operation.AddOperation(new AtomicOperation(sssp, scope));
+      operation.AddOperation(new AtomicOperation(packer, scope));
+
+      return operation;
     }
   }
Index: /trunk/sources/HeuristicLab.SimOpt/SimOptSinglePointCrossover.cs
===================================================================
--- /trunk/sources/HeuristicLab.SimOpt/SimOptSinglePointCrossover.cs	(revision 636)
+++ /trunk/sources/HeuristicLab.SimOpt/SimOptSinglePointCrossover.cs	(revision 637)
@@ -26,5 +26,4 @@
 using HeuristicLab.Data;
 using HeuristicLab.Operators;
-using HeuristicLab.Random;
 using HeuristicLab.Evolutionary;
 
Index: /trunk/sources/HeuristicLab.SimOpt/SimOptSquentialSubOperatorCrossover.cs
===================================================================
--- /trunk/sources/HeuristicLab.SimOpt/SimOptSquentialSubOperatorCrossover.cs	(revision 636)
+++ /trunk/sources/HeuristicLab.SimOpt/SimOptSquentialSubOperatorCrossover.cs	(revision 637)
@@ -24,12 +24,31 @@
 using System.Linq;
 using System.Text;
+using System.Xml;
 using HeuristicLab.Core;
 using HeuristicLab.Data;
-using HeuristicLab.Evolutionary;
+using HeuristicLab.Operators;
+using HeuristicLab.Selection;
 
 namespace HeuristicLab.SimOpt {
   public class SimOptSquentialSubOperatorCrossover : OperatorBase {
+    private UniformSequentialSubScopesProcessor usssp, usssp2, usssp3, usssp4;
+    private SequentialSubScopesProcessor sssp;
+    private SimOptParameterExtractor extractor;
+    private SimOptParameterPacker packer;
+    private SimOptCrossoverPreparator preparator;
+    private MergingReducer merger;
+    private bool uptodate;
+
     public override string Description {
-      get { return @"Takes the parameter vector of two items and on each index applies the respectively indexed suboperator"; }
+      get {
+        return @"This operator encapsulates the functionality of crossing the parameters of a simulation parameter vector. It works as follows:
+1. The parameters of all parents are extracted [UniformSequentialSubScopeProcessor which applies a SimOptParameterExtractor]
+2. The parents are prepared for crossing by grouping the respective parameters [SimOptCrossoverPreparator]
+3. The parameters are crossed [UniformSequentialSubScopeProcessor which applies SequentialSubScopeProcessor which applies the SubOperators of this operator on each parameter group (except for the last one)]
+4. Assigning the crossed parameters to the respective children [MergingReducer]
+5. Update the parameters [UniformSequentialSubScopeProcessor which applies SimOptParameterPacker]
+
+Should the packing fail due to constraint violations, the operator will execute the last of its suboperators.";
+      }
     }
 
@@ -38,36 +57,63 @@
       AddVariableInfo(new VariableInfo("Items", "The parameter vector", typeof(ConstrainedItemList), VariableKind.In | VariableKind.New));
       AddVariableInfo(new VariableInfo("Parents", "The number of parents per child", typeof(IntData), VariableKind.In));
+      uptodate = false;
     }
 
     public override IOperation Apply(IScope scope) {
-      int parents = GetVariableValue<IntData>("Parents", scope, true).Data;
+      string itemsActualName = GetVariableInfo("Items").ActualName;
+      string parentsActualName = GetVariableInfo("Parents").ActualName;
+      int parameters = SubOperators.Count - 1;
 
-      int subScopesCount = scope.SubScopes.Count;
-      if (subScopesCount < parents || (subScopesCount % parents) != 0)
-        throw new InvalidOperationException("Size of mating pool is not a multiple (>1) of the number of parents per child");
-      int children = subScopesCount / parents;
+      if (!uptodate) {
+        usssp = new UniformSequentialSubScopesProcessor();
+        extractor = new SimOptParameterExtractor();
+        usssp.AddSubOperator(extractor);
+
+        preparator = new SimOptCrossoverPreparator();
+
+        usssp2 = new UniformSequentialSubScopesProcessor();
+        sssp = new SequentialSubScopesProcessor();
+        for (int i = 0; i < parameters; i++) {
+          sssp.AddSubOperator(SubOperators[i]);
+        }
+        usssp2.AddSubOperator(sssp);
+
+        usssp3 = new UniformSequentialSubScopesProcessor();
+        merger = new MergingReducer();
+        usssp3.AddSubOperator(merger);
+
+        usssp4 = new UniformSequentialSubScopesProcessor();
+        packer = new SimOptParameterPacker();
+        packer.AddSubOperator(SubOperators[SubOperators.Count - 1]);
+        usssp4.AddSubOperator(packer);
+        uptodate = true;
+      }
+      // Setting the actual names is necessary as the operator does not know if they've changed
+      extractor.GetVariableInfo("Items").ActualName = itemsActualName;
+      preparator.GetVariableInfo("Parents").ActualName = parentsActualName;
+      packer.GetVariableInfo("Items").ActualName = itemsActualName;
 
       CompositeOperation co = new CompositeOperation();
-      for (int i = 0; i < SubOperators.Count; i++) {
-        if (SubOperators[i].GetVariable("Index") != null) {
-          SubOperators[i].GetVariable("Index").Value = new IntData(i);
-        }
-        if (SubOperators[i].GetVariableInfo("Items") != null) {
-          SubOperators[i].GetVariableInfo("Items").ActualName = GetVariableInfo("Items").ActualName;
-        }
-      }
-      for (int i = 0; i < children; i++) {
-        IScope child = (IScope)scope.SubScopes[0].Clone();
-        for (int j = 0; j < parents; j++) {
-          IScope parent = scope.SubScopes[0];
-          child.AddSubScope(parent);
-          scope.RemoveSubScope(parent);
-        }
-        scope.AddSubScope(child);
-        for (int n = 0 ; n < SubOperators.Count ; n++)
-          co.AddOperation(new AtomicOperation(SubOperators[n], child));
-        co.AddOperation(new AtomicOperation(new Operators.SubScopesRemover(), child));
-      }
+      co.AddOperation(new AtomicOperation(usssp, scope));
+      co.AddOperation(new AtomicOperation(preparator, scope));
+      co.AddOperation(new AtomicOperation(usssp2, scope));
+      co.AddOperation(new AtomicOperation(usssp3, scope));
+      co.AddOperation(new AtomicOperation(usssp4, scope));
       return co;
+    }
+
+    protected override void OnSubOperatorAdded(IOperator subOperator, int index) {
+      base.OnSubOperatorAdded(subOperator, index);
+      uptodate = false;
+    }
+
+    protected override void OnSubOperatorRemoved(IOperator subOperator, int index) {
+      base.OnSubOperatorRemoved(subOperator, index);
+      uptodate = false;
+    }
+
+    public override void Populate(XmlNode node, IDictionary<Guid, IStorable> restoredObjects) {
+      base.Populate(node, restoredObjects);
+      uptodate = false;
     }
   }
Index: unk/sources/HeuristicLab.SimOpt/Swap2PermutationManipulator.cs
===================================================================
--- /trunk/sources/HeuristicLab.SimOpt/Swap2PermutationManipulator.cs	(revision 636)
+++ 	(revision )
@@ -1,54 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2008 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 System.Linq;
-using System.Text;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-
-namespace HeuristicLab.SimOpt {
-  public class Swap2PermutationManipulator : SimOptManipulationOperatorBase {
-    public override string Description {
-      get { return @"Swap two elements of a permutation or IntArray"; }
-    }
-
-    public Swap2PermutationManipulator()
-      : base() {
-    }
-
-    protected override void Apply(IScope scope, IRandom random, IItem item) {
-      if (item is Permutation.Permutation || item is IntArrayData) {
-        IntArrayData data = (item as IntArrayData);
-        int x = random.Next(data.Data.Length);
-        int y;
-        do {
-          y = random.Next(data.Data.Length);
-        } while (x == y);
-
-        int h = data.Data[x];
-        data.Data[x] = data.Data[y];
-        data.Data[y] = h;
-      } else throw new InvalidOperationException("ERROR: Swap2PermutationManipulator does not know how to work with " + ((item != null) ? (item.GetType().ToString()) : ("null")) + " data");
-    }
-  }
-}
Index: unk/sources/HeuristicLab.SimOpt/TranslocationPermutationAdaptiveManipulator.cs
===================================================================
--- /trunk/sources/HeuristicLab.SimOpt/TranslocationPermutationAdaptiveManipulator.cs	(revision 636)
+++ 	(revision )
@@ -1,74 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2008 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 System.Linq;
-using System.Text;
-using System.Xml;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-using HeuristicLab.Random;
-
-namespace HeuristicLab.SimOpt {
-  public class TranslocationPermutationAdaptiveManipulator : SimOptManipulationOperatorBase {
-    public override string Description {
-      get { return @"Move a certain number of consecutive elements to a different part in an IntArray or Permutation.
-Uses a shaking factor to provide an upper bound on the length of consecutive elments moved."; }
-    }
-
-    public TranslocationPermutationAdaptiveManipulator()
-      : base() {
-      AddVariableInfo(new VariableInfo("ShakingFactor", "A shaking factor that determines the maximum size of subtours which are to be translocated. The actual value is drawn from a uniform distribution between 1 and this factor (rounded)", typeof(DoubleData), VariableKind.In));
-    }
-
-    protected override void Apply(IScope scope, IRandom random, IItem item) {
-      double shakingFactor = GetVariableValue<DoubleData>("ShakingFactor", scope, true).Data;
-      if (item is Permutation.Permutation || item is IntArrayData) {
-        IntArrayData data = (item as IntArrayData);
-        int l = random.Next(1, (int)Math.Max(Math.Min((int)shakingFactor, data.Data.Length - 1), 2));
-        int x = random.Next(data.Data.Length - l);
-        int y;
-        do {
-          y = random.Next(data.Data.Length - l);
-        } while (x == y);
-
-        int[] h = new int[l];
-        for (int i = 0; i < h.Length; i++)
-          h[i] = data.Data[x + i];
-
-        if (x > y) {
-          while (x > y) {
-            x--;
-            data.Data[x + l] = data.Data[x];
-          }
-        } else {
-          while (x < y) {
-            data.Data[x] = data.Data[x + l];
-            x++;
-          }
-        }
-        for (int i = 0; i < h.Length; i++)
-          data.Data[y + i] = h[i];
-      } else throw new InvalidOperationException("ERROR: PermutationTranslocationManipulator does not know how to work with " + ((item != null) ? (item.GetType().ToString()) : ("null")) + " data");
-    }
-  }
-}
Index: unk/sources/HeuristicLab.SimOpt/TranslocationPermutationManipulator.cs
===================================================================
--- /trunk/sources/HeuristicLab.SimOpt/TranslocationPermutationManipulator.cs	(revision 636)
+++ 	(revision )
@@ -1,71 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2008 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 System.Linq;
-using System.Text;
-using System.Xml;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-using HeuristicLab.Random;
-
-namespace HeuristicLab.SimOpt {
-  public class TranslocationPermutationManipulator : SimOptManipulationOperatorBase {
-    public override string Description {
-      get { return @"Move a certain number of consecutive elements to a different part in an IntArray or Permutation."; }
-    }
-
-    public TranslocationPermutationManipulator()
-      : base() {
-    }
-
-    protected override void Apply(IScope scope, IRandom random, IItem item) {
-      if (item is Permutation.Permutation || item is IntArrayData) {
-        IntArrayData data = (item as IntArrayData);
-        int l = random.Next(1, data.Data.Length - 2);
-        int x = random.Next(data.Data.Length - l);
-        int y;
-        do {
-          y = random.Next(data.Data.Length - l);
-        } while (x == y);
-
-        int[] h = new int[l];
-        for (int i = 0; i < h.Length; i++)
-          h[i] = data.Data[x + i];
-
-        if (x > y) {
-          while (x > y) {
-            x--;
-            data.Data[x + l] = data.Data[x];
-          }
-        } else {
-          while (x < y) {
-            data.Data[x] = data.Data[x + l];
-            x++;
-          }
-        }
-        for (int i = 0; i < h.Length; i++)
-          data.Data[y + i] = h[i];
-      } else throw new InvalidOperationException("ERROR: PermutationTranslocationManipulator does not know how to work with " + ((item != null) ? (item.GetType().ToString()) : ("null")) + " data");
-    }
-  }
-}
Index: unk/sources/HeuristicLab.SimOpt/UniformIntInitializer.cs
===================================================================
--- /trunk/sources/HeuristicLab.SimOpt/UniformIntInitializer.cs	(revision 636)
+++ 	(revision )
@@ -1,60 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2008 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 System.Globalization;
-using System.Linq;
-using System.Text;
-using System.Xml;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-using HeuristicLab.Random;
-
-namespace HeuristicLab.SimOpt {
-  public class UniformIntInitializer : SimOptInitializationOperatorBase {
-    public override string Description {
-      get { return @"Assigns an IntData or ConstrainedIntData a value uniformly distributed in the interval [min;max["; }
-    }
-
-    public UniformIntInitializer()
-      : base() {
-      AddVariableInfo(new VariableInfo("Min", "", typeof(IntData), VariableKind.In));
-      AddVariableInfo(new VariableInfo("Max", "", typeof(IntData), VariableKind.In));
-    }
-
-    protected override void Apply(IScope scope, IRandom random, IItem item) {
-      int min = GetVariableValue<IntData>("Min", scope, true).Data;
-      int max = GetVariableValue<IntData>("Max", scope, true).Data;
-
-      if (item is IntData) {
-        ((IntData)item).Data = random.Next(min, max);
-        return;
-      } else if (item is ConstrainedIntData) {
-        ConstrainedIntData data = (item as ConstrainedIntData);
-        for (int tries = 100; tries >= 0; tries--) {
-          if (data.TrySetData(random.Next(min, max))) return;
-        }
-        throw new InvalidProgramException("Coudn't find a valid value in 100 tries");
-      } else throw new InvalidOperationException("ERROR: UniformIntManipulator does not know how to work with " + ((item != null) ? (item.GetType().ToString()) : ("null")) + " data");
-    }
-  }
-}
