Index: /trunk/sources/HeuristicLab.Algorithms.GradientDescent/3.3/Lbfgs.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.GradientDescent/3.3/Lbfgs.cs	(revision 9438)
+++ /trunk/sources/HeuristicLab.Algorithms.GradientDescent/3.3/Lbfgs.cs	(revision 9439)
@@ -22,4 +22,6 @@
 
 using System;
+using System.Linq;
+using HeuristicLab.Analysis;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
@@ -51,4 +53,5 @@
     public string Filename { get; set; }
 
+    private const string AnalyzerParameterName = "Analyzer";
     private const string MaxIterationsParameterName = "MaxIterations";
     private const string ApproximateGradientsParameterName = "ApproximateGradients";
@@ -58,4 +61,7 @@
 
     #region parameter properties
+    public IValueParameter<IMultiAnalyzer> AnalyzerParameter {
+      get { return (IValueParameter<IMultiAnalyzer>)Parameters[AnalyzerParameterName]; }
+    }
     public IValueParameter<IntValue> MaxIterationsParameter {
       get { return (IValueParameter<IntValue>)Parameters[MaxIterationsParameterName]; }
@@ -72,4 +78,8 @@
     #endregion
     #region properties
+    public IMultiAnalyzer Analyzer {
+      get { return AnalyzerParameter.Value; }
+      set { AnalyzerParameter.Value = value; }
+    }
     public int MaxIterations {
       set { MaxIterationsParameter.Value.Value = value; }
@@ -88,6 +98,4 @@
     [Storable]
     private LbfgsAnalyzer analyzer;
-    [Storable]
-    private LbfgsAnalyzer finalAnalyzer;
     [Storable]
     private Placeholder solutionCreator;
@@ -103,5 +111,4 @@
       updateResults = cloner.Clone(original.updateResults);
       analyzer = cloner.Clone(original.analyzer);
-      finalAnalyzer = cloner.Clone(original.finalAnalyzer);
       solutionCreator = cloner.Clone(original.solutionCreator);
       evaluator = cloner.Clone(original.evaluator);
@@ -110,5 +117,5 @@
     public LbfgsAlgorithm()
       : base() {
-
+      Parameters.Add(new ValueParameter<IMultiAnalyzer>(AnalyzerParameterName, "The analyzers that will be executed on the solution.", new MultiAnalyzer()));
       Parameters.Add(new ValueParameter<IntValue>(MaxIterationsParameterName, "The maximal number of iterations for.", new IntValue(20)));
       Parameters.Add(new ValueParameter<IntValue>(SeedParameterName, "The random seed used to initialize the new pseudo random number generator.", new IntValue(0)));
@@ -127,6 +134,6 @@
       evaluator = new Placeholder();
       updateResults = new LbfgsUpdateResults();
-      analyzer = new LbfgsAnalyzer();
-      finalAnalyzer = new LbfgsAnalyzer();
+      var analyzerPlaceholder = new Placeholder();
+      var finalAnalyzerPlaceholder = new Placeholder();
 
       OperatorGraph.InitialOperator = randomCreator;
@@ -150,5 +157,5 @@
       branch.ConditionParameter.ActualName = makeStep.TerminationCriterionParameter.Name;
       branch.FalseBranch = evaluator;
-      branch.TrueBranch = finalAnalyzer;
+      branch.TrueBranch = finalAnalyzerPlaceholder;
 
       evaluator.Name = "(Evaluator)";
@@ -157,12 +164,16 @@
       updateResults.StateParameter.ActualName = initializer.StateParameter.Name;
       updateResults.ApproximateGradientsParameter.ActualName = ApproximateGradientsParameterName;
-      updateResults.Successor = analyzer;
-
+      updateResults.Successor = analyzerPlaceholder;
+
+      analyzerPlaceholder.Name = "(Analyzer)";
+      analyzerPlaceholder.OperatorParameter.ActualName = AnalyzerParameterName;
+      analyzerPlaceholder.Successor = makeStep;
+
+      finalAnalyzerPlaceholder.Name = "(Analyzer)";
+      finalAnalyzerPlaceholder.OperatorParameter.ActualName = AnalyzerParameterName;
+      finalAnalyzerPlaceholder.Successor = null;
+
+      analyzer = new LbfgsAnalyzer();
       analyzer.StateParameter.ActualName = initializer.StateParameter.Name;
-      analyzer.Successor = makeStep;
-
-      finalAnalyzer.PointsTableParameter.ActualName = analyzer.PointsTableParameter.ActualName;
-      finalAnalyzer.QualityGradientsTableParameter.ActualName = analyzer.QualityGradientsTableParameter.ActualName;
-      finalAnalyzer.QualitiesTableParameter.ActualName = analyzer.QualitiesTableParameter.ActualName;
     }
 
@@ -190,4 +201,6 @@
         solutionCreator.OperatorParameter.ActualName = Problem.SolutionCreatorParameter.Name;
         evaluator.OperatorParameter.ActualName = Problem.EvaluatorParameter.Name;
+        UpdateAnalyzers();
+        ParameterizeOperators();
       }
     }
@@ -203,4 +216,9 @@
       RegisterEvaluatorEvents();
       ParameterizeOperators();
+    }
+
+    protected override void Problem_OperatorsChanged(object sender, EventArgs e) {
+      base.Problem_OperatorsChanged(sender, e);
+      UpdateAnalyzers();
     }
 
@@ -228,4 +246,16 @@
     public override void Prepare() {
       if (Problem != null) base.Prepare();
+    }
+
+    private void UpdateAnalyzers() {
+      Analyzer.Operators.Clear();
+      if (Problem != null) {
+        foreach (var a in Problem.Operators.OfType<IAnalyzer>()) {
+          foreach (var param in a.Parameters.OfType<IScopeTreeLookupParameter>())
+            param.Depth = 0;
+          Analyzer.Operators.Add(a, a.EnabledByDefault);
+        }
+      }
+      Analyzer.Operators.Add(analyzer, analyzer.EnabledByDefault);
     }
 
@@ -238,5 +268,4 @@
         makeStep.PointParameter.ActualName = realVectorParameterName;
         analyzer.PointParameter.ActualName = realVectorParameterName;
-        finalAnalyzer.PointParameter.ActualName = realVectorParameterName;
       }
 
@@ -244,5 +273,4 @@
       updateResults.QualityParameter.ActualName = qualityParameterName;
       analyzer.QualityParameter.ActualName = qualityParameterName;
-      finalAnalyzer.QualityParameter.ActualName = qualityParameterName;
     }
   }
