Index: trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/HeuristicLab.GP.StructureIdentification-3.3.csproj
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/HeuristicLab.GP.StructureIdentification-3.3.csproj	(revision 2356)
+++ trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/HeuristicLab.GP.StructureIdentification-3.3.csproj	(revision 2361)
@@ -87,5 +87,5 @@
     <Compile Include="HL3TreeEvaluatorInjector.cs" />
     <Compile Include="HL2TreeEvaluatorInjector.cs" />
-    <Compile Include="OffspringSelectionGP.cs" />
+    <Compile Include="OffspringSelectionGPRegression.cs" />
     <Compile Include="PredictorBuilder.cs" />
     <Compile Include="Predictor.cs" />
@@ -98,7 +98,5 @@
       <DependentUpon>PredictorView.cs</DependentUpon>
     </Compile>
-    <Compile Include="StandardGP.cs">
-      <SubType>Code</SubType>
-    </Compile>
+    <Compile Include="StandardGPRegression.cs" />
     <Compile Include="Symbols\Addition.cs" />
     <Compile Include="Symbols\And.cs" />
Index: trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/OffspringSelectionGP.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/OffspringSelectionGP.cs	(revision 2356)
+++ 	(revision )
@@ -1,177 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2008 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.Collections.Generic;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-using HeuristicLab.Evolutionary;
-using HeuristicLab.Logging;
-using HeuristicLab.Operators;
-using HeuristicLab.Selection;
-using HeuristicLab.Selection.OffspringSelection;
-using HeuristicLab.Modeling;
-using HeuristicLab.DataAnalysis;
-
-namespace HeuristicLab.GP.StructureIdentification {
-  public class OffspringSelectionGP : HeuristicLab.GP.Algorithms.OffspringSelectionGP, IAlgorithm {
-    public override string Name { get { return "OffspringSelectionGP - StructureIdentification"; } }
-
-    public virtual int TargetVariable {
-      get { return ProblemInjector.GetVariableValue<IntData>("TargetVariable", null, false).Data; }
-      set { ProblemInjector.GetVariableValue<IntData>("TargetVariable", null, false).Data = value; }
-    }
-
-    public virtual Dataset Dataset {
-      get { return ProblemInjector.GetVariableValue<Dataset>("Dataset", null, false); }
-      set { ProblemInjector.GetVariable("Dataset").Value = value; }
-    }
-
-    public virtual IAnalyzerModel Model {
-      get {
-        if (!Engine.Terminated)
-          throw new InvalidOperationException("The algorithm is still running. Wait until the algorithm is terminated to retrieve the result.");
-        else
-          return CreateGPModel();
-      }
-    }
-
-    public virtual double PunishmentFactor {
-      get { return GetVariableInjector().GetVariable("PunishmentFactor").GetValue<DoubleData>().Data; }
-      set { GetVariableInjector().GetVariable("PunishmentFactor").GetValue<DoubleData>().Data = value; }
-    }
-
-    public override IOperator ProblemInjector {
-      get { return GetProblemInjector().OperatorGraph.InitialOperator.SubOperators[0]; }
-      set {
-        value.Name = "ProblemInjector";
-        CombinedOperator problemInjector = GetProblemInjector();
-        problemInjector.OperatorGraph.RemoveOperator(ProblemInjector.Guid);
-        problemInjector.OperatorGraph.AddOperator(value);
-        problemInjector.OperatorGraph.InitialOperator.AddSubOperator(value, 0);
-      }
-    }
-
-    public OffspringSelectionGP()
-      : base() {
-      PunishmentFactor = 10.0;
-    }
-
-    protected override IOperator CreateFunctionLibraryInjector() {
-      return DefaultStructureIdentificationOperators.CreateFunctionLibraryInjector();
-    }
-
-    protected override IOperator CreateProblemInjector() {
-      return DefaultRegressionOperators.CreateProblemInjector();
-    }
-
-    protected override IOperator CreateInitialPopulationEvaluator() {
-      return DefaultStructureIdentificationOperators.CreateInitialPopulationEvaluator();
-    }
-
-    protected override IOperator CreateEvaluationOperator() {
-      return DefaultStructureIdentificationOperators.CreateEvaluator();
-    }
-
-
-    protected override IOperator CreateGenerationStepHook() {
-      return DefaultStructureIdentificationOperators.CreateGenerationStepHook();
-    }
-
-    protected override VariableInjector CreateGlobalInjector() {
-      VariableInjector injector = base.CreateGlobalInjector();
-      injector.AddVariable(new HeuristicLab.Core.Variable("PunishmentFactor", new DoubleData()));
-      return injector;
-    }
-
-
-    protected override IOperator CreateLoggingOperator() {
-      CombinedOperator loggingOperator = new CombinedOperator();
-      loggingOperator.Name = "Logging";
-      SequentialProcessor seq = new SequentialProcessor();
-
-      DataCollector collector = new DataCollector();
-      ItemList<StringData> names = collector.GetVariable("VariableNames").GetValue<ItemList<StringData>>();
-      names.Add(new StringData("BestQuality"));
-      names.Add(new StringData("AverageQuality"));
-      names.Add(new StringData("WorstQuality"));
-      names.Add(new StringData("BestValidationQuality"));
-      names.Add(new StringData("AverageValidationQuality"));
-      names.Add(new StringData("WorstValidationQuality"));
-      names.Add(new StringData("EvaluatedSolutions"));
-      names.Add(new StringData("SelectionPressure"));
-      QualityLogger qualityLogger = new QualityLogger();
-      QualityLogger validationQualityLogger = new QualityLogger();
-      validationQualityLogger.GetVariableInfo("Quality").ActualName = "ValidationQuality";
-      validationQualityLogger.GetVariableInfo("QualityLog").ActualName = "ValidationQualityLog";
-      seq.AddSubOperator(collector);
-      seq.AddSubOperator(qualityLogger);
-      seq.AddSubOperator(validationQualityLogger);
-
-      loggingOperator.OperatorGraph.AddOperator(seq);
-      loggingOperator.OperatorGraph.InitialOperator = seq;
-      return loggingOperator;
-    }
-
-    protected override IOperator CreatePostProcessingOperator() {
-      CombinedOperator op = new CombinedOperator();
-      op.Name = "ModelAnalyser";
-      SequentialProcessor seq = new SequentialProcessor();
-      seq.AddSubOperator(DefaultStructureIdentificationOperators.CreatePreparationForPostProcessingOperator());
-
-      UniformSequentialSubScopesProcessor subScopesProc = new UniformSequentialSubScopesProcessor();
-      SequentialProcessor solutionProc = new SequentialProcessor();
-      solutionProc.AddSubOperator(CreateModelAnalyzerOperator());
-
-      subScopesProc.AddSubOperator(solutionProc);
-      seq.AddSubOperator(subScopesProc);
-
-      op.OperatorGraph.AddOperator(seq);
-      op.OperatorGraph.InitialOperator = seq;
-      return op;
-    }
-
-    protected virtual IOperator CreateModelAnalyzerOperator() {
-      return DefaultRegressionOperators.CreatePostProcessingOperator();
-    }
-
-    public override object Clone(IDictionary<Guid, object> clonedObjects) {
-      OffspringSelectionGP clone = (OffspringSelectionGP)base.Clone(clonedObjects);
-      clone.PunishmentFactor = PunishmentFactor;
-      return clone;
-    }
-
-    protected CombinedOperator GetProblemInjector() {
-      return (CombinedOperator)GetInitializationOperator().SubOperators[0];
-    }
-
-    protected virtual IAnalyzerModel CreateGPModel() {
-      IScope bestModelScope = Engine.GlobalScope.SubScopes[0];
-      var model = new AnalyzerModel();
-
-      model.SetMetaData("SelectionPressure", bestModelScope.GetVariableValue<DoubleData>("SelectionPressure", false).Data);
-      DefaultStructureIdentificationOperators.PopulateAnalyzerModel(bestModelScope, model);
-      DefaultRegressionOperators.PopulateAnalyzerModel(bestModelScope, model);
-
-      return model;
-    }
-  }
-}
Index: trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/OffspringSelectionGPRegression.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/OffspringSelectionGPRegression.cs	(revision 2361)
+++ trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/OffspringSelectionGPRegression.cs	(revision 2361)
@@ -0,0 +1,171 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2008 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.Collections.Generic;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Evolutionary;
+using HeuristicLab.Logging;
+using HeuristicLab.Operators;
+using HeuristicLab.Selection;
+using HeuristicLab.Selection.OffspringSelection;
+using HeuristicLab.Modeling;
+using HeuristicLab.DataAnalysis;
+
+namespace HeuristicLab.GP.StructureIdentification {
+  public class OffspringSelectionGPRegression : HeuristicLab.GP.Algorithms.OffspringSelectionGP, IAlgorithm {
+    public override string Name { get { return "OffspringSelectionGP - StructureIdentification"; } }
+
+    public virtual int TargetVariable {
+      get { return ProblemInjector.GetVariableValue<IntData>("TargetVariable", null, false).Data; }
+      set { ProblemInjector.GetVariableValue<IntData>("TargetVariable", null, false).Data = value; }
+    }
+
+    public virtual Dataset Dataset {
+      get { return ProblemInjector.GetVariableValue<Dataset>("Dataset", null, false); }
+      set { ProblemInjector.GetVariable("Dataset").Value = value; }
+    }
+
+    public virtual IAnalyzerModel Model {
+      get {
+        if (!Engine.Terminated)
+          throw new InvalidOperationException("The algorithm is still running. Wait until the algorithm is terminated to retrieve the result.");
+        else
+          return CreateGPModel();
+      }
+    }
+
+    public virtual double PunishmentFactor {
+      get { return GetVariableInjector().GetVariable("PunishmentFactor").GetValue<DoubleData>().Data; }
+      set { GetVariableInjector().GetVariable("PunishmentFactor").GetValue<DoubleData>().Data = value; }
+    }
+
+    public override IOperator ProblemInjector {
+      get { return GetProblemInjector().OperatorGraph.InitialOperator.SubOperators[0]; }
+      set {
+        value.Name = "ProblemInjector";
+        CombinedOperator problemInjector = GetProblemInjector();
+        problemInjector.OperatorGraph.RemoveOperator(ProblemInjector.Guid);
+        problemInjector.OperatorGraph.AddOperator(value);
+        problemInjector.OperatorGraph.InitialOperator.AddSubOperator(value, 0);
+      }
+    }
+
+    public OffspringSelectionGPRegression()
+      : base() {
+      PunishmentFactor = 10.0;
+    }
+
+    protected override IOperator CreateFunctionLibraryInjector() {
+      return DefaultStructureIdentificationOperators.CreateFunctionLibraryInjector();
+    }
+
+    protected override IOperator CreateProblemInjector() {
+      return DefaultRegressionOperators.CreateProblemInjector();
+    }
+
+    protected override IOperator CreateInitialPopulationEvaluator() {
+      return DefaultStructureIdentificationOperators.CreateInitialPopulationEvaluator();
+    }
+
+    protected override IOperator CreateEvaluationOperator() {
+      return DefaultStructureIdentificationOperators.CreateEvaluator();
+    }
+
+
+    protected override IOperator CreateGenerationStepHook() {
+      return DefaultStructureIdentificationOperators.CreateGenerationStepHook();
+    }
+
+    protected override VariableInjector CreateGlobalInjector() {
+      VariableInjector injector = base.CreateGlobalInjector();
+      injector.AddVariable(new HeuristicLab.Core.Variable("PunishmentFactor", new DoubleData()));
+      return injector;
+    }
+
+
+    protected override IOperator CreateLoggingOperator() {
+      CombinedOperator loggingOperator = new CombinedOperator();
+      loggingOperator.Name = "Logging";
+      SequentialProcessor seq = new SequentialProcessor();
+
+      DataCollector collector = new DataCollector();
+      ItemList<StringData> names = collector.GetVariable("VariableNames").GetValue<ItemList<StringData>>();
+      names.Add(new StringData("BestQuality"));
+      names.Add(new StringData("AverageQuality"));
+      names.Add(new StringData("WorstQuality"));
+      names.Add(new StringData("BestValidationQuality"));
+      names.Add(new StringData("AverageValidationQuality"));
+      names.Add(new StringData("WorstValidationQuality"));
+      names.Add(new StringData("EvaluatedSolutions"));
+      names.Add(new StringData("SelectionPressure"));
+      QualityLogger qualityLogger = new QualityLogger();
+      QualityLogger validationQualityLogger = new QualityLogger();
+      validationQualityLogger.GetVariableInfo("Quality").ActualName = "ValidationQuality";
+      validationQualityLogger.GetVariableInfo("QualityLog").ActualName = "ValidationQualityLog";
+      seq.AddSubOperator(collector);
+      seq.AddSubOperator(qualityLogger);
+      seq.AddSubOperator(validationQualityLogger);
+
+      loggingOperator.OperatorGraph.AddOperator(seq);
+      loggingOperator.OperatorGraph.InitialOperator = seq;
+      return loggingOperator;
+    }
+
+    protected override IOperator CreatePostProcessingOperator() {
+      CombinedOperator op = new CombinedOperator();
+      op.Name = "ModelAnalyser";
+      SequentialProcessor seq = new SequentialProcessor();
+      seq.AddSubOperator(DefaultStructureIdentificationOperators.CreatePreparationForPostProcessingOperator());
+
+      UniformSequentialSubScopesProcessor subScopesProc = new UniformSequentialSubScopesProcessor();
+      SequentialProcessor solutionProc = new SequentialProcessor();
+      solutionProc.AddSubOperator(CreateModelAnalyzerOperator());
+
+      subScopesProc.AddSubOperator(solutionProc);
+      seq.AddSubOperator(subScopesProc);
+
+      op.OperatorGraph.AddOperator(seq);
+      op.OperatorGraph.InitialOperator = seq;
+      return op;
+    }
+
+    protected virtual IOperator CreateModelAnalyzerOperator() {
+      return DefaultRegressionOperators.CreatePostProcessingOperator();
+    }
+
+    protected CombinedOperator GetProblemInjector() {
+      return (CombinedOperator)GetInitializationOperator().SubOperators[0];
+    }
+
+    protected virtual IAnalyzerModel CreateGPModel() {
+      IScope bestModelScope = Engine.GlobalScope.SubScopes[0];
+      var model = new AnalyzerModel();
+
+      model.SetMetaData("SelectionPressure", bestModelScope.GetVariableValue<DoubleData>("SelectionPressure", false).Data);
+      DefaultStructureIdentificationOperators.PopulateAnalyzerModel(bestModelScope, model);
+      DefaultRegressionOperators.PopulateAnalyzerModel(bestModelScope, model);
+
+      return model;
+    }
+  }
+}
Index: trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/StandardGP.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/StandardGP.cs	(revision 2356)
+++ 	(revision )
@@ -1,173 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2008 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.Operators;
-using HeuristicLab.Selection;
-using HeuristicLab.Logging;
-using HeuristicLab.Data;
-using HeuristicLab.GP.Operators;
-using HeuristicLab.Modeling;
-using System.Collections.Generic;
-using System;
-using HeuristicLab.DataAnalysis;
-
-namespace HeuristicLab.GP.StructureIdentification {
-  public class StandardGP : HeuristicLab.GP.Algorithms.StandardGP, IAlgorithm {
-
-    public override string Name { get { return "StandardGP - StructureIdentification"; } }
-
-    public virtual int TargetVariable {
-      get { return ProblemInjector.GetVariableValue<IntData>("TargetVariable", null, false).Data; }
-      set { ProblemInjector.GetVariableValue<IntData>("TargetVariable", null, false).Data = value; }
-    }
-
-    public virtual Dataset Dataset {
-      get { return ProblemInjector.GetVariableValue<Dataset>("Dataset", null, false); }
-      set { ProblemInjector.GetVariable("Dataset").Value = value; }
-    }
-
-    public virtual IAnalyzerModel Model {
-      get {
-        if (!Engine.Terminated)
-          throw new InvalidOperationException("The algorithm is still running. Wait until the algorithm is terminated to retrieve the result.");
-        else
-          return CreateGPModel();
-      }
-    }
-
-    public virtual double PunishmentFactor {
-      get { return GetVariableInjector().GetVariable("PunishmentFactor").GetValue<DoubleData>().Data; }
-      set { GetVariableInjector().GetVariable("PunishmentFactor").GetValue<DoubleData>().Data = value; }
-    }
-
-    public override IOperator ProblemInjector {
-      get { return GetProblemInjector().OperatorGraph.InitialOperator.SubOperators[0]; }
-      set {
-        value.Name = "ProblemInjector";
-        CombinedOperator problemInjector = GetProblemInjector();
-        problemInjector.OperatorGraph.RemoveOperator(ProblemInjector.Guid);
-        problemInjector.OperatorGraph.AddOperator(value);
-        problemInjector.OperatorGraph.InitialOperator.AddSubOperator(value, 0);
-      }
-    }
-
-    public StandardGP()
-      : base() {
-
-      PunishmentFactor = 10.0;
-    }
-
-    protected override IOperator CreateFunctionLibraryInjector() {
-      return DefaultStructureIdentificationOperators.CreateFunctionLibraryInjector();
-    }
-
-    protected override IOperator CreateProblemInjector() {
-      return DefaultRegressionOperators.CreateProblemInjector();
-    }
-
-    protected override IOperator CreateInitialPopulationEvaluator() {
-      return DefaultStructureIdentificationOperators.CreateInitialPopulationEvaluator();
-    }
-
-    protected override IOperator CreateEvaluationOperator() {
-      return DefaultStructureIdentificationOperators.CreateEvaluator();
-    }
-
-
-    protected override IOperator CreateGenerationStepHook() {
-      return DefaultStructureIdentificationOperators.CreateGenerationStepHook();
-    }
-
-    protected override VariableInjector CreateGlobalInjector() {
-      VariableInjector injector = base.CreateGlobalInjector();
-      injector.AddVariable(new HeuristicLab.Core.Variable("PunishmentFactor", new DoubleData()));
-      return injector;
-    }
-
-    protected override IOperator CreateLoggingOperator() {
-      CombinedOperator loggingOperator = new CombinedOperator();
-      loggingOperator.Name = "Logging";
-      SequentialProcessor seq = new SequentialProcessor();
-
-      DataCollector collector = new DataCollector();
-      ItemList<StringData> names = collector.GetVariable("VariableNames").GetValue<ItemList<StringData>>();
-      names.Add(new StringData("BestQuality"));
-      names.Add(new StringData("AverageQuality"));
-      names.Add(new StringData("WorstQuality"));
-      names.Add(new StringData("BestValidationQuality"));
-      names.Add(new StringData("AverageValidationQuality"));
-      names.Add(new StringData("WorstValidationQuality"));
-      names.Add(new StringData("EvaluatedSolutions"));
-      QualityLogger qualityLogger = new QualityLogger();
-      QualityLogger validationQualityLogger = new QualityLogger();
-      validationQualityLogger.GetVariableInfo("Quality").ActualName = "ValidationQuality";
-      validationQualityLogger.GetVariableInfo("QualityLog").ActualName = "ValidationQualityLog";
-      seq.AddSubOperator(collector);
-      seq.AddSubOperator(qualityLogger);
-      seq.AddSubOperator(validationQualityLogger);
-
-      loggingOperator.OperatorGraph.AddOperator(seq);
-      loggingOperator.OperatorGraph.InitialOperator = seq;
-      return loggingOperator;
-    }
-
-    protected override IOperator CreatePostProcessingOperator() {
-      CombinedOperator op = new CombinedOperator();
-      op.Name = "ModelAnalyser";
-      SequentialProcessor seq = new SequentialProcessor();
-      seq.AddSubOperator(DefaultStructureIdentificationOperators.CreatePreparationForPostProcessingOperator());
-
-      UniformSequentialSubScopesProcessor subScopesProc = new UniformSequentialSubScopesProcessor();
-      SequentialProcessor solutionProc = new SequentialProcessor();
-      solutionProc.AddSubOperator(CreateModelAnalyzerOperator());
-
-      subScopesProc.AddSubOperator(solutionProc);
-      seq.AddSubOperator(subScopesProc);
-
-      op.OperatorGraph.AddOperator(seq);
-      op.OperatorGraph.InitialOperator = seq;
-      return op;
-    }
-
-    protected virtual IOperator CreateModelAnalyzerOperator() {
-      return DefaultRegressionOperators.CreatePostProcessingOperator();
-    }
-
-    public override object Clone(IDictionary<Guid, object> clonedObjects) {
-      StandardGP clone = (StandardGP)base.Clone(clonedObjects);
-      clone.PunishmentFactor = PunishmentFactor;
-      return clone;
-    }
-
-    protected CombinedOperator GetProblemInjector() {
-      return (CombinedOperator)GetInitializationOperator().SubOperators[0];
-    }
-
-    protected virtual IAnalyzerModel CreateGPModel() {
-      IScope bestModelScope = Engine.GlobalScope.SubScopes[0];
-      IAnalyzerModel model = new AnalyzerModel();
-      DefaultStructureIdentificationOperators.PopulateAnalyzerModel(bestModelScope, model);
-      DefaultRegressionOperators.PopulateAnalyzerModel(bestModelScope, model);
-      return model;
-    }
-  }
-}
Index: trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/StandardGPRegression.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/StandardGPRegression.cs	(revision 2361)
+++ trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/StandardGPRegression.cs	(revision 2361)
@@ -0,0 +1,167 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2008 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.Operators;
+using HeuristicLab.Selection;
+using HeuristicLab.Logging;
+using HeuristicLab.Data;
+using HeuristicLab.GP.Operators;
+using HeuristicLab.Modeling;
+using System.Collections.Generic;
+using System;
+using HeuristicLab.DataAnalysis;
+
+namespace HeuristicLab.GP.StructureIdentification {
+  public class StandardGPRegression : HeuristicLab.GP.Algorithms.StandardGP, IAlgorithm {
+
+    public override string Name { get { return "StandardGP - StructureIdentification"; } }
+
+    public virtual int TargetVariable {
+      get { return ProblemInjector.GetVariableValue<IntData>("TargetVariable", null, false).Data; }
+      set { ProblemInjector.GetVariableValue<IntData>("TargetVariable", null, false).Data = value; }
+    }
+
+    public virtual Dataset Dataset {
+      get { return ProblemInjector.GetVariableValue<Dataset>("Dataset", null, false); }
+      set { ProblemInjector.GetVariable("Dataset").Value = value; }
+    }
+
+    public virtual IAnalyzerModel Model {
+      get {
+        if (!Engine.Terminated)
+          throw new InvalidOperationException("The algorithm is still running. Wait until the algorithm is terminated to retrieve the result.");
+        else
+          return CreateGPModel();
+      }
+    }
+
+    public virtual double PunishmentFactor {
+      get { return GetVariableInjector().GetVariable("PunishmentFactor").GetValue<DoubleData>().Data; }
+      set { GetVariableInjector().GetVariable("PunishmentFactor").GetValue<DoubleData>().Data = value; }
+    }
+
+    public override IOperator ProblemInjector {
+      get { return GetProblemInjector().OperatorGraph.InitialOperator.SubOperators[0]; }
+      set {
+        value.Name = "ProblemInjector";
+        CombinedOperator problemInjector = GetProblemInjector();
+        problemInjector.OperatorGraph.RemoveOperator(ProblemInjector.Guid);
+        problemInjector.OperatorGraph.AddOperator(value);
+        problemInjector.OperatorGraph.InitialOperator.AddSubOperator(value, 0);
+      }
+    }
+
+    public StandardGPRegression()
+      : base() {
+
+      PunishmentFactor = 10.0;
+    }
+
+    protected override IOperator CreateFunctionLibraryInjector() {
+      return DefaultStructureIdentificationOperators.CreateFunctionLibraryInjector();
+    }
+
+    protected override IOperator CreateProblemInjector() {
+      return DefaultRegressionOperators.CreateProblemInjector();
+    }
+
+    protected override IOperator CreateInitialPopulationEvaluator() {
+      return DefaultStructureIdentificationOperators.CreateInitialPopulationEvaluator();
+    }
+
+    protected override IOperator CreateEvaluationOperator() {
+      return DefaultStructureIdentificationOperators.CreateEvaluator();
+    }
+
+
+    protected override IOperator CreateGenerationStepHook() {
+      return DefaultStructureIdentificationOperators.CreateGenerationStepHook();
+    }
+
+    protected override VariableInjector CreateGlobalInjector() {
+      VariableInjector injector = base.CreateGlobalInjector();
+      injector.AddVariable(new HeuristicLab.Core.Variable("PunishmentFactor", new DoubleData()));
+      return injector;
+    }
+
+    protected override IOperator CreateLoggingOperator() {
+      CombinedOperator loggingOperator = new CombinedOperator();
+      loggingOperator.Name = "Logging";
+      SequentialProcessor seq = new SequentialProcessor();
+
+      DataCollector collector = new DataCollector();
+      ItemList<StringData> names = collector.GetVariable("VariableNames").GetValue<ItemList<StringData>>();
+      names.Add(new StringData("BestQuality"));
+      names.Add(new StringData("AverageQuality"));
+      names.Add(new StringData("WorstQuality"));
+      names.Add(new StringData("BestValidationQuality"));
+      names.Add(new StringData("AverageValidationQuality"));
+      names.Add(new StringData("WorstValidationQuality"));
+      names.Add(new StringData("EvaluatedSolutions"));
+      QualityLogger qualityLogger = new QualityLogger();
+      QualityLogger validationQualityLogger = new QualityLogger();
+      validationQualityLogger.GetVariableInfo("Quality").ActualName = "ValidationQuality";
+      validationQualityLogger.GetVariableInfo("QualityLog").ActualName = "ValidationQualityLog";
+      seq.AddSubOperator(collector);
+      seq.AddSubOperator(qualityLogger);
+      seq.AddSubOperator(validationQualityLogger);
+
+      loggingOperator.OperatorGraph.AddOperator(seq);
+      loggingOperator.OperatorGraph.InitialOperator = seq;
+      return loggingOperator;
+    }
+
+    protected override IOperator CreatePostProcessingOperator() {
+      CombinedOperator op = new CombinedOperator();
+      op.Name = "ModelAnalyser";
+      SequentialProcessor seq = new SequentialProcessor();
+      seq.AddSubOperator(DefaultStructureIdentificationOperators.CreatePreparationForPostProcessingOperator());
+
+      UniformSequentialSubScopesProcessor subScopesProc = new UniformSequentialSubScopesProcessor();
+      SequentialProcessor solutionProc = new SequentialProcessor();
+      solutionProc.AddSubOperator(CreateModelAnalyzerOperator());
+
+      subScopesProc.AddSubOperator(solutionProc);
+      seq.AddSubOperator(subScopesProc);
+
+      op.OperatorGraph.AddOperator(seq);
+      op.OperatorGraph.InitialOperator = seq;
+      return op;
+    }
+
+    protected virtual IOperator CreateModelAnalyzerOperator() {
+      return DefaultRegressionOperators.CreatePostProcessingOperator();
+    }
+
+    protected CombinedOperator GetProblemInjector() {
+      return (CombinedOperator)GetInitializationOperator().SubOperators[0];
+    }
+
+    protected virtual IAnalyzerModel CreateGPModel() {
+      IScope bestModelScope = Engine.GlobalScope.SubScopes[0];
+      IAnalyzerModel model = new AnalyzerModel();
+      DefaultStructureIdentificationOperators.PopulateAnalyzerModel(bestModelScope, model);
+      DefaultRegressionOperators.PopulateAnalyzerModel(bestModelScope, model);
+      return model;
+    }
+  }
+}
