Index: branches/PerformanceComparison/HeuristicLab.Analysis.FitnessLandscape/3.3/Algorithms/LocalAnalysis.cs
===================================================================
--- branches/PerformanceComparison/HeuristicLab.Analysis.FitnessLandscape/3.3/Algorithms/LocalAnalysis.cs	(revision 13583)
+++ branches/PerformanceComparison/HeuristicLab.Analysis.FitnessLandscape/3.3/Algorithms/LocalAnalysis.cs	(revision 13920)
@@ -61,4 +61,7 @@
       get { return (IFixedValueParameter<IntValue>)Parameters["MaximumIterations"]; }
     }
+    public IFixedValueParameter<IntValue> RepetitionsParameter {
+      get { return (IFixedValueParameter<IntValue>)Parameters["Repetitions"]; }
+    }
     public IValueParameter<MultiAnalyzer> AnalyzerParameter {
       get { return (IValueParameter<MultiAnalyzer>)Parameters["Analyzer"]; }
@@ -70,12 +73,21 @@
 
     #region Properties
-    protected RandomCreator RandomCreator {
+    protected RandomCreator GlobalRandomCreator {
       get { return (RandomCreator)OperatorGraph.InitialOperator; }
     }
+    protected UniformSubScopesProcessor FirstUniformSubScopesProcessor {
+      get { return (UniformSubScopesProcessor)((SubScopesCreator)GlobalRandomCreator.Successor).Successor; }
+    }
+    protected LocalRandomCreator IteratedRandomCreator {
+      get { return (LocalRandomCreator)FirstUniformSubScopesProcessor.Operator; }
+    }
     protected VariableCreator VariableCreator {
-      get { return (VariableCreator)RandomCreator.Successor; }
+      get { return (VariableCreator)IteratedRandomCreator.Successor; }
+    }
+    protected UniformSubScopesProcessor SecondUniformSubScopesProcessor {
+      get { return (UniformSubScopesProcessor)FirstUniformSubScopesProcessor.Successor; }
     }
     protected SolutionsCreator SolutionsCreator {
-      get { return (SolutionsCreator)VariableCreator.Successor; }
+      get { return (SolutionsCreator)SecondUniformSubScopesProcessor.Operator; }
     }
     protected LocalAnalysisMainLoop MainLoop {
@@ -99,12 +111,19 @@
       Parameters.Add(new FixedValueParameter<BoolValue>("SetSeedRandomly", "True if the random seed should be set to a random value, otherwise false.", new BoolValue(true)));
       Parameters.Add(new ConstrainedValueParameter<IManipulator>("Mutator", "Mutation operator."));
-      Parameters.Add(new FixedValueParameter<IntValue>("MaximumIterations", "The maximum number of generations which should be processed.", new IntValue(10000)));
+      Parameters.Add(new FixedValueParameter<IntValue>("MaximumIterations", "The maximum number of generations which should be processed.", new IntValue(100)));
+      Parameters.Add(new FixedValueParameter<IntValue>("Repetitions", "The number of repetitions that should be performed.", new IntValue(10)));
       Parameters.Add(new ValueParameter<MultiAnalyzer>("Analyzer", "The operator used to analyze the solution and moves.", new MultiAnalyzer()));
       Parameters.Add(new FixedValueParameter<T>("Selector", "Selection operator.", selector));
 
       RandomCreator randomCreator = new RandomCreator();
+      SubScopesCreator ssc = new SubScopesCreator();
+      UniformSubScopesProcessor ussp1 = new UniformSubScopesProcessor();
+      UniformSubScopesProcessor ussp2 = new UniformSubScopesProcessor();
+      LocalRandomCreator lrc = new LocalRandomCreator();
       VariableCreator variableCreator = new VariableCreator();
       SolutionsCreator solutionsCreator = new SolutionsCreator();
       LocalAnalysisMainLoop laMainLoop = new LocalAnalysisMainLoop();
+      ResultsCollector collector = new ResultsCollector();
+
       OperatorGraph.InitialOperator = randomCreator;
 
@@ -114,7 +133,27 @@
       randomCreator.SetSeedRandomlyParameter.ActualName = SetSeedRandomlyParameter.Name;
       randomCreator.SetSeedRandomlyParameter.Value = null;
-      randomCreator.Successor = variableCreator;
-
-      variableCreator.Successor = solutionsCreator;
+      randomCreator.Successor = ssc;
+
+      ssc.NumberOfSubScopesParameter.Value = null;
+      ssc.NumberOfSubScopesParameter.ActualName = RepetitionsParameter.Name;
+      ssc.Successor = ussp1;
+
+      ussp1.Depth = new IntValue(1);
+      ussp1.Parallel = new BoolValue(false);
+      ussp1.Operator = lrc;
+      ussp1.Successor = ussp2;
+
+      lrc.GlobalRandomParameter.ActualName = randomCreator.RandomParameter.ActualName;
+      lrc.LocalRandomParameter.ActualName = "IteratedRandom";
+      lrc.Successor = variableCreator;
+
+      var iterResults = new ValueParameter<ResultCollection>("IteratedResults", new ResultCollection());
+      variableCreator.CollectedValues.Add(iterResults);
+      variableCreator.Successor = null;
+
+      ussp2.Depth = new IntValue(1);
+      ussp2.Parallel = new BoolValue(true);
+      ussp2.Operator = solutionsCreator;
+      ussp2.Successor = collector;
 
       solutionsCreator.NumberOfSolutions = new IntValue(1);
@@ -124,12 +163,17 @@
       laMainLoop.SelectorParameter.ActualName = SelectorParameter.Name;
       laMainLoop.MaximumIterationsParameter.ActualName = MaximumIterationsParameter.Name;
-      laMainLoop.RandomParameter.ActualName = RandomCreator.RandomParameter.ActualName;
-      laMainLoop.ResultsParameter.ActualName = "Results";
+      laMainLoop.RandomParameter.ActualName = lrc.LocalRandomParameter.ActualName;
+      laMainLoop.ResultsParameter.ActualName = iterResults.Name;
       laMainLoop.AnalyzerParameter.ActualName = AnalyzerParameter.Name;
 
       qualityTrailAnalyzer = new QualityTrailMultiAnalyzer();
       qualityTrailAnalyzer.UpdateIntervalParameter.Value = null;
-      qualityTrailAnalyzer.UpdateIntervalParameter.ActualName = "MaximumIterations";
+      qualityTrailAnalyzer.UpdateIntervalParameter.ActualName = MaximumIterationsParameter.Name;
       AnalyzerParameter.Value.Operators.Add(qualityTrailAnalyzer, true);
+
+      collector.CollectedValues.Add(new ScopeTreeLookupParameter<ResultCollection>("IteratedResults", 1));
+      collector.ResultsParameter.ActualName = "Results";
+      collector.CopyValue = new BoolValue(false);
+      collector.Successor = null;
 
       RegisterEventHandlers();
@@ -138,4 +182,33 @@
     public override void Prepare() {
       if (Problem != null) base.Prepare();
+    }
+
+    protected override void OnStopped() {
+      var iteratedResults = Results.SingleOrDefault(x => x.Name == "IteratedResults");
+      if (iteratedResults != null) {
+        var rc = iteratedResults.Value as ItemArray<ResultCollection>;
+        if (rc != null) {
+          var results = rc.FirstOrDefault();
+          if (results != null) {
+            var toAvg = results.Select(x => x.Name).ToDictionary(x => x, x => 0.0);
+            foreach (var r in rc) {
+              foreach (var v in r) {
+                if (!toAvg.ContainsKey(v.Name)) continue;
+                var value = v.Value as IntValue;
+                if (value != null) toAvg[v.Name] += value.Value;
+                else {
+                  var doubleValue = v.Value as DoubleValue;
+                  if (doubleValue != null) toAvg[v.Name] += doubleValue.Value;
+                }
+              }
+            }
+
+            foreach (var r in toAvg.Keys.OrderBy(x => x)) {
+              Results.Add(new Result(r, new DoubleValue(toAvg[r] / RepetitionsParameter.Value.Value)));
+            }
+          }
+        }
+      }
+      base.OnStopped();
     }
 
@@ -189,5 +262,5 @@
       MainLoop.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName;
       foreach (var sOp in Problem.Operators.OfType<IStochasticOperator>()) {
-        sOp.RandomParameter.ActualName = RandomCreator.RandomParameter.ActualName;
+        sOp.RandomParameter.ActualName = IteratedRandomCreator.LocalRandomParameter.ActualName;
       }
       foreach (var iOp in Problem.Operators.OfType<IIterationBasedOperator>()) {
@@ -196,9 +269,9 @@
       }
       var sEval = Problem.Evaluator as IStochasticOperator;
-      if (sEval != null) sEval.RandomParameter.ActualName = RandomCreator.RandomParameter.ActualName;
+      if (sEval != null) sEval.RandomParameter.ActualName = IteratedRandomCreator.LocalRandomParameter.ActualName;
       var sCrea = Problem.SolutionCreator as IStochasticOperator;
-      if (sCrea != null) sCrea.RandomParameter.ActualName = RandomCreator.RandomParameter.ActualName;
+      if (sCrea != null) sCrea.RandomParameter.ActualName = IteratedRandomCreator.LocalRandomParameter.ActualName;
       var sSel = SelectorParameter.Value as IStochasticOperator;
-      if (sSel != null) sSel.RandomParameter.ActualName = RandomCreator.RandomParameter.ActualName;
+      if (sSel != null) sSel.RandomParameter.ActualName = IteratedRandomCreator.LocalRandomParameter.ActualName;
       var sel = SelectorParameter.Value as ISelector;
       if (sel != null) {
@@ -211,4 +284,11 @@
         }
       }
+
+      foreach (var op in Problem.Operators.OfType<IParameterizedItem>()) {
+        var resultsParam = op.Parameters.SingleOrDefault(x => x.Name == "Results");
+        var lookupParam = resultsParam as ILookupParameter<ResultCollection>;
+        if (lookupParam == null) continue;
+        lookupParam.ActualName = "IteratedResults";
+      }
     }
     #endregion
