Index: trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessRegression.cs
===================================================================
--- trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessRegression.cs	(revision 8325)
+++ trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessRegression.cs	(revision 8371)
@@ -21,4 +21,5 @@
 #endregion
 
+using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -27,4 +28,5 @@
 using HeuristicLab.Core;
 using HeuristicLab.Data;
+using HeuristicLab.Operators;
 using HeuristicLab.Optimization;
 using HeuristicLab.Parameters;
@@ -34,5 +36,5 @@
 using HeuristicLab.Random;
 
-namespace HeuristicLab.Algorithms.DataAnalysis.GaussianProcess {
+namespace HeuristicLab.Algorithms.DataAnalysis {
   /// <summary>
   ///Gaussian process regression data analysis algorithm.
@@ -41,10 +43,18 @@
   [Creatable("Data Analysis")]
   [StorableClass]
-  public sealed class GaussianProcessRegression : FixedDataAnalysisAlgorithm<IRegressionProblem> {
+  public sealed class GaussianProcessRegression : EngineAlgorithm, IStorableContent {
+    public string Filename { get; set; }
+
+    public override Type ProblemType { get { return typeof(IRegressionProblem); } }
+    public new IRegressionProblem Problem {
+      get { return (IRegressionProblem)base.Problem; }
+      set { base.Problem = value; }
+    }
+
     private const string MeanFunctionParameterName = "MeanFunction";
     private const string CovarianceFunctionParameterName = "CovarianceFunction";
-    private const string MinimizationIterationsParameterName = "MinimizationIterations";
-    private const string NegativeLogLikelihoodTableParameterName = "NegativeLogLikelihoodTable";
-    private const string HyperParametersTableParameterName = "HyperParametersTable";
+    private const string MinimizationIterationsParameterName = "Iterations";
+    //private const string NegativeLogLikelihoodTableParameterName = "NegativeLogLikelihoodTable";
+    //private const string HyperParametersTableParameterName = "HyperParametersTable";
 
     #region parameter properties
@@ -95,7 +105,44 @@
       Parameters.Add(new ConstrainedValueParameter<ICovarianceFunction>(CovarianceFunctionParameterName, "The covariance function to use.",
         new ItemSet<ICovarianceFunction>(covFunctions), covFunctions.First()));
-      Parameters.Add(new ValueParameter<IntValue>(MinimizationIterationsParameterName, "The number of iterations for likelihood optimization.", new IntValue(20)));
+      Parameters.Add(new ValueParameter<IntValue>(MinimizationIterationsParameterName, "The number of iterations for likelihood optimization with BFGS.", new IntValue(20)));
       //Parameters.Add(new LookupParameter<DataTable>(NegativeLogLikelihoodTableParameterName, "The negative log likelihood values over the whole run."));
       //Parameters.Add(new LookupParameter<DataTable>(HyperParametersTableParameterName, "The values of the hyper-parameters over the whole run."));
+
+      var setParameterLength = new GaussianProcessSetHyperparameterLength();
+      var initializer = new BFGSInitializer();
+      var makeStep = new BFGSMakeStep();
+      var branch = new ConditionalBranch();
+      var modelCreator = new GaussianProcessRegressionModelCreator();
+      var updateResults = new BFGSUpdateResults();
+
+      OperatorGraph.InitialOperator = setParameterLength;
+
+      setParameterLength.CovarianceFunctionParameter.ActualName = CovarianceFunctionParameterName;
+      setParameterLength.MeanFunctionParameter.ActualName = MeanFunctionParameterName;
+      setParameterLength.ProblemDataParameter.ActualName = Problem.ProblemDataParameter.Name;
+      setParameterLength.Successor = initializer;
+
+      initializer.IterationsParameter.ActualName = MinimizationIterationsParameterName;
+      initializer.NumberOfHyperparameterParameter.ActualName = setParameterLength.NumberOfHyperparameterParameter.Name;
+      initializer.Successor = makeStep;
+
+      makeStep.BFGSStateParameter.ActualName = initializer.BFGSStateParameter.Name;
+      makeStep.HyperparameterParameter.ActualName = initializer.NumberOfHyperparameterParameter.Name;
+      makeStep.Successor = branch;
+
+      branch.ConditionParameter.ActualName = makeStep.TerminationCriterionParameter.Name;
+      branch.FalseBranch = modelCreator;
+
+      modelCreator.ProblemDataParameter.ActualName = Problem.ProblemDataParameter.Name;
+      modelCreator.MeanFunctionParameter.ActualName = MeanFunctionParameterName;
+      modelCreator.CovarianceFunctionParameter.ActualName = CovarianceFunctionParameterName;
+      modelCreator.HyperparameterParameter.ActualName = initializer.HyperparameterParameter.Name;
+      modelCreator.Successor = updateResults;
+
+      updateResults.BFGSStateParameter.ActualName = initializer.BFGSStateParameter.Name;
+      updateResults.FunctionValueParameter.ActualName = modelCreator.NegativeLogLikelihoodParameter.Name;
+      updateResults.HyperparameterGradientsParameter.ActualName = modelCreator.HyperparameterGradientsParameter.Name;
+      updateResults.Successor = makeStep;
+
     }
     [StorableHook(HookType.AfterDeserialization)]
@@ -105,5 +152,5 @@
       return new GaussianProcessRegression(this, cloner);
     }
-
+    /*
     #region Gaussian process regression
     protected override void Run() {
@@ -215,4 +262,5 @@
 
     #endregion
+     */
   }
 }
