Index: trunk/sources/HeuristicLab.Problems.TestFunctions/3.3/Analyzers/BestSingleObjectiveTestFunctionSolutionAnalyzer.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.TestFunctions/3.3/Analyzers/BestSingleObjectiveTestFunctionSolutionAnalyzer.cs	(revision 3647)
+++ trunk/sources/HeuristicLab.Problems.TestFunctions/3.3/Analyzers/BestSingleObjectiveTestFunctionSolutionAnalyzer.cs	(revision 3647)
@@ -0,0 +1,90 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 System.Linq;
+using System.Text;
+using HeuristicLab.Optimization;
+using HeuristicLab.Data;
+using HeuristicLab.Core;
+using HeuristicLab.Operators;
+using HeuristicLab.Encodings.RealVectorEncoding;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.TestFunctions.Analyzers {
+  /// <summary>
+  /// An operator for analyzing the best solution for a SingleObjectiveTestFunction problem.
+  /// </summary>
+  [Item("BestSingleObjectiveTestFunctionSolutionAnalyzer", "An operator for analyzing the best solution for a SingleObjectiveTestFunction problem.")]
+  [StorableClass]
+  class BestSingleObjectiveTestFunctionSolutionAnalyzer : SingleSuccessorOperator, IBestSingleObjectiveTestFunctionSolutionAnalyzer, ISolutionAnalyzer {
+
+    public ILookupParameter<RealVector> RealVectorParameter {
+      get { return (ILookupParameter<RealVector>)Parameters["RealVector"]; }
+    }
+    ILookupParameter IBestSingleObjectiveTestFunctionSolutionAnalyzer.RealVectorParameter {
+      get { return RealVectorParameter; }
+    }
+    public ILookupParameter<DoubleValue> QualityParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters["Quality"]; }
+    }
+    ILookupParameter IBestSingleObjectiveTestFunctionSolutionAnalyzer.QualityParameter {
+      get { return QualityParameter; }
+    }
+    public ILookupParameter<SingleObjectiveTestFunctionSolution> BestSolutionParameter {
+      get { return (ILookupParameter<SingleObjectiveTestFunctionSolution>)Parameters["BestSolution"]; }
+    }
+    public IValueLookupParameter<ResultCollection> ResultsParameter {
+      get { return (IValueLookupParameter<ResultCollection>)Parameters["Results"]; }
+    }
+
+    public BestSingleObjectiveTestFunctionSolutionAnalyzer()
+      : base() {
+      Parameters.Add(new LookupParameter<RealVector>("RealVector", "The SingleObjectiveTestFunction solutions from which the best solution should be visualized."));
+
+      Parameters.Add(new LookupParameter<DoubleValue>("Quality", "The qualities of the SingleObjectiveTestFunction solutions which should be visualized."));
+      Parameters.Add(new LookupParameter<SingleObjectiveTestFunctionSolution>("BestSolution", "The best SingleObjectiveTestFunction solution."));
+      Parameters.Add(new ValueLookupParameter<ResultCollection>("Results", "The result collection where the SingleObjectiveTestFunction solution should be stored."));
+    }
+
+    public override IOperation Apply() {
+      RealVector RealVector = RealVectorParameter.ActualValue;
+      DoubleValue quality = QualityParameter.ActualValue;
+      ResultCollection results = ResultsParameter.ActualValue;
+
+      SingleObjectiveTestFunctionSolution solution = BestSolutionParameter.ActualValue;
+      if (solution == null) {
+        solution = new SingleObjectiveTestFunctionSolution(RealVector, QualityParameter.ActualValue);
+        BestSolutionParameter.ActualValue = solution;
+        results.Add(new Result("Best SingleObjectiveTestFunction Solution", solution));
+      }  else {
+        solution.RealVector = RealVector;
+        solution.Quality = QualityParameter.ActualValue;
+
+        results["Best SingleObjectiveTestFunction Solution"].Value = solution;
+      }
+
+      return base.Apply();
+    }
+  }
+}
Index: trunk/sources/HeuristicLab.Problems.TestFunctions/3.3/Analyzers/MultiPopulationBestSingleObjectiveTestFunctionSolutionAnalyzer.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.TestFunctions/3.3/Analyzers/MultiPopulationBestSingleObjectiveTestFunctionSolutionAnalyzer.cs	(revision 3647)
+++ trunk/sources/HeuristicLab.Problems.TestFunctions/3.3/Analyzers/MultiPopulationBestSingleObjectiveTestFunctionSolutionAnalyzer.cs	(revision 3647)
@@ -0,0 +1,105 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 System.Linq;
+using System.Text;
+using HeuristicLab.Optimization;
+using HeuristicLab.Data;
+using HeuristicLab.Core;
+using HeuristicLab.Operators;
+using HeuristicLab.Encodings.RealVectorEncoding;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.TestFunctions.Analyzers {
+  /// <summary>
+  /// An operator for analyzing the best solution for a SingleObjectiveTestFunction problem.
+  /// </summary>
+  [Item("MultiPopulationBestSingleObjectiveTestFunctionSolutionAnalyzer", "An operator for analyzing the best solution for a SingleObjectiveTestFunction problem.")]
+  [StorableClass]
+  class MultiPopulationBestSingleObjectiveTestFunctionSolutionAnalyzer : SingleSuccessorOperator, IBestSingleObjectiveTestFunctionSolutionAnalyzer, IMultiPopulationAnalyzer {
+
+    public ILookupParameter<ItemArray<ItemArray<RealVector>>> RealVectorParameter {
+      get { return (ILookupParameter<ItemArray<ItemArray<RealVector>>>)Parameters["RealVector"]; }
+    }
+    ILookupParameter IBestSingleObjectiveTestFunctionSolutionAnalyzer.RealVectorParameter {
+      get { return RealVectorParameter; }
+    }
+    public ILookupParameter<ItemArray<ItemArray<DoubleValue>>> QualityParameter {
+      get { return (ILookupParameter<ItemArray<ItemArray<DoubleValue>>>)Parameters["Quality"]; }
+    }
+    ILookupParameter IBestSingleObjectiveTestFunctionSolutionAnalyzer.QualityParameter {
+      get { return QualityParameter; }
+    }
+    public ILookupParameter<SingleObjectiveTestFunctionSolution> BestSolutionParameter {
+      get { return (ILookupParameter<SingleObjectiveTestFunctionSolution>)Parameters["BestSolution"]; }
+    }
+    public IValueLookupParameter<ResultCollection> ResultsParameter {
+      get { return (IValueLookupParameter<ResultCollection>)Parameters["Results"]; }
+    }
+
+    public MultiPopulationBestSingleObjectiveTestFunctionSolutionAnalyzer()
+      : base() {
+      Parameters.Add(new SubScopesLookupParameter<ItemArray<RealVector>>("RealVector", "The SingleObjectiveTestFunction solutions from which the best solution should be visualized."));
+
+      Parameters.Add(new SubScopesLookupParameter<ItemArray<DoubleValue>>("Quality", "The qualities of the SingleObjectiveTestFunction solutions which should be visualized."));
+      Parameters.Add(new LookupParameter<SingleObjectiveTestFunctionSolution>("BestSolution", "The best SingleObjectiveTestFunction solution."));
+      Parameters.Add(new ValueLookupParameter<ResultCollection>("Results", "The result collection where the SingleObjectiveTestFunction solution should be stored."));
+    }
+
+    public override IOperation Apply() {
+      ItemArray<ItemArray<RealVector>> RealVectors = RealVectorParameter.ActualValue;
+      ItemArray<ItemArray<DoubleValue>> qualities = QualityParameter.ActualValue;
+      ResultCollection results = ResultsParameter.ActualValue;
+
+      DoubleValue bestQuality = new DoubleValue(double.MaxValue);
+      RealVector bestRealVector = null;
+
+      for (int i = 0; i < qualities.Length; i++) {
+        for (int j = 0; j < qualities[i].Length; j++) {
+          if (qualities[i][j].Value < bestQuality.Value) {
+            bestQuality = qualities[i][j];
+            bestRealVector = RealVectors[i][j];
+          }
+        }
+      }
+
+      SingleObjectiveTestFunctionSolution solution = BestSolutionParameter.ActualValue;
+      if (solution == null) {
+        solution = new SingleObjectiveTestFunctionSolution(bestRealVector, bestQuality);
+        BestSolutionParameter.ActualValue = solution;
+
+        results.Add(new Result("Best SingleObjectiveTestFunction Solution", solution));
+      } else {
+        if (solution.Quality.Value > bestQuality.Value) {
+          solution.RealVector = bestRealVector;
+          solution.Quality = bestQuality;
+
+          results["Best SingleObjectiveTestFunction Solution"].Value = solution;
+        }
+      }
+
+      return base.Apply();
+    }
+  }
+}
Index: trunk/sources/HeuristicLab.Problems.TestFunctions/3.3/Analyzers/PopulationBestSingleObjectiveTestFunctionSolutionAnalyzer.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.TestFunctions/3.3/Analyzers/PopulationBestSingleObjectiveTestFunctionSolutionAnalyzer.cs	(revision 3647)
+++ trunk/sources/HeuristicLab.Problems.TestFunctions/3.3/Analyzers/PopulationBestSingleObjectiveTestFunctionSolutionAnalyzer.cs	(revision 3647)
@@ -0,0 +1,92 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 System.Linq;
+using System.Text;
+using HeuristicLab.Optimization;
+using HeuristicLab.Data;
+using HeuristicLab.Core;
+using HeuristicLab.Operators;
+using HeuristicLab.Encodings.RealVectorEncoding;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.TestFunctions.Analyzers {
+  /// <summary>
+  /// An operator for analyzing the best solution for a SingleObjectiveTestFunction problem.
+  /// </summary>
+  [Item("PopulationBestSingleObjectiveTestFunctionSolutionAnalyzer", "An operator for analyzing the best solution for a SingleObjectiveTestFunction problem.")]
+  [StorableClass]
+  class PopulationBestSingleObjectiveTestFunctionSolutionAnalyzer : SingleSuccessorOperator, IBestSingleObjectiveTestFunctionSolutionAnalyzer, IPopulationAnalyzer {
+
+    public ILookupParameter<ItemArray<RealVector>> RealVectorParameter {
+      get { return (ILookupParameter<ItemArray<RealVector>>)Parameters["RealVector"]; }
+    }
+    ILookupParameter IBestSingleObjectiveTestFunctionSolutionAnalyzer.RealVectorParameter {
+      get { return RealVectorParameter; }
+    }
+    public ILookupParameter<ItemArray<DoubleValue>> QualityParameter {
+      get { return (ILookupParameter<ItemArray<DoubleValue>>)Parameters["Quality"]; }
+    }
+    ILookupParameter IBestSingleObjectiveTestFunctionSolutionAnalyzer.QualityParameter {
+      get { return QualityParameter; }
+    }
+    public ILookupParameter<SingleObjectiveTestFunctionSolution> BestSolutionParameter {
+      get { return (ILookupParameter<SingleObjectiveTestFunctionSolution>)Parameters["BestSolution"]; }
+    }
+    public IValueLookupParameter<ResultCollection> ResultsParameter {
+      get { return (IValueLookupParameter<ResultCollection>)Parameters["Results"]; }
+    }
+
+    public PopulationBestSingleObjectiveTestFunctionSolutionAnalyzer()
+      : base() {
+      Parameters.Add(new SubScopesLookupParameter<RealVector>("RealVector", "The SingleObjectiveTestFunction solutions from which the best solution should be visualized."));
+
+      Parameters.Add(new SubScopesLookupParameter<DoubleValue>("Quality", "The qualities of the SingleObjectiveTestFunction solutions which should be visualized."));
+      Parameters.Add(new LookupParameter<SingleObjectiveTestFunctionSolution>("BestSolution", "The best SingleObjectiveTestFunction solution."));
+      Parameters.Add(new ValueLookupParameter<ResultCollection>("Results", "The result collection where the SingleObjectiveTestFunction solution should be stored."));
+    }
+
+    public override IOperation Apply() {
+      ItemArray<RealVector> RealVectors = RealVectorParameter.ActualValue;
+      ItemArray<DoubleValue> qualities = QualityParameter.ActualValue;
+      ResultCollection results = ResultsParameter.ActualValue;
+
+      int i = qualities.Select((x, index) => new { index, x.Value }).OrderBy(x => x.Value).First().index;
+      SingleObjectiveTestFunctionSolution solution = BestSolutionParameter.ActualValue;
+      if (solution == null) {
+        solution = new SingleObjectiveTestFunctionSolution(RealVectors[i], QualityParameter.ActualValue[i]);
+        BestSolutionParameter.ActualValue = solution;
+
+        results.Add(new Result("Best SingleObjectiveTestFunction Solution", solution));
+      } else {
+        solution.RealVector = RealVectors[i];
+        solution.Quality = QualityParameter.ActualValue[i];
+
+        results["Best SingleObjectiveTestFunction Solution"].Value = solution;
+      }
+
+      return base.Apply();
+    }
+  }
+}
Index: trunk/sources/HeuristicLab.Problems.TestFunctions/3.3/HeuristicLab.Problems.TestFunctions-3.3.csproj
===================================================================
--- trunk/sources/HeuristicLab.Problems.TestFunctions/3.3/HeuristicLab.Problems.TestFunctions-3.3.csproj	(revision 3616)
+++ trunk/sources/HeuristicLab.Problems.TestFunctions/3.3/HeuristicLab.Problems.TestFunctions-3.3.csproj	(revision 3647)
@@ -84,4 +84,7 @@
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="Analyzers\BestSingleObjectiveTestFunctionSolutionAnalyzer.cs" />
+    <Compile Include="Analyzers\MultiPopulationBestSingleObjectiveTestFunctionSolutionAnalyzer.cs" />
+    <Compile Include="Analyzers\PopulationBestSingleObjectiveTestFunctionSolutionAnalyzer.cs" />
     <Compile Include="Evaluators\AckleyEvaluator.cs" />
     <Compile Include="Evaluators\BealeEvaluator.cs" />
@@ -98,4 +101,5 @@
     <Compile Include="Evaluators\ZakharovEvaluator.cs" />
     <Compile Include="HeuristicLabProblemsTestFunctionsPlugin.cs" />
+    <Compile Include="Interfaces\IBestSingleObjectiveTestFunctionSolutionAnalyzer.cs" />
     <Compile Include="Interfaces\IRastriginMoveEvaluator.cs" />
     <Compile Include="Interfaces\ISingleObjectiveTestFunctionAdditiveMoveEvaluator.cs" />
@@ -118,4 +122,5 @@
     <Compile Include="MoveEvaluators\AdditiveMoveEvaluator.cs" />
     <Compile Include="MoveEvaluators\RealVectorAdditiveMoveWrapper.cs" />
+    <Compile Include="SingleObjectiveTestFunctionSolution.cs" />
     <Compile Include="SingleObjectiveTestFunctionProblem.cs" />
     <None Include="HeuristicLab.snk" />
Index: trunk/sources/HeuristicLab.Problems.TestFunctions/3.3/Interfaces/IBestSingleObjectiveTestFunctionSolutionAnalyzer.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.TestFunctions/3.3/Interfaces/IBestSingleObjectiveTestFunctionSolutionAnalyzer.cs	(revision 3647)
+++ trunk/sources/HeuristicLab.Problems.TestFunctions/3.3/Interfaces/IBestSingleObjectiveTestFunctionSolutionAnalyzer.cs	(revision 3647)
@@ -0,0 +1,36 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Optimization;
+
+namespace HeuristicLab.Problems.TestFunctions {
+  /// <summary>
+  /// An interface which represents operators for analyzing the best solution of single objective TestFunction Problems given in bit vector representation.
+  /// </summary>
+  public interface IBestSingleObjectiveTestFunctionSolutionAnalyzer : IAnalyzer {
+    ILookupParameter RealVectorParameter { get; }
+    ILookupParameter QualityParameter { get; }
+    ILookupParameter<SingleObjectiveTestFunctionSolution> BestSolutionParameter { get; }
+    IValueLookupParameter<ResultCollection> ResultsParameter { get; }
+  }
+}
Index: trunk/sources/HeuristicLab.Problems.TestFunctions/3.3/SingleObjectiveTestFunctionProblem.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.TestFunctions/3.3/SingleObjectiveTestFunctionProblem.cs	(revision 3616)
+++ trunk/sources/HeuristicLab.Problems.TestFunctions/3.3/SingleObjectiveTestFunctionProblem.cs	(revision 3647)
@@ -33,4 +33,5 @@
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
 using HeuristicLab.PluginInfrastructure;
+using HeuristicLab.Problems.TestFunctions.Analyzers;
 
 namespace HeuristicLab.Problems.TestFunctions {
@@ -121,4 +122,7 @@
       get { return operators; }
     }
+    private IEnumerable<IBestSingleObjectiveTestFunctionSolutionAnalyzer> BestSingleObjectiveTestFunctionSolutionAnalyzers {
+      get { return operators.OfType<IBestSingleObjectiveTestFunctionSolutionAnalyzer>(); }
+    }
     #endregion
 
@@ -147,5 +151,4 @@
       ParameterizeSolutionCreator();
       ParameterizeEvaluator();
-      ParameterizeVisualizer();
 
       Initialize();
@@ -186,4 +189,5 @@
     private void SolutionCreatorParameter_ValueChanged(object sender, EventArgs e) {
       ParameterizeSolutionCreator();
+      ParameterizeAnalyzers();
       SolutionCreator_RealVectorParameter_ActualNameChanged(null, EventArgs.Empty);
     }
@@ -191,9 +195,10 @@
       ParameterizeEvaluator();
       ParameterizeOperators();
-      ParameterizeVisualizer();
+      ParameterizeAnalyzers();
     }
     private void EvaluatorParameter_ValueChanged(object sender, EventArgs e) {
       ParameterizeEvaluator();
       UpdateMoveEvaluators();
+      ParameterizeAnalyzers();
       Maximization.Value = Evaluator.Maximization;
       BoundsParameter.Value = Evaluator.Bounds;
@@ -272,6 +277,16 @@
       strategyVectorCreator.StrategyParameterParameter.ActualNameChanged += new EventHandler(strategyVectorCreator_StrategyParameterParameter_ActualNameChanged);
     }
+    private void ParameterizeAnalyzers() {
+      foreach (IBestSingleObjectiveTestFunctionSolutionAnalyzer analyzer in BestSingleObjectiveTestFunctionSolutionAnalyzers) {
+        analyzer.RealVectorParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName;
+        analyzer.ResultsParameter.ActualName = "Results";
+      }
+    }
     private void InitializeOperators() {
       operators = new List<IOperator>();
+      operators.Add(new BestSingleObjectiveTestFunctionSolutionAnalyzer());
+      operators.Add(new PopulationBestSingleObjectiveTestFunctionSolutionAnalyzer());
+      operators.Add(new MultiPopulationBestSingleObjectiveTestFunctionSolutionAnalyzer());
+      ParameterizeAnalyzers();
       operators.AddRange(ApplicationManager.Manager.GetInstances<IRealVectorOperator>().Cast<IOperator>());
       operators.Add(strategyVectorCreator);
@@ -320,10 +335,4 @@
       Evaluator.PointParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName;
     }
-    private void ParameterizeVisualizer() {
-      //if (Visualizer != null) {
-      //  Visualizer.QualityParameter.ActualName = Evaluator.QualityParameter.ActualName;
-      //  Visualizer.PointParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName;
-      //}
-    }
     private void ParameterizeOperators() {
       foreach (IRealVectorCrossover op in Operators.OfType<IRealVectorCrossover>()) {
Index: trunk/sources/HeuristicLab.Problems.TestFunctions/3.3/SingleObjectiveTestFunctionSolution.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.TestFunctions/3.3/SingleObjectiveTestFunctionSolution.cs	(revision 3647)
+++ trunk/sources/HeuristicLab.Problems.TestFunctions/3.3/SingleObjectiveTestFunctionSolution.cs	(revision 3647)
@@ -0,0 +1,139 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 System.Linq;
+using System.Text;
+using HeuristicLab.Core;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using System.Drawing;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.RealVectorEncoding;
+using HeuristicLab.Common;
+
+namespace HeuristicLab.Problems.TestFunctions {
+  /// <summary>
+  /// Represents a SingleObjectiveTestFunctionSolution solution.
+  /// </summary>
+  [Item("SingleObjectiveTestFunctionSolution", "Represents a SingleObjectiveTestFunction solution.")]
+  [StorableClass]
+  public class SingleObjectiveTestFunctionSolution : Item {
+    public override Image ItemImage {
+      get { return HeuristicLab.Common.Resources.VS2008ImageLibrary.Image; }
+    }
+
+    [Storable]
+    private RealVector realVector;
+    public RealVector RealVector {
+      get { return realVector; }
+      set {
+        if (realVector != value) {
+          if (realVector != null) DeregisterRealVectorEvents();
+          realVector = value;
+          if (realVector != null) RegisterRealVectorEvents();
+          OnRealVectorChanged();
+        }
+      }
+    }
+
+    [Storable]
+    private DoubleValue quality;
+    public DoubleValue Quality {
+      get { return quality; }
+      set {
+        if (quality != value) {
+          if (quality != null) DeregisterQualityEvents();
+          quality = value;
+          if (quality != null) RegisterQualityEvents();
+          OnQualityChanged();
+        }
+      }
+    }
+
+    public SingleObjectiveTestFunctionSolution() : base() { }
+    public SingleObjectiveTestFunctionSolution(RealVector realVector, DoubleValue quality)
+      : base() {
+      this.realVector = realVector;
+      this.quality = quality;
+      Initialize();
+    }
+    [StorableConstructor]
+    private SingleObjectiveTestFunctionSolution(bool deserializing) : base(deserializing) { }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void Initialize() {
+      if (realVector != null) RegisterRealVectorEvents();
+      if (quality != null) RegisterQualityEvents();
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      SingleObjectiveTestFunctionSolution clone = new SingleObjectiveTestFunctionSolution();
+      cloner.RegisterClonedObject(this, clone);
+      clone.realVector = (RealVector)cloner.Clone(realVector);
+      clone.quality = (DoubleValue)cloner.Clone(quality);
+      clone.Initialize();
+      return clone;
+    }
+
+    #region Events
+    public event EventHandler RealVectorChanged;
+    private void OnRealVectorChanged() {
+      var changed = RealVectorChanged;
+      if (changed != null)
+        changed(this, EventArgs.Empty);
+    }
+
+    public event EventHandler QualityChanged;
+    private void OnQualityChanged() {
+      var changed = QualityChanged;
+      if (changed != null)
+        changed(this, EventArgs.Empty);
+    }
+
+    private void RegisterRealVectorEvents() {
+      RealVector.ItemChanged += new EventHandler<EventArgs<int>>(RealVector_ItemChanged);
+      RealVector.Reset += new EventHandler(RealVector_Reset);
+    }
+
+    private void DeregisterRealVectorEvents() {
+      RealVector.ItemChanged -= new EventHandler<EventArgs<int>>(RealVector_ItemChanged);
+      RealVector.Reset -= new EventHandler(RealVector_Reset);
+    }
+    private void RegisterQualityEvents() {
+      Quality.ValueChanged += new EventHandler(Quality_ValueChanged);
+    }
+    private void DeregisterQualityEvents() {
+      Quality.ValueChanged -= new EventHandler(Quality_ValueChanged);
+    }
+
+    private void RealVector_ItemChanged(object sender, EventArgs<int> e) {
+      OnRealVectorChanged();
+    }
+    private void RealVector_Reset(object sender, EventArgs e) {
+      OnRealVectorChanged();
+    }
+    private void Quality_ValueChanged(object sender, EventArgs e) {
+      OnQualityChanged();
+    }
+    #endregion
+  }
+}
