Index: /branches/2989_MovingPeaksBenchmark/HeuristicLab.Problems.MovingPeaksBenchmark/3.3/Analyzers/BestMovingPeaksBenchmarkSolutionAnalyzer.cs
===================================================================
--- /branches/2989_MovingPeaksBenchmark/HeuristicLab.Problems.MovingPeaksBenchmark/3.3/Analyzers/BestMovingPeaksBenchmarkSolutionAnalyzer.cs	(revision 16612)
+++ /branches/2989_MovingPeaksBenchmark/HeuristicLab.Problems.MovingPeaksBenchmark/3.3/Analyzers/BestMovingPeaksBenchmarkSolutionAnalyzer.cs	(revision 16613)
@@ -102,11 +102,4 @@
       else i = qualities.Select((x, index) => new { index, x.Value }).OrderByDescending(x => x.Value).First().index;
 
-      if (bestKnownQuality == null ||
-          max && qualities[i].Value > bestKnownQuality.Value
-          || !max && qualities[i].Value < bestKnownQuality.Value) {
-        BestKnownQualityParameter.ActualValue = new DoubleValue(qualities[i].Value);
-        BestKnownSolutionParameter.ActualValue = (RealVector)realVectors[i].Clone();
-      }
-
       RealVector best = (RealVector)realVectors[i].Clone();
       RealVector bestKnown = (RealVector)BestKnownSolutionParameter.ActualValue.Clone();
Index: /branches/2989_MovingPeaksBenchmark/HeuristicLab.Problems.MovingPeaksBenchmark/3.3/MovingPeaksBenchmarkProblem.cs
===================================================================
--- /branches/2989_MovingPeaksBenchmark/HeuristicLab.Problems.MovingPeaksBenchmark/3.3/MovingPeaksBenchmarkProblem.cs	(revision 16612)
+++ /branches/2989_MovingPeaksBenchmark/HeuristicLab.Problems.MovingPeaksBenchmark/3.3/MovingPeaksBenchmarkProblem.cs	(revision 16613)
@@ -71,4 +71,16 @@
       get { return (FixedValueParameter<IntValue>)Parameters["MovingPeaksRandomSeed"]; }
     }
+    public FixedValueParameter<DoubleValue> MinPeakWidthParameter {
+      get { return (FixedValueParameter<DoubleValue>)Parameters["MinPeakWidth"]; }
+    }
+    public FixedValueParameter<DoubleValue> MaxPeakWidthParameter {
+      get { return (FixedValueParameter<DoubleValue>)Parameters["MaxPeakWidth"]; }
+    }
+    public FixedValueParameter<DoubleValue> MinPeakHeightParameter {
+      get { return (FixedValueParameter<DoubleValue>)Parameters["MinPeakHeight"]; }
+    }
+    public FixedValueParameter<DoubleValue> MaxPeakHeightParameter {
+      get { return (FixedValueParameter<DoubleValue>)Parameters["MaxPeakHeight"]; }
+    }
     public FixedValueParameter<IntValue> PeakMovementIntervalParameter {
       get { return (FixedValueParameter<IntValue>)Parameters["PeakMovementInterval"]; }
@@ -109,4 +121,16 @@
     public IntValue MovingPeaksRandomSeed {
       get { return MovingPeaksRandomSeedParameter.Value; }
+    }
+    public DoubleValue MinPeakWidth {
+      get { return MinPeakWidthParameter.Value; }
+    }
+    public DoubleValue MaxPeakWidth {
+      get { return MaxPeakWidthParameter.Value; }
+    }
+    public DoubleValue MinPeakHeight {
+      get { return MinPeakHeightParameter.Value; }
+    }
+    public DoubleValue MaxPeakHeight {
+      get { return MaxPeakHeightParameter.Value; }
     }
     public IntValue PeakMovementInterval {
@@ -140,19 +164,28 @@
         { 09.0, 19.0, 27.0, 67.0, 24.0 },
         { 66.0, 87.0, 65.0, 19.0, 43.0 },
-        { 76.0, 32.0, 43.0, 54.0, 65.0 }
+        { 76.0, 32.0, 43.0, 54.0, 65.0 },
+        { 25.0, 51.0, 17.0, 25.0, 16.0 },
+        { 19.0, 93.0, 06.0, 35.0, 15.0 },
+        { 88.0, 44.0, 37.0, 77.0, 74.0 },
+        { 37.0, 74.0, 55.0, 09.0, 53.0 },
+        { 42.0, 22.0, 93.0, 84.0, 35.0 }
       };
-      var defaultWidths = new double[] { 0.1, 0.1, 0.1, 0.1, 0.1 };
-      var defaultHeights = new double[] { 50.0, 50.0, 50.0, 50.0, 50.0 };
+      var defaultWidths = new double[] { -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0 };
+      var defaultHeights = new double[] { 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0 };
       var defaultBestKnown = new double[] { 08.0, 64.0, 67.0, 55.0, 04.0 };
 
       Parameters.Add(new ValueParameter<DoubleMatrix>("Bounds", "The lower and upper bounds in each dimension.", new DoubleMatrix(defaultBounds)));
       Parameters.Add(new ValueParameter<IntValue>("ProblemSize", "The dimension of the problem.", new IntValue(5)));
-      Parameters.Add(new ValueParameter<IntValue>("Peaks", "The number of peaks.", new IntValue(5)));
+      Parameters.Add(new ValueParameter<IntValue>("Peaks", "The number of peaks.", new IntValue(10)));
       Parameters.Add(new ValueParameter<DoubleMatrix>("InitialPeakLocations", "Initial coordinates of each peaks.", new DoubleMatrix(defaultPeaks)));
       Parameters.Add(new ValueParameter<DoubleArray>("InitialPeakWidths", "Initial width of each peak.", new DoubleArray(defaultWidths)));
       Parameters.Add(new ValueParameter<DoubleArray>("InitialPeakHeights", "Initial height of each peak.", new DoubleArray(defaultHeights)));
       Parameters.Add(new FixedValueParameter<IntValue>("MovingPeaksRandomSeed", "The random seed for initializing the PRNG for changing the peaks.", new IntValue(666)));
-      Parameters.Add(new FixedValueParameter<IntValue>("PeakMovementInterval", "The interval in evaluated solutions in which peaks are moved.", new IntValue(1000)));
-      Parameters.Add(new FixedValueParameter<DoubleValue>("PeakMovementStrength", "The length of the random vector used for changing peak locations.", new DoubleValue(1.0)));
+      Parameters.Add(new FixedValueParameter<DoubleValue>("MinPeakWidth", "The minimum width of each peak.", new DoubleValue(1.0)));
+      Parameters.Add(new FixedValueParameter<DoubleValue>("MaxPeakWidth", "The maximum width of each peak.", new DoubleValue(12.0)));
+      Parameters.Add(new FixedValueParameter<DoubleValue>("MinPeakHeight", "The minimum height of each peak.", new DoubleValue(30.0)));
+      Parameters.Add(new FixedValueParameter<DoubleValue>("MaxPeakHeight", "The maximum height of each peak.", new DoubleValue(70.0)));
+      Parameters.Add(new FixedValueParameter<IntValue>("PeakMovementInterval", "The interval in evaluated solutions in which peaks are moved.", new IntValue(5000)));
+      Parameters.Add(new FixedValueParameter<DoubleValue>("PeakMovementStrength", "The length of the random vector used for changing peak locations.", new DoubleValue(1.5)));
       Parameters.Add(new OptionalValueParameter<RealVector>("BestKnownSolution", "The location of the highest peak.", new RealVector(defaultBestKnown)));
 
Index: /branches/2989_MovingPeaksBenchmark/HeuristicLab.Problems.MovingPeaksBenchmark/3.3/MovingPeaksBenchmarkProblemEvaluator.cs
===================================================================
--- /branches/2989_MovingPeaksBenchmark/HeuristicLab.Problems.MovingPeaksBenchmark/3.3/MovingPeaksBenchmarkProblemEvaluator.cs	(revision 16612)
+++ /branches/2989_MovingPeaksBenchmark/HeuristicLab.Problems.MovingPeaksBenchmark/3.3/MovingPeaksBenchmarkProblemEvaluator.cs	(revision 16613)
@@ -45,4 +45,8 @@
     double offlineErrorSum;
 
+    #region Parameters
+    public ILookupParameter<DoubleMatrix> BoundsParameter {
+      get { return (ILookupParameter<DoubleMatrix>)Parameters["Bounds"]; }
+    }
     public IValueLookupParameter<DoubleMatrix> PeakLocationsParameter {
       get { return (IValueLookupParameter<DoubleMatrix>)Parameters["PeakLocations"]; }
@@ -57,4 +61,16 @@
       get { return (ILookupParameter<IntValue>)Parameters["MovingPeaksRandomSeed"]; }
     }
+    public ILookupParameter<DoubleValue> MinPeakWidthParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters["MinPeakWidth"]; }
+    }
+    public ILookupParameter<DoubleValue> MaxPeakWidthParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters["MaxPeakWidth"]; }
+    }
+    public ILookupParameter<DoubleValue> MinPeakHeightParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters["MinPeakHeight"]; }
+    }
+    public ILookupParameter<DoubleValue> MaxPeakHeightParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters["MaxPeakHeight"]; }
+    }
     public ILookupParameter<IntValue> PeakMovementIntervalParameter {
       get { return (ILookupParameter<IntValue>)Parameters["PeakMovementInterval"]; }
@@ -78,4 +94,5 @@
       get { return (IValueLookupParameter<ResultCollection>)Parameters["Results"]; }
     }
+    #endregion
 
     [StorableConstructor]
@@ -83,4 +100,5 @@
     protected MovingPeaksBenchmarkProblemEvaluator(MovingPeaksBenchmarkProblemEvaluator original, Cloner cloner) : base(original, cloner) { }
     public MovingPeaksBenchmarkProblemEvaluator() : base() {
+      Parameters.Add(new LookupParameter<DoubleMatrix>("Bounds", "The lower and upper bounds in each dimension."));
       Parameters.Add(new ValueLookupParameter<DoubleMatrix>("PeakLocations", "Current position of the peaks."));
       PeakLocationsParameter.ActualName = "InitialPeakLocations";
@@ -90,4 +108,8 @@
       PeakHeightsParameter.ActualName = "InitialPeakHeights";
       Parameters.Add(new LookupParameter<IntValue>("MovingPeaksRandomSeed", "The random seed for initializing the PRNG for changing the peaks."));
+      Parameters.Add(new LookupParameter<DoubleValue>("MinPeakWidth", "The minimum width of each peak."));
+      Parameters.Add(new LookupParameter<DoubleValue>("MaxPeakWidth", "The maximum width of each peak."));
+      Parameters.Add(new LookupParameter<DoubleValue>("MinPeakHeight", "The minimum height of each peak."));
+      Parameters.Add(new LookupParameter<DoubleValue>("MaxPeakHeight", "The maximum height of each peak."));
       Parameters.Add(new LookupParameter<IntValue>("PeakMovementInterval", "The interval in evaluated solutions in which peaks are moved."));
       Parameters.Add(new LookupParameter<DoubleValue>("PeakMovementStrength", "The length of the random vector used for changing peak locations."));
@@ -101,4 +123,11 @@
       PeakWidthsParameter.Hidden = true;
       PeakHeightsParameter.Hidden = true;
+      MovingPeaksRandomSeedParameter.Hidden = true;
+      MinPeakWidthParameter.Hidden = true;
+      MaxPeakWidthParameter.Hidden = true;
+      MinPeakHeightParameter.Hidden = true;
+      MaxPeakHeightParameter.Hidden = true;
+      PeakMovementIntervalParameter.Hidden = true;
+      PeakMovementStrengthParameter.Hidden = true;
       BestKnownQualityParameter.Hidden = true;
       BestKnownSolutionParameter.Hidden = true;
@@ -111,4 +140,11 @@
 
     public override IOperation InstrumentedApply() {
+      lock (this) {
+        if (uniformRandom == null) {
+          uniformRandom = new MersenneTwister();
+          uniformRandom.Reset(MovingPeaksRandomSeedParameter.ActualValue.Value);
+        }
+      }
+
       DoubleMatrix peaks = PeakLocationsParameter.ActualValue;
       DoubleArray widths = PeakWidthsParameter.ActualValue;
@@ -127,14 +163,23 @@
         results.Add(new Result("Current Peak Widths", widths));
         results.Add(new Result("Current Peak Heights", heights));
-      }
-      if (uniformRandom == null) {
-        uniformRandom = new MersenneTwister();
-        uniformRandom.Reset(MovingPeaksRandomSeedParameter.ActualValue.Value);
-      }
-
-      // move peaks if peaks movement interval is reached
+
+        for (int i = 0; i < widths.Length; i++) {
+          if (widths[i] < 0) {
+            widths[i] = MinPeakWidthParameter.ActualValue.Value + uniformRandom.NextDouble() * (MaxPeakWidthParameter.ActualValue.Value - MinPeakWidthParameter.ActualValue.Value);
+          }
+          if (heights[i] < 0) {
+            heights[i] = MinPeakHeightParameter.ActualValue.Value + uniformRandom.NextDouble() * (MaxPeakHeightParameter.ActualValue.Value - MinPeakHeightParameter.ActualValue.Value);
+          }
+        }
+      }
+
       lock (this) {
+        // move peaks if peaks movement interval is reached
         if ((executions % PeakMovementIntervalParameter.ActualValue.Value) == 0) {
-          MovePeaks(uniformRandom, peaks, widths, heights, PeakMovementStrengthParameter.ActualValue.Value);
+          MovePeaks(uniformRandom, peaks, widths, heights,
+                    PeakMovementStrengthParameter.ActualValue.Value,
+                    MinPeakWidthParameter.ActualValue.Value, MaxPeakWidthParameter.ActualValue.Value,
+                    MinPeakHeightParameter.ActualValue.Value, MaxPeakHeightParameter.ActualValue.Value,
+                    BoundsParameter.ActualValue[0, 0], BoundsParameter.ActualValue[0, 1]);
 
           // update best known solution & quality according to highest peak
@@ -202,5 +247,6 @@
     }
 
-    private void MovePeaks(IRandom uniformRandom, DoubleMatrix peaks, DoubleArray widths, DoubleArray heights, double strength) {
+    private void MovePeaks(IRandom uniformRandom, DoubleMatrix peaks, DoubleArray widths, DoubleArray heights, double strength,
+                           double minWidth, double maxWidth, double minHeight, double maxHeight, double minLocation, double maxLocation) {
       IRandom normalRandom = new NormalDistributedRandom(uniformRandom, 0, 1);
       for (int i = 0; i < peaks.Rows; i++) {
@@ -208,7 +254,10 @@
         for (int j = 0; j < v.Length; j++) {
           peaks[i, j] += v[j];
-        }
-        widths[i] = widths[i] + 0.01 * normalRandom.NextDouble();
-        heights[i] = heights[i] + 7 * normalRandom.NextDouble();
+          if (peaks[i, j] < minLocation) peaks[i, j] = minLocation;
+          if (peaks[i, j] > maxLocation) peaks[i, j] = maxLocation;
+        }
+
+        widths[i] = NewRandomValue(normalRandom, widths[i], 1.0, minWidth, maxWidth);
+        heights[i] = NewRandomValue(normalRandom, heights[i], 7, minHeight, maxHeight);
       }
     }
@@ -226,4 +275,13 @@
       return vector;
     }
+
+    private double NewRandomValue(IRandom normalRandom, double value, double factor, double min, double max) {
+      double r, newValue;
+      do {
+        r = normalRandom.NextDouble();
+        newValue = value + factor * r;
+      } while ((newValue < min) || (newValue > max));
+      return newValue;
+    }
   }
 }
