Index: /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessBase.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessBase.cs	(revision 9096)
+++ /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessBase.cs	(revision 9096)
@@ -0,0 +1,185 @@
+
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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.Algorithms.GradientDescent;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Operators;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.PluginInfrastructure;
+using HeuristicLab.Problems.DataAnalysis;
+
+namespace HeuristicLab.Algorithms.DataAnalysis {
+  /// <summary>
+  /// Base class for Gaussian process data analysis algorithms (regression and classification).
+  /// </summary>
+  [StorableClass]
+  public abstract class GaussianProcessBase : EngineAlgorithm {
+    protected const string MeanFunctionParameterName = "MeanFunction";
+    protected const string CovarianceFunctionParameterName = "CovarianceFunction";
+    protected const string MinimizationIterationsParameterName = "Iterations";
+    protected const string ApproximateGradientsParameterName = "ApproximateGradients";
+    protected const string SeedParameterName = "Seed";
+    protected const string SetSeedRandomlyParameterName = "SetSeedRandomly";
+    protected const string ModelCreatorParameterName = "GaussianProcessModelCreator";
+    protected const string NegativeLogLikelihoodParameterName = "NegativeLogLikelihood";
+    protected const string HyperparameterParameterName = "Hyperparameter";
+    protected const string HyperparameterGradientsParameterName = "HyperparameterGradients";
+    protected const string SolutionCreatorParameterName = "GaussianProcessSolutionCreator";
+
+    public new IDataAnalysisProblem Problem {
+      get { return (IDataAnalysisProblem)base.Problem; }
+      set { base.Problem = value; }
+    }
+
+    #region parameter properties
+    public IValueParameter<IMeanFunction> MeanFunctionParameter {
+      get { return (IValueParameter<IMeanFunction>)Parameters[MeanFunctionParameterName]; }
+    }
+    public IValueParameter<ICovarianceFunction> CovarianceFunctionParameter {
+      get { return (IValueParameter<ICovarianceFunction>)Parameters[CovarianceFunctionParameterName]; }
+    }
+    public IValueParameter<IntValue> MinimizationIterationsParameter {
+      get { return (IValueParameter<IntValue>)Parameters[MinimizationIterationsParameterName]; }
+    }
+    public IValueParameter<IntValue> SeedParameter {
+      get { return (IValueParameter<IntValue>)Parameters[SeedParameterName]; }
+    }
+    public IValueParameter<BoolValue> SetSeedRandomlyParameter {
+      get { return (IValueParameter<BoolValue>)Parameters[SetSeedRandomlyParameterName]; }
+    }
+    #endregion
+    #region properties
+    public IMeanFunction MeanFunction {
+      set { MeanFunctionParameter.Value = value; }
+      get { return MeanFunctionParameter.Value; }
+    }
+    public ICovarianceFunction CovarianceFunction {
+      set { CovarianceFunctionParameter.Value = value; }
+      get { return CovarianceFunctionParameter.Value; }
+    }
+    public int MinimizationIterations {
+      set { MinimizationIterationsParameter.Value.Value = value; }
+      get { return MinimizationIterationsParameter.Value.Value; }
+    }
+    public int Seed { get { return SeedParameter.Value.Value; } set { SeedParameter.Value.Value = value; } }
+    public bool SetSeedRandomly { get { return SetSeedRandomlyParameter.Value.Value; } set { SetSeedRandomlyParameter.Value.Value = value; } }
+    #endregion
+
+    [StorableConstructor]
+    protected GaussianProcessBase(bool deserializing) : base(deserializing) { }
+    protected GaussianProcessBase(GaussianProcessBase original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    protected GaussianProcessBase(IDataAnalysisProblem problem)
+      : base() {
+      Problem = problem;
+      Parameters.Add(new ValueParameter<IMeanFunction>(MeanFunctionParameterName, "The mean function to use.", new MeanConst()));
+      Parameters.Add(new ValueParameter<ICovarianceFunction>(CovarianceFunctionParameterName, "The covariance function to use.", new CovarianceSquaredExponentialIso()));
+      Parameters.Add(new ValueParameter<IntValue>(MinimizationIterationsParameterName, "The number of iterations for likelihood optimization with LM-BFGS.", new IntValue(20)));
+      Parameters.Add(new ValueParameter<IntValue>(SeedParameterName, "The random seed used to initialize the new pseudo random number generator.", new IntValue(0)));
+      Parameters.Add(new ValueParameter<BoolValue>(SetSeedRandomlyParameterName, "True if the random seed should be set to a random value, otherwise false.", new BoolValue(true)));
+
+      Parameters.Add(new ValueParameter<BoolValue>(ApproximateGradientsParameterName, "Indicates that gradients should not be approximated (necessary for LM-BFGS).", new BoolValue(false)));
+      Parameters[ApproximateGradientsParameterName].Hidden = true; // should not be changed
+
+      var randomCreator = new HeuristicLab.Random.RandomCreator();
+      var gpInitializer = new GaussianProcessHyperparameterInitializer();
+      var bfgsInitializer = new LbfgsInitializer();
+      var makeStep = new LbfgsMakeStep();
+      var branch = new ConditionalBranch();
+      var modelCreator = new Placeholder();
+      var updateResults = new LbfgsUpdateResults();
+      var analyzer = new LbfgsAnalyzer();
+      var finalModelCreator = new Placeholder();
+      var finalAnalyzer = new LbfgsAnalyzer();
+      var solutionCreator = new Placeholder();
+
+      OperatorGraph.InitialOperator = randomCreator;
+      randomCreator.SeedParameter.ActualName = SeedParameterName;
+      randomCreator.SeedParameter.Value = null;
+      randomCreator.SetSeedRandomlyParameter.ActualName = SetSeedRandomlyParameterName;
+      randomCreator.SetSeedRandomlyParameter.Value = null;
+      randomCreator.Successor = gpInitializer;
+
+      gpInitializer.CovarianceFunctionParameter.ActualName = CovarianceFunctionParameterName;
+      gpInitializer.MeanFunctionParameter.ActualName = MeanFunctionParameterName;
+      gpInitializer.ProblemDataParameter.ActualName = Problem.ProblemDataParameter.Name;
+      gpInitializer.HyperparameterParameter.ActualName = HyperparameterParameterName;
+      gpInitializer.RandomParameter.ActualName = randomCreator.RandomParameter.Name;
+      gpInitializer.Successor = bfgsInitializer;
+
+      bfgsInitializer.IterationsParameter.ActualName = MinimizationIterationsParameterName;
+      bfgsInitializer.PointParameter.ActualName = HyperparameterParameterName;
+      bfgsInitializer.ApproximateGradientsParameter.ActualName = ApproximateGradientsParameterName;
+      bfgsInitializer.Successor = makeStep;
+
+      makeStep.StateParameter.ActualName = bfgsInitializer.StateParameter.Name;
+      makeStep.PointParameter.ActualName = HyperparameterParameterName;
+      makeStep.Successor = branch;
+
+      branch.ConditionParameter.ActualName = makeStep.TerminationCriterionParameter.Name;
+      branch.FalseBranch = modelCreator;
+      branch.TrueBranch = finalModelCreator;
+
+      modelCreator.OperatorParameter.ActualName = ModelCreatorParameterName;
+      modelCreator.Successor = updateResults;
+
+      updateResults.StateParameter.ActualName = bfgsInitializer.StateParameter.Name;
+      updateResults.QualityParameter.ActualName = NegativeLogLikelihoodParameterName;
+      updateResults.QualityGradientsParameter.ActualName = HyperparameterGradientsParameterName;
+      updateResults.ApproximateGradientsParameter.ActualName = ApproximateGradientsParameterName;
+      updateResults.Successor = analyzer;
+
+      analyzer.QualityParameter.ActualName = NegativeLogLikelihoodParameterName;
+      analyzer.PointParameter.ActualName = HyperparameterParameterName;
+      analyzer.QualityGradientsParameter.ActualName = HyperparameterGradientsParameterName;
+      analyzer.StateParameter.ActualName = bfgsInitializer.StateParameter.Name;
+      analyzer.PointsTableParameter.ActualName = "Hyperparameter table";
+      analyzer.QualityGradientsTableParameter.ActualName = "Gradients table";
+      analyzer.QualitiesTableParameter.ActualName = "Negative log likelihood table";
+      analyzer.Successor = makeStep;
+
+      finalModelCreator.OperatorParameter.ActualName = ModelCreatorParameterName;
+      finalModelCreator.Successor = finalAnalyzer;
+
+      finalAnalyzer.QualityParameter.ActualName = NegativeLogLikelihoodParameterName;
+      finalAnalyzer.PointParameter.ActualName = HyperparameterParameterName;
+      finalAnalyzer.QualityGradientsParameter.ActualName = HyperparameterGradientsParameterName;
+      finalAnalyzer.PointsTableParameter.ActualName = analyzer.PointsTableParameter.ActualName;
+      finalAnalyzer.QualityGradientsTableParameter.ActualName = analyzer.QualityGradientsTableParameter.ActualName;
+      finalAnalyzer.QualitiesTableParameter.ActualName = analyzer.QualitiesTableParameter.ActualName;
+      finalAnalyzer.Successor = solutionCreator;
+
+      solutionCreator.OperatorParameter.ActualName = SolutionCreatorParameterName;
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+    }
+  }
+}
Index: /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessClassification.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessClassification.cs	(revision 9095)
+++ /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessClassification.cs	(revision 9096)
@@ -22,4 +22,5 @@
 
 using System;
+using System.Linq;
 using HeuristicLab.Algorithms.GradientDescent;
 using HeuristicLab.Common;
@@ -30,4 +31,5 @@
 using HeuristicLab.Parameters;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.PluginInfrastructure;
 using HeuristicLab.Problems.DataAnalysis;
 
@@ -39,5 +41,5 @@
   [Creatable("Data Analysis")]
   [StorableClass]
-  public sealed class GaussianProcessClassification : EngineAlgorithm, IStorableContent {
+  public sealed class GaussianProcessClassification : GaussianProcessBase, IStorableContent {
     public string Filename { get; set; }
 
@@ -48,43 +50,13 @@
     }
 
-    private const string MeanFunctionParameterName = "MeanFunction";
-    private const string CovarianceFunctionParameterName = "CovarianceFunction";
-    private const string MinimizationIterationsParameterName = "Iterations";
-    private const string ApproximateGradientsParameterName = "ApproximateGradients";
-    private const string SeedParameterName = "Seed";
-    private const string SetSeedRandomlyParameterName = "SetSeedRandomly";
+    private const string ModelParameterName = "Model";
 
     #region parameter properties
-    public IValueParameter<IMeanFunction> MeanFunctionParameter {
-      get { return (IValueParameter<IMeanFunction>)Parameters[MeanFunctionParameterName]; }
+    public IConstrainedValueParameter<IGaussianProcessClassificationModelCreator> ModelCreatorParameter {
+      get { return (IConstrainedValueParameter<IGaussianProcessClassificationModelCreator>)Parameters[ModelCreatorParameterName]; }
     }
-    public IValueParameter<ICovarianceFunction> CovarianceFunctionParameter {
-      get { return (IValueParameter<ICovarianceFunction>)Parameters[CovarianceFunctionParameterName]; }
+    public IFixedValueParameter<GaussianProcessClassificationSolutionCreator> SolutionCreatorParameter {
+      get { return (IFixedValueParameter<GaussianProcessClassificationSolutionCreator>)Parameters[SolutionCreatorParameterName]; }
     }
-    public IValueParameter<IntValue> MinimizationIterationsParameter {
-      get { return (IValueParameter<IntValue>)Parameters[MinimizationIterationsParameterName]; }
-    }
-    public IValueParameter<IntValue> SeedParameter {
-      get { return (IValueParameter<IntValue>)Parameters[SeedParameterName]; }
-    }
-    public IValueParameter<BoolValue> SetSeedRandomlyParameter {
-      get { return (IValueParameter<BoolValue>)Parameters[SetSeedRandomlyParameterName]; }
-    }
-    #endregion
-    #region properties
-    public IMeanFunction MeanFunction {
-      set { MeanFunctionParameter.Value = value; }
-      get { return MeanFunctionParameter.Value; }
-    }
-    public ICovarianceFunction CovarianceFunction {
-      set { CovarianceFunctionParameter.Value = value; }
-      get { return CovarianceFunctionParameter.Value; }
-    }
-    public int MinimizationIterations {
-      set { MinimizationIterationsParameter.Value.Value = value; }
-      get { return MinimizationIterationsParameter.Value.Value; }
-    }
-    public int Seed { get { return SeedParameter.Value.Value; } set { SeedParameter.Value.Value = value; } }
-    public bool SetSeedRandomly { get { return SetSeedRandomlyParameter.Value.Value; } set { SetSeedRandomlyParameter.Value.Value = value; } }
     #endregion
 
@@ -93,104 +65,72 @@
     private GaussianProcessClassification(GaussianProcessClassification original, Cloner cloner)
       : base(original, cloner) {
+      RegisterEventHandlers();
     }
     public GaussianProcessClassification()
-      : base() {
+      : base(new ClassificationProblem()) {
       this.name = ItemName;
       this.description = ItemDescription;
 
-      Problem = new ClassificationProblem();
+      var modelCreators = ApplicationManager.Manager.GetInstances<IGaussianProcessClassificationModelCreator>();
+      var defaultModelCreator = modelCreators.First(c => c is GaussianProcessClassificationModelCreator);
 
-      Parameters.Add(new ValueParameter<IMeanFunction>(MeanFunctionParameterName, "The mean function to use.", new MeanConst()));
-      Parameters.Add(new ValueParameter<ICovarianceFunction>(CovarianceFunctionParameterName, "The covariance function to use.", new CovarianceSquaredExponentialIso()));
-      Parameters.Add(new ValueParameter<IntValue>(MinimizationIterationsParameterName, "The number of iterations for likelihood optimization with LM-BFGS.", new IntValue(20)));
-      Parameters.Add(new ValueParameter<IntValue>(SeedParameterName, "The random seed used to initialize the new pseudo random number generator.", new IntValue(0)));
-      Parameters.Add(new ValueParameter<BoolValue>(SetSeedRandomlyParameterName, "True if the random seed should be set to a random value, otherwise false.", new BoolValue(true)));
+      // GP regression and classification algorithms only differ in the model and solution creators,
+      // thus we use a common base class and use operator parameters to implement the specific versions.
+      // Different model creators can be implemented,
+      // but the solution creator is implemented in a generic fashion already and we don't allow derived solution creators
+      Parameters.Add(new ConstrainedValueParameter<IGaussianProcessClassificationModelCreator>(ModelCreatorParameterName, "The operator to create the Gaussian process model.",
+        new ItemSet<IGaussianProcessClassificationModelCreator>(modelCreators), defaultModelCreator));
+      // this parameter is not intended to be changed, 
+      Parameters.Add(new FixedValueParameter<GaussianProcessClassificationSolutionCreator>(SolutionCreatorParameterName, "The solution creator for the algorithm",
+        new GaussianProcessClassificationSolutionCreator()));
+      Parameters[SolutionCreatorParameterName].Hidden = true;
 
-      Parameters.Add(new ValueParameter<BoolValue>(ApproximateGradientsParameterName, "Indicates that gradients should not be approximated (necessary for LM-BFGS).", new BoolValue(false)));
-      Parameters[ApproximateGradientsParameterName].Hidden = true; // should not be changed
-
-      var randomCreator = new HeuristicLab.Random.RandomCreator();
-      var gpInitializer = new GaussianProcessHyperparameterInitializer();
-      var bfgsInitializer = new LbfgsInitializer();
-      var makeStep = new LbfgsMakeStep();
-      var branch = new ConditionalBranch();
-      var modelCreator = new GaussianProcessClassificationModelCreator();
-      var updateResults = new LbfgsUpdateResults();
-      var analyzer = new LbfgsAnalyzer();
-      var finalModelCreator = new GaussianProcessClassificationModelCreator();
-      var finalAnalyzer = new LbfgsAnalyzer();
-      var solutionCreator = new GaussianProcessClassificationSolutionCreator();
-
-      OperatorGraph.InitialOperator = randomCreator;
-      randomCreator.SeedParameter.ActualName = SeedParameterName;
-      randomCreator.SeedParameter.Value = null;
-      randomCreator.SetSeedRandomlyParameter.ActualName = SetSeedRandomlyParameterName;
-      randomCreator.SetSeedRandomlyParameter.Value = null;
-      randomCreator.Successor = gpInitializer;
-
-      gpInitializer.CovarianceFunctionParameter.ActualName = CovarianceFunctionParameterName;
-      gpInitializer.MeanFunctionParameter.ActualName = MeanFunctionParameterName;
-      gpInitializer.ProblemDataParameter.ActualName = Problem.ProblemDataParameter.Name;
-      gpInitializer.HyperparameterParameter.ActualName = modelCreator.HyperparameterParameter.Name;
-      gpInitializer.RandomParameter.ActualName = randomCreator.RandomParameter.Name;
-      gpInitializer.Successor = bfgsInitializer;
-
-      bfgsInitializer.IterationsParameter.ActualName = MinimizationIterationsParameterName;
-      bfgsInitializer.PointParameter.ActualName = modelCreator.HyperparameterParameter.Name;
-      bfgsInitializer.ApproximateGradientsParameter.ActualName = ApproximateGradientsParameterName;
-      bfgsInitializer.Successor = makeStep;
-
-      makeStep.StateParameter.ActualName = bfgsInitializer.StateParameter.Name;
-      makeStep.PointParameter.ActualName = modelCreator.HyperparameterParameter.Name;
-      makeStep.Successor = branch;
-
-      branch.ConditionParameter.ActualName = makeStep.TerminationCriterionParameter.Name;
-      branch.FalseBranch = modelCreator;
-      branch.TrueBranch = finalModelCreator;
-
-      modelCreator.ProblemDataParameter.ActualName = Problem.ProblemDataParameter.Name;
-      modelCreator.MeanFunctionParameter.ActualName = MeanFunctionParameterName;
-      modelCreator.CovarianceFunctionParameter.ActualName = CovarianceFunctionParameterName;
-      modelCreator.Successor = updateResults;
-
-      updateResults.StateParameter.ActualName = bfgsInitializer.StateParameter.Name;
-      updateResults.QualityParameter.ActualName = modelCreator.NegativeLogLikelihoodParameter.Name;
-      updateResults.QualityGradientsParameter.ActualName = modelCreator.HyperparameterGradientsParameter.Name;
-      updateResults.ApproximateGradientsParameter.ActualName = ApproximateGradientsParameterName;
-      updateResults.Successor = analyzer;
-
-      analyzer.QualityParameter.ActualName = modelCreator.NegativeLogLikelihoodParameter.Name;
-      analyzer.PointParameter.ActualName = modelCreator.HyperparameterParameter.Name;
-      analyzer.QualityGradientsParameter.ActualName = modelCreator.HyperparameterGradientsParameter.Name;
-      analyzer.StateParameter.ActualName = bfgsInitializer.StateParameter.Name;
-      analyzer.PointsTableParameter.ActualName = "Hyperparameter table";
-      analyzer.QualityGradientsTableParameter.ActualName = "Gradients table";
-      analyzer.QualitiesTableParameter.ActualName = "Negative log likelihood table";
-      analyzer.Successor = makeStep;
-
-      finalModelCreator.ProblemDataParameter.ActualName = Problem.ProblemDataParameter.Name;
-      finalModelCreator.MeanFunctionParameter.ActualName = MeanFunctionParameterName;
-      finalModelCreator.CovarianceFunctionParameter.ActualName = CovarianceFunctionParameterName;
-      finalModelCreator.HyperparameterParameter.ActualName = bfgsInitializer.PointParameter.ActualName;
-      finalModelCreator.Successor = finalAnalyzer;
-
-      finalAnalyzer.QualityParameter.ActualName = modelCreator.NegativeLogLikelihoodParameter.Name;
-      finalAnalyzer.PointParameter.ActualName = modelCreator.HyperparameterParameter.Name;
-      finalAnalyzer.QualityGradientsParameter.ActualName = modelCreator.HyperparameterGradientsParameter.Name;
-      finalAnalyzer.PointsTableParameter.ActualName = analyzer.PointsTableParameter.ActualName;
-      finalAnalyzer.QualityGradientsTableParameter.ActualName = analyzer.QualityGradientsTableParameter.ActualName;
-      finalAnalyzer.QualitiesTableParameter.ActualName = analyzer.QualitiesTableParameter.ActualName;
-      finalAnalyzer.Successor = solutionCreator;
-
-      solutionCreator.ModelParameter.ActualName = finalModelCreator.ModelParameter.Name;
-      solutionCreator.ProblemDataParameter.ActualName = Problem.ProblemDataParameter.Name;
+      ParameterizedModelCreators();
+      ParameterizeSolutionCreator(SolutionCreatorParameter.Value);
+      RegisterEventHandlers();
     }
 
+
     [StorableHook(HookType.AfterDeserialization)]
-    private void AfterDeserialization() { }
+    private void AfterDeserialization() {
+      RegisterEventHandlers();
+    }
 
     public override IDeepCloneable Clone(Cloner cloner) {
       return new GaussianProcessClassification(this, cloner);
     }
+
+    #region events
+    private void RegisterEventHandlers() {
+      ModelCreatorParameter.ValueChanged += ModelCreatorParameter_ValueChanged;
+    }
+
+    private void ModelCreatorParameter_ValueChanged(object sender, EventArgs e) {
+      ParameterizedModelCreator(ModelCreatorParameter.Value);
+    }
+    #endregion
+
+    private void ParameterizedModelCreators() {
+      foreach (var creator in ModelCreatorParameter.ValidValues) {
+        ParameterizedModelCreator(creator);
+      }
+    }
+
+    private void ParameterizedModelCreator(IGaussianProcessClassificationModelCreator modelCreator) {
+      modelCreator.ProblemDataParameter.ActualName = Problem.ProblemDataParameter.Name;
+      modelCreator.MeanFunctionParameter.ActualName = MeanFunctionParameterName;
+      modelCreator.CovarianceFunctionParameter.ActualName = CovarianceFunctionParameterName;
+
+      // parameter names fixed by the algorithm
+      modelCreator.ModelParameter.ActualName = ModelParameterName;
+      modelCreator.HyperparameterParameter.ActualName = HyperparameterParameterName;
+      modelCreator.HyperparameterGradientsParameter.ActualName = HyperparameterGradientsParameterName;
+      modelCreator.NegativeLogLikelihoodParameter.ActualName = NegativeLogLikelihoodParameterName;
+    }
+
+    private void ParameterizeSolutionCreator(GaussianProcessClassificationSolutionCreator solutionCreator) {
+      solutionCreator.ModelParameter.ActualName = ModelParameterName;
+      solutionCreator.ProblemDataParameter.ActualName = Problem.ProblemDataParameter.Name;
+    }
   }
 }
Index: /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessClassificationModelCreator.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessClassificationModelCreator.cs	(revision 9095)
+++ /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessClassificationModelCreator.cs	(revision 9096)
@@ -34,5 +34,5 @@
   [Item(Name = "GaussianProcessClassificationModelCreator",
     Description = "Creates a Gaussian process model for least-squares classification given the data, the hyperparameters, a mean function, and a covariance function.")]
-  public sealed class GaussianProcessClassificationModelCreator : GaussianProcessModelCreator {
+  public sealed class GaussianProcessClassificationModelCreator : GaussianProcessModelCreator, IGaussianProcessClassificationModelCreator {
     private const string ProblemDataParameterName = "ProblemData";
 
Index: /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessRegression.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessRegression.cs	(revision 9095)
+++ /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessRegression.cs	(revision 9096)
@@ -22,4 +22,5 @@
 
 using System;
+using System.Linq;
 using HeuristicLab.Algorithms.GradientDescent;
 using HeuristicLab.Common;
@@ -30,4 +31,5 @@
 using HeuristicLab.Parameters;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.PluginInfrastructure;
 using HeuristicLab.Problems.DataAnalysis;
 
@@ -39,5 +41,5 @@
   [Creatable("Data Analysis")]
   [StorableClass]
-  public sealed class GaussianProcessRegression : EngineAlgorithm, IStorableContent {
+  public sealed class GaussianProcessRegression : GaussianProcessBase, IStorableContent {
     public string Filename { get; set; }
 
@@ -48,43 +50,13 @@
     }
 
-    private const string MeanFunctionParameterName = "MeanFunction";
-    private const string CovarianceFunctionParameterName = "CovarianceFunction";
-    private const string MinimizationIterationsParameterName = "Iterations";
-    private const string ApproximateGradientsParameterName = "ApproximateGradients";
-    private const string SeedParameterName = "Seed";
-    private const string SetSeedRandomlyParameterName = "SetSeedRandomly";
+    private const string ModelParameterName = "Model";
 
     #region parameter properties
-    public IValueParameter<IMeanFunction> MeanFunctionParameter {
-      get { return (IValueParameter<IMeanFunction>)Parameters[MeanFunctionParameterName]; }
+    public IConstrainedValueParameter<IGaussianProcessRegressionModelCreator> ModelCreatorParameter {
+      get { return (IConstrainedValueParameter<IGaussianProcessRegressionModelCreator>)Parameters[ModelCreatorParameterName]; }
     }
-    public IValueParameter<ICovarianceFunction> CovarianceFunctionParameter {
-      get { return (IValueParameter<ICovarianceFunction>)Parameters[CovarianceFunctionParameterName]; }
+    public IFixedValueParameter<GaussianProcessRegressionSolutionCreator> SolutionCreatorParameter {
+      get { return (IFixedValueParameter<GaussianProcessRegressionSolutionCreator>)Parameters[SolutionCreatorParameterName]; }
     }
-    public IValueParameter<IntValue> MinimizationIterationsParameter {
-      get { return (IValueParameter<IntValue>)Parameters[MinimizationIterationsParameterName]; }
-    }
-    public IValueParameter<IntValue> SeedParameter {
-      get { return (IValueParameter<IntValue>)Parameters[SeedParameterName]; }
-    }
-    public IValueParameter<BoolValue> SetSeedRandomlyParameter {
-      get { return (IValueParameter<BoolValue>)Parameters[SetSeedRandomlyParameterName]; }
-    }
-    #endregion
-    #region properties
-    public IMeanFunction MeanFunction {
-      set { MeanFunctionParameter.Value = value; }
-      get { return MeanFunctionParameter.Value; }
-    }
-    public ICovarianceFunction CovarianceFunction {
-      set { CovarianceFunctionParameter.Value = value; }
-      get { return CovarianceFunctionParameter.Value; }
-    }
-    public int MinimizationIterations {
-      set { MinimizationIterationsParameter.Value.Value = value; }
-      get { return MinimizationIterationsParameter.Value.Value; }
-    }
-    public int Seed { get { return SeedParameter.Value.Value; } set { SeedParameter.Value.Value = value; } }
-    public bool SetSeedRandomly { get { return SetSeedRandomlyParameter.Value.Value; } set { SetSeedRandomlyParameter.Value.Value = value; } }
     #endregion
 
@@ -93,104 +65,72 @@
     private GaussianProcessRegression(GaussianProcessRegression original, Cloner cloner)
       : base(original, cloner) {
+      RegisterEventHandlers();
     }
     public GaussianProcessRegression()
-      : base() {
+      : base(new RegressionProblem()) {
       this.name = ItemName;
       this.description = ItemDescription;
 
-      Problem = new RegressionProblem();
+      var modelCreators = ApplicationManager.Manager.GetInstances<IGaussianProcessRegressionModelCreator>();
+      var defaultModelCreator = modelCreators.First(c => c is GaussianProcessRegressionModelCreator);
 
-      Parameters.Add(new ValueParameter<IMeanFunction>(MeanFunctionParameterName, "The mean function to use.", new MeanConst()));
-      Parameters.Add(new ValueParameter<ICovarianceFunction>(CovarianceFunctionParameterName, "The covariance function to use.", new CovarianceSquaredExponentialIso()));
-      Parameters.Add(new ValueParameter<IntValue>(MinimizationIterationsParameterName, "The number of iterations for likelihood optimization with LM-BFGS.", new IntValue(20)));
-      Parameters.Add(new ValueParameter<IntValue>(SeedParameterName, "The random seed used to initialize the new pseudo random number generator.", new IntValue(0)));
-      Parameters.Add(new ValueParameter<BoolValue>(SetSeedRandomlyParameterName, "True if the random seed should be set to a random value, otherwise false.", new BoolValue(true)));
+      // GP regression and classification algorithms only differ in the model and solution creators,
+      // thus we use a common base class and use operator parameters to implement the specific versions.
+      // Different model creators can be implemented,
+      // but the solution creator is implemented in a generic fashion already and we don't allow derived solution creators
+      Parameters.Add(new ConstrainedValueParameter<IGaussianProcessRegressionModelCreator>(ModelCreatorParameterName, "The operator to create the Gaussian process model.",
+        new ItemSet<IGaussianProcessRegressionModelCreator>(modelCreators), defaultModelCreator));
+      // this parameter is not intended to be changed, 
+      Parameters.Add(new FixedValueParameter<GaussianProcessRegressionSolutionCreator>(SolutionCreatorParameterName, "The solution creator for the algorithm",
+        new GaussianProcessRegressionSolutionCreator()));
+      Parameters[SolutionCreatorParameterName].Hidden = true;
 
-      Parameters.Add(new ValueParameter<BoolValue>(ApproximateGradientsParameterName, "Indicates that gradients should not be approximated (necessary for LM-BFGS).", new BoolValue(false)));
-      Parameters[ApproximateGradientsParameterName].Hidden = true; // should not be changed
-
-      var randomCreator = new HeuristicLab.Random.RandomCreator();
-      var gpInitializer = new GaussianProcessHyperparameterInitializer();
-      var bfgsInitializer = new LbfgsInitializer();
-      var makeStep = new LbfgsMakeStep();
-      var branch = new ConditionalBranch();
-      var modelCreator = new GaussianProcessRegressionModelCreator();
-      var updateResults = new LbfgsUpdateResults();
-      var analyzer = new LbfgsAnalyzer();
-      var finalModelCreator = new GaussianProcessRegressionModelCreator();
-      var finalAnalyzer = new LbfgsAnalyzer();
-      var solutionCreator = new GaussianProcessRegressionSolutionCreator();
-
-      OperatorGraph.InitialOperator = randomCreator;
-      randomCreator.SeedParameter.ActualName = SeedParameterName;
-      randomCreator.SeedParameter.Value = null;
-      randomCreator.SetSeedRandomlyParameter.ActualName = SetSeedRandomlyParameterName;
-      randomCreator.SetSeedRandomlyParameter.Value = null;
-      randomCreator.Successor = gpInitializer;
-
-      gpInitializer.CovarianceFunctionParameter.ActualName = CovarianceFunctionParameterName;
-      gpInitializer.MeanFunctionParameter.ActualName = MeanFunctionParameterName;
-      gpInitializer.ProblemDataParameter.ActualName = Problem.ProblemDataParameter.Name;
-      gpInitializer.HyperparameterParameter.ActualName = modelCreator.HyperparameterParameter.Name;
-      gpInitializer.RandomParameter.ActualName = randomCreator.RandomParameter.Name;
-      gpInitializer.Successor = bfgsInitializer;
-
-      bfgsInitializer.IterationsParameter.ActualName = MinimizationIterationsParameterName;
-      bfgsInitializer.PointParameter.ActualName = modelCreator.HyperparameterParameter.Name;
-      bfgsInitializer.ApproximateGradientsParameter.ActualName = ApproximateGradientsParameterName;
-      bfgsInitializer.Successor = makeStep;
-
-      makeStep.StateParameter.ActualName = bfgsInitializer.StateParameter.Name;
-      makeStep.PointParameter.ActualName = modelCreator.HyperparameterParameter.Name;
-      makeStep.Successor = branch;
-
-      branch.ConditionParameter.ActualName = makeStep.TerminationCriterionParameter.Name;
-      branch.FalseBranch = modelCreator;
-      branch.TrueBranch = finalModelCreator;
-
-      modelCreator.ProblemDataParameter.ActualName = Problem.ProblemDataParameter.Name;
-      modelCreator.MeanFunctionParameter.ActualName = MeanFunctionParameterName;
-      modelCreator.CovarianceFunctionParameter.ActualName = CovarianceFunctionParameterName;
-      modelCreator.Successor = updateResults;
-
-      updateResults.StateParameter.ActualName = bfgsInitializer.StateParameter.Name;
-      updateResults.QualityParameter.ActualName = modelCreator.NegativeLogLikelihoodParameter.Name;
-      updateResults.QualityGradientsParameter.ActualName = modelCreator.HyperparameterGradientsParameter.Name;
-      updateResults.ApproximateGradientsParameter.ActualName = ApproximateGradientsParameterName;
-      updateResults.Successor = analyzer;
-
-      analyzer.QualityParameter.ActualName = modelCreator.NegativeLogLikelihoodParameter.Name;
-      analyzer.PointParameter.ActualName = modelCreator.HyperparameterParameter.Name;
-      analyzer.QualityGradientsParameter.ActualName = modelCreator.HyperparameterGradientsParameter.Name;
-      analyzer.StateParameter.ActualName = bfgsInitializer.StateParameter.Name;
-      analyzer.PointsTableParameter.ActualName = "Hyperparameter table";
-      analyzer.QualityGradientsTableParameter.ActualName = "Gradients table";
-      analyzer.QualitiesTableParameter.ActualName = "Negative log likelihood table";
-      analyzer.Successor = makeStep;
-
-      finalModelCreator.ProblemDataParameter.ActualName = Problem.ProblemDataParameter.Name;
-      finalModelCreator.MeanFunctionParameter.ActualName = MeanFunctionParameterName;
-      finalModelCreator.CovarianceFunctionParameter.ActualName = CovarianceFunctionParameterName;
-      finalModelCreator.HyperparameterParameter.ActualName = bfgsInitializer.PointParameter.ActualName;
-      finalModelCreator.Successor = finalAnalyzer;
-
-      finalAnalyzer.QualityParameter.ActualName = modelCreator.NegativeLogLikelihoodParameter.Name;
-      finalAnalyzer.PointParameter.ActualName = modelCreator.HyperparameterParameter.Name;
-      finalAnalyzer.QualityGradientsParameter.ActualName = modelCreator.HyperparameterGradientsParameter.Name;
-      finalAnalyzer.PointsTableParameter.ActualName = analyzer.PointsTableParameter.ActualName;
-      finalAnalyzer.QualityGradientsTableParameter.ActualName = analyzer.QualityGradientsTableParameter.ActualName;
-      finalAnalyzer.QualitiesTableParameter.ActualName = analyzer.QualitiesTableParameter.ActualName;
-      finalAnalyzer.Successor = solutionCreator;
-
-      solutionCreator.ModelParameter.ActualName = finalModelCreator.ModelParameter.Name;
-      solutionCreator.ProblemDataParameter.ActualName = Problem.ProblemDataParameter.Name;
+      ParameterizedModelCreators();
+      ParameterizeSolutionCreator(SolutionCreatorParameter.Value);
+      RegisterEventHandlers();
     }
 
+
     [StorableHook(HookType.AfterDeserialization)]
-    private void AfterDeserialization() { }
+    private void AfterDeserialization() {
+      RegisterEventHandlers();
+    }
 
     public override IDeepCloneable Clone(Cloner cloner) {
       return new GaussianProcessRegression(this, cloner);
     }
+
+    #region events
+    private void RegisterEventHandlers() {
+      ModelCreatorParameter.ValueChanged += ModelCreatorParameter_ValueChanged;
+    }
+
+    private void ModelCreatorParameter_ValueChanged(object sender, EventArgs e) {
+      ParameterizedModelCreator(ModelCreatorParameter.Value);
+    }
+    #endregion
+
+    private void ParameterizedModelCreators() {
+      foreach (var creator in ModelCreatorParameter.ValidValues) {
+        ParameterizedModelCreator(creator);
+      }
+    }
+
+    private void ParameterizedModelCreator(IGaussianProcessRegressionModelCreator modelCreator) {
+      modelCreator.ProblemDataParameter.ActualName = Problem.ProblemDataParameter.Name;
+      modelCreator.MeanFunctionParameter.ActualName = MeanFunctionParameterName;
+      modelCreator.CovarianceFunctionParameter.ActualName = CovarianceFunctionParameterName;
+
+      // parameter names fixed by the algorithm
+      modelCreator.ModelParameter.ActualName = ModelParameterName;
+      modelCreator.HyperparameterParameter.ActualName = HyperparameterParameterName;
+      modelCreator.HyperparameterGradientsParameter.ActualName = HyperparameterGradientsParameterName;
+      modelCreator.NegativeLogLikelihoodParameter.ActualName = NegativeLogLikelihoodParameterName;
+    }
+
+    private void ParameterizeSolutionCreator(GaussianProcessRegressionSolutionCreator solutionCreator) {
+      solutionCreator.ModelParameter.ActualName = ModelParameterName;
+      solutionCreator.ProblemDataParameter.ActualName = Problem.ProblemDataParameter.Name;
+    }
   }
 }
Index: /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessRegressionModelCreator.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessRegressionModelCreator.cs	(revision 9095)
+++ /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessRegressionModelCreator.cs	(revision 9096)
@@ -34,5 +34,5 @@
   [Item(Name = "GaussianProcessRegressionModelCreator",
     Description = "Creates a Gaussian process model for regression given the data, the hyperparameters, a mean function, and a covariance function.")]
-  public sealed class GaussianProcessRegressionModelCreator : GaussianProcessModelCreator {
+  public sealed class GaussianProcessRegressionModelCreator : GaussianProcessModelCreator, IGaussianProcessRegressionModelCreator {
     private const string ProblemDataParameterName = "ProblemData";
 
Index: /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/HeuristicLab.Algorithms.DataAnalysis-3.4.csproj
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/HeuristicLab.Algorithms.DataAnalysis-3.4.csproj	(revision 9095)
+++ /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/HeuristicLab.Algorithms.DataAnalysis-3.4.csproj	(revision 9096)
@@ -120,4 +120,5 @@
     </Compile>
     <Compile Include="FixedDataAnalysisAlgorithm.cs" />
+    <Compile Include="GaussianProcess\GaussianProcessBase.cs" />
     <Compile Include="GaussianProcess\CovarianceFunctions\CovarianceConst.cs">
       <SubType>Code</SubType>
@@ -184,4 +185,7 @@
     <Compile Include="GaussianProcess\GaussianProcessRegressionSolution.cs" />
     <Compile Include="GaussianProcess\ICovarianceFunction.cs" />
+    <Compile Include="Interfaces\IGaussianProcessClassificationModelCreator.cs" />
+    <Compile Include="Interfaces\IGaussianProcessRegressionModelCreator.cs" />
+    <Compile Include="Interfaces\IGaussianProcessModelCreator.cs" />
     <Compile Include="Interfaces\IGaussianProcessModel.cs" />
     <Compile Include="Interfaces\IGaussianProcessSolution.cs" />
Index: /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/Interfaces/IGaussianProcessClassificationModelCreator.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/Interfaces/IGaussianProcessClassificationModelCreator.cs	(revision 9096)
+++ /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/Interfaces/IGaussianProcessClassificationModelCreator.cs	(revision 9096)
@@ -0,0 +1,32 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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;
+using HeuristicLab.Problems.DataAnalysis;
+
+namespace HeuristicLab.Algorithms.DataAnalysis {
+  /// <summary>
+  /// Interface to represent a Gaussian process model creator for classification
+  /// </summary>
+  public interface IGaussianProcessClassificationModelCreator : IGaussianProcessModelCreator {
+    ILookupParameter<IClassificationProblemData> ProblemDataParameter { get; }
+  }
+}
Index: /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/Interfaces/IGaussianProcessModelCreator.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/Interfaces/IGaussianProcessModelCreator.cs	(revision 9096)
+++ /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/Interfaces/IGaussianProcessModelCreator.cs	(revision 9096)
@@ -0,0 +1,39 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.RealVectorEncoding;
+using HeuristicLab.Problems.DataAnalysis;
+
+namespace HeuristicLab.Algorithms.DataAnalysis {
+  /// <summary>
+  /// Interface to represent a Gaussian process model creator (either regression or classification)
+  /// </summary>
+  public interface IGaussianProcessModelCreator : IOperator {
+    ILookupParameter<RealVector> HyperparameterParameter { get; }
+    ILookupParameter<IMeanFunction> MeanFunctionParameter { get; }
+    ILookupParameter<ICovarianceFunction> CovarianceFunctionParameter { get; }
+    ILookupParameter<IGaussianProcessModel> ModelParameter { get; }
+    ILookupParameter<RealVector> HyperparameterGradientsParameter { get; }
+    ILookupParameter<DoubleValue> NegativeLogLikelihoodParameter { get; }
+  }
+}
Index: /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/Interfaces/IGaussianProcessRegressionModelCreator.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/Interfaces/IGaussianProcessRegressionModelCreator.cs	(revision 9096)
+++ /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/Interfaces/IGaussianProcessRegressionModelCreator.cs	(revision 9096)
@@ -0,0 +1,32 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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;
+using HeuristicLab.Problems.DataAnalysis;
+
+namespace HeuristicLab.Algorithms.DataAnalysis {
+  /// <summary>
+  /// Interface to represent a Gaussian process model creator for regression
+  /// </summary>
+  public interface IGaussianProcessRegressionModelCreator : IGaussianProcessModelCreator {
+    ILookupParameter<IRegressionProblemData> ProblemDataParameter { get; }
+  }
+}
