Index: branches/GeneralizedQAP/HeuristicLab.Encodings.PermutationEncoding/3.3/HeuristicLab.Encodings.PermutationEncoding-3.3.csproj
===================================================================
--- branches/GeneralizedQAP/HeuristicLab.Encodings.PermutationEncoding/3.3/HeuristicLab.Encodings.PermutationEncoding-3.3.csproj	(revision 6646)
+++ branches/GeneralizedQAP/HeuristicLab.Encodings.PermutationEncoding/3.3/HeuristicLab.Encodings.PermutationEncoding-3.3.csproj	(revision 6685)
@@ -120,4 +120,5 @@
     <Compile Include="Crossovers\UniformLikeCrossover.cs" />
     <Compile Include="HeuristicLabEncodingsPermutationEncodingPlugin.cs" />
+    <Compile Include="Interfaces\IPermutationScrambleMoveOperator.cs" />
     <Compile Include="Interfaces\IPermutationMultiNeighborhoodShakingOperator.cs" />
     <Compile Include="Interfaces\IPermutationSwap2MoveOperator.cs" />
@@ -139,4 +140,8 @@
     <Compile Include="Moves\Edge.cs" />
     <Compile Include="Moves\PermutationMoveAttribute.cs" />
+    <Compile Include="Moves\Scramble\StochasticScrambleMultiMoveGenerator.cs" />
+    <Compile Include="Moves\Scramble\ScrambleMove.cs" />
+    <Compile Include="Moves\Scramble\ScrambleMoveGenerator.cs" />
+    <Compile Include="Moves\Scramble\ScrambleMoveMaker.cs" />
     <Compile Include="Moves\StandardEdgeEqualityComparer.cs" />
     <Compile Include="Moves\Swap2\ExhaustiveSwap2MoveGenerator.cs" />
Index: branches/GeneralizedQAP/HeuristicLab.Encodings.PermutationEncoding/3.3/Interfaces/IPermutationScrambleMoveOperator.cs
===================================================================
--- branches/GeneralizedQAP/HeuristicLab.Encodings.PermutationEncoding/3.3/Interfaces/IPermutationScrambleMoveOperator.cs	(revision 6685)
+++ branches/GeneralizedQAP/HeuristicLab.Encodings.PermutationEncoding/3.3/Interfaces/IPermutationScrambleMoveOperator.cs	(revision 6685)
@@ -0,0 +1,28 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 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 HeuristicLab.Core;
+
+namespace HeuristicLab.Encodings.PermutationEncoding {
+  public interface IPermutationScrambleMoveOperator : IPermutationMoveOperator {
+    ILookupParameter<ScrambleMove> ScrambleMoveParameter { get; }
+  }
+}
Index: branches/GeneralizedQAP/HeuristicLab.Encodings.PermutationEncoding/3.3/Manipulators/ScrambleManipulator.cs
===================================================================
--- branches/GeneralizedQAP/HeuristicLab.Encodings.PermutationEncoding/3.3/Manipulators/ScrambleManipulator.cs	(revision 6646)
+++ branches/GeneralizedQAP/HeuristicLab.Encodings.PermutationEncoding/3.3/Manipulators/ScrambleManipulator.cs	(revision 6685)
@@ -50,12 +50,10 @@
     /// <param name="permutation">The permutation to manipulate.</param>
     public static void Apply(IRandom random, Permutation permutation) {
-      Permutation original = (Permutation)permutation.Clone();
-
       int breakPoint1, breakPoint2;
       int[] scrambledIndices, remainingIndices, temp;
       int selectedIndex, index;
 
-      breakPoint1 = random.Next(original.Length - 1);
-      breakPoint2 = random.Next(breakPoint1 + 1, original.Length);
+      breakPoint1 = random.Next(permutation.Length - 1);
+      breakPoint2 = random.Next(breakPoint1 + 1, permutation.Length);
 
       scrambledIndices = new int[breakPoint2 - breakPoint1 + 1];
@@ -80,6 +78,11 @@
       }
 
-      for (int i = 0; i <= (breakPoint2 - breakPoint1); i++) {  // scramble permutation between breakpoints
-        permutation[breakPoint1 + i] = original[breakPoint1 + scrambledIndices[i]];
+      Apply(permutation, breakPoint1, scrambledIndices);
+    }
+
+    public static void Apply(Permutation permutation, int startIndex, int[] scrambleArray) {
+      Permutation original = (Permutation)permutation.Clone();
+      for (int i = 0; i < scrambleArray.Length; i++) {  // scramble permutation between breakpoints
+        permutation[startIndex + i] = original[startIndex + scrambleArray[i]];
       }
     }
Index: branches/GeneralizedQAP/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/Scramble/ScrambleMove.cs
===================================================================
--- branches/GeneralizedQAP/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/Scramble/ScrambleMove.cs	(revision 6685)
+++ branches/GeneralizedQAP/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/Scramble/ScrambleMove.cs	(revision 6685)
@@ -0,0 +1,54 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Encodings.PermutationEncoding {
+  [Item("ScrambleMove", "Item that describes a scramble move.")]
+  [StorableClass]
+  public sealed class ScrambleMove : Item {
+    [Storable]
+    public int StartIndex { get; private set; }
+    [Storable]
+    public int[] ScrambledIndices { get; private set; }
+
+    [StorableConstructor]
+    private ScrambleMove(bool deserializing) : base(deserializing) { }
+    private ScrambleMove(ScrambleMove original, Cloner cloner)
+      : base(original, cloner) {
+      this.StartIndex = original.StartIndex;
+      if (original.ScrambledIndices != null)
+        this.ScrambledIndices = (int[])original.ScrambledIndices.Clone();
+    }
+    public ScrambleMove() : this(-1, null) { }
+    public ScrambleMove(int startIndex, int[] scrambledIndices)
+      : base() {
+      this.StartIndex = startIndex;
+      this.ScrambledIndices = scrambledIndices;
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new ScrambleMove(this, cloner);
+    }
+  }
+}
Index: branches/GeneralizedQAP/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/Scramble/ScrambleMoveGenerator.cs
===================================================================
--- branches/GeneralizedQAP/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/Scramble/ScrambleMoveGenerator.cs	(revision 6685)
+++ branches/GeneralizedQAP/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/Scramble/ScrambleMoveGenerator.cs	(revision 6685)
@@ -0,0 +1,67 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Operators;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Encodings.PermutationEncoding {
+  [Item("ScrambleMoveGenerator", "Base class for all scramble move generators.")]
+  [StorableClass]
+  public abstract class ScrambleMoveGenerator : SingleSuccessorOperator, IPermutationScrambleMoveOperator, IMoveGenerator {
+    public override bool CanChangeName {
+      get { return false; }
+    }
+    public ILookupParameter<Permutation> PermutationParameter {
+      get { return (ILookupParameter<Permutation>)Parameters["Permutation"]; }
+    }
+    public ILookupParameter<ScrambleMove> ScrambleMoveParameter {
+      get { return (LookupParameter<ScrambleMove>)Parameters["ScrambleMove"]; }
+    }
+
+    [StorableConstructor]
+    protected ScrambleMoveGenerator(bool deserializing) : base(deserializing) { }
+    protected ScrambleMoveGenerator(ScrambleMoveGenerator original, Cloner cloner) : base(original, cloner) { }
+    public ScrambleMoveGenerator()
+      : base() {
+      Parameters.Add(new LookupParameter<Permutation>("Permutation", "The permutation for which moves should be generated."));
+      Parameters.Add(new LookupParameter<ScrambleMove>("ScrambleMove", "The moves that should be generated in subscopes."));
+    }
+
+    public override IOperation Apply() {
+      IScope scope = ExecutionContext.Scope;
+      Permutation p = PermutationParameter.ActualValue;
+      ScrambleMove[] moves = GenerateMoves(p);
+      Scope[] moveScopes = new Scope[moves.Length];
+      for (int i = 0; i < moveScopes.Length; i++) {
+        moveScopes[i] = new Scope(i.ToString());
+        moveScopes[i].Variables.Add(new Variable(ScrambleMoveParameter.ActualName, moves[i]));
+      }
+      scope.SubScopes.AddRange(moveScopes);
+      return base.Apply();
+    }
+
+    protected abstract ScrambleMove[] GenerateMoves(Permutation permutation);
+  }
+}
Index: branches/GeneralizedQAP/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/Scramble/ScrambleMoveMaker.cs
===================================================================
--- branches/GeneralizedQAP/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/Scramble/ScrambleMoveMaker.cs	(revision 6685)
+++ branches/GeneralizedQAP/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/Scramble/ScrambleMoveMaker.cs	(revision 6685)
@@ -0,0 +1,77 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Operators;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Encodings.PermutationEncoding {
+  [Item("ScrambleMoveMaker", "Peforms a scramble move on a given permutation and updates the quality.")]
+  [StorableClass]
+  public class ScrambleMoveMaker : SingleSuccessorOperator, IPermutationScrambleMoveOperator, IMoveMaker {
+    public override bool CanChangeName {
+      get { return false; }
+    }
+    public ILookupParameter<DoubleValue> QualityParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters["Quality"]; }
+    }
+    public ILookupParameter<DoubleValue> MoveQualityParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters["MoveQuality"]; }
+    }
+    public ILookupParameter<ScrambleMove> ScrambleMoveParameter {
+      get { return (ILookupParameter<ScrambleMove>)Parameters["ScrambleMove"]; }
+    }
+    public ILookupParameter<Permutation> PermutationParameter {
+      get { return (ILookupParameter<Permutation>)Parameters["Permutation"]; }
+    }
+
+    [StorableConstructor]
+    protected ScrambleMoveMaker(bool deserializing) : base(deserializing) { }
+    protected ScrambleMoveMaker(ScrambleMoveMaker original, Cloner cloner) : base(original, cloner) { }
+    public ScrambleMoveMaker()
+      : base() {
+      Parameters.Add(new LookupParameter<DoubleValue>("Quality", "The quality of the solution."));
+      Parameters.Add(new LookupParameter<ScrambleMove>("ScrambleMove", "The move to evaluate."));
+      Parameters.Add(new LookupParameter<DoubleValue>("MoveQuality", "The relative quality of the move."));
+      Parameters.Add(new LookupParameter<Permutation>("Permutation", "The solution as permutation."));
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new ScrambleMoveMaker(this, cloner);
+    }
+
+    public override IOperation Apply() {
+      ScrambleMove move = ScrambleMoveParameter.ActualValue;
+      Permutation permutation = PermutationParameter.ActualValue;
+      DoubleValue moveQuality = MoveQualityParameter.ActualValue;
+      DoubleValue quality = QualityParameter.ActualValue;
+
+      ScrambleManipulator.Apply(permutation, move.StartIndex, move.ScrambledIndices);
+      quality.Value = moveQuality.Value;
+
+      return base.Apply();
+    }
+  }
+}
Index: branches/GeneralizedQAP/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/Scramble/StochasticScrambleMultiMoveGenerator.cs
===================================================================
--- branches/GeneralizedQAP/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/Scramble/StochasticScrambleMultiMoveGenerator.cs	(revision 6685)
+++ branches/GeneralizedQAP/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/Scramble/StochasticScrambleMultiMoveGenerator.cs	(revision 6685)
@@ -0,0 +1,106 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 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.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Encodings.PermutationEncoding {
+  [Item("StochasticScrambleMultiMoveGenerator", "Randomly samples n from all possible scramble moves from a given permutation.")]
+  [StorableClass]
+  public class StochasticScrambleMultiMoveGenerator : ScrambleMoveGenerator, IMultiMoveGenerator, IStochasticOperator {
+    public ILookupParameter<IRandom> RandomParameter {
+      get { return (ILookupParameter<IRandom>)Parameters["Random"]; }
+    }
+    public IValueLookupParameter<IntValue> SampleSizeParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters["SampleSize"]; }
+    }
+
+    public IntValue SampleSize {
+      get { return SampleSizeParameter.Value; }
+      set { SampleSizeParameter.Value = value; }
+    }
+
+    [StorableConstructor]
+    protected StochasticScrambleMultiMoveGenerator(bool deserializing) : base(deserializing) { }
+    protected StochasticScrambleMultiMoveGenerator(StochasticScrambleMultiMoveGenerator original, Cloner cloner) : base(original, cloner) { }
+    public StochasticScrambleMultiMoveGenerator()
+      : base() {
+      Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator."));
+      Parameters.Add(new ValueLookupParameter<IntValue>("SampleSize", "The number of moves to generate."));
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new StochasticScrambleMultiMoveGenerator(this, cloner);
+    }
+
+    public static ScrambleMove GenerateRandomMove(Permutation permutation, IRandom random) {
+      int breakPoint1, breakPoint2;
+      int[] scrambledIndices;
+
+      breakPoint1 = random.Next(permutation.Length);
+      do {
+        breakPoint2 = random.Next(permutation.Length);
+      } while (Math.Abs(breakPoint2 - breakPoint1) <= 1);
+      if (breakPoint2 < breakPoint1) { int h = breakPoint1; breakPoint1 = breakPoint2; breakPoint2 = h; }
+
+      scrambledIndices = new int[breakPoint2 - breakPoint1 + 1];
+      for (int i = 0; i < scrambledIndices.Length; i++)
+        scrambledIndices[i] = i;
+      bool[] moved = new bool[scrambledIndices.Length];
+      bool changed = false;
+      do {
+        for (int i = scrambledIndices.Length - 1; i > 0; i--) {
+          int j = random.Next(i + 1);
+          int t = scrambledIndices[j];
+          scrambledIndices[j] = scrambledIndices[i];
+          scrambledIndices[i] = t;
+          if (scrambledIndices[j] == j) moved[j] = false;
+          else moved[j] = true;
+          if (scrambledIndices[i] == i) moved[i] = false;
+          else moved[i] = true;
+        }
+        changed = moved.Any(x => x);
+      } while (!changed);
+
+      return new ScrambleMove(breakPoint1, scrambledIndices);
+    }
+
+    public static ScrambleMove[] Apply(Permutation permutation, IRandom random, int sampleSize) {
+      int length = permutation.Length;
+      ScrambleMove[] moves = new ScrambleMove[sampleSize];
+      for (int i = 0; i < sampleSize; i++) {
+        moves[i] = GenerateRandomMove(permutation, random);
+      }
+      return moves;
+    }
+
+    protected override ScrambleMove[] GenerateMoves(Permutation permutation) {
+      IRandom random = RandomParameter.ActualValue;
+      return Apply(permutation, random, SampleSizeParameter.ActualValue.Value);
+    }
+  }
+}
