Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Problems.TestFunctions/3.3/SingleObjectiveTestFunctionProblem.cs @ 10879

Last change on this file since 10879 was 9982, checked in by abeham, 11 years ago

#1909:

  • Removed project HeuristicLab.Problems.Instances.TestFunctions and integrated it into HeuristicLab.Problems.TestFunctions
  • Removed SOTFData from HeuristicLab.Problems.Instances and integrated it into HeuristicLab.Problems.TestFunctions
  • Changed SOTFData's Evaluator property to be of type ISingleObjectiveTestFunctionProblemEvaluator
  • Removed cast in the problem's load method
File size: 20.8 KB
RevLine 
[3150]1#region License Information
2/* HeuristicLab
[9456]3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
[3150]4 *
5 * This file is part of HeuristicLab.
6 *
7 * HeuristicLab is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * HeuristicLab is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
19 */
20#endregion
21
[9980]22using System;
23using System.Collections.Generic;
24using System.Linq;
[8720]25using HeuristicLab.Analysis;
[3150]26using HeuristicLab.Common;
27using HeuristicLab.Core;
28using HeuristicLab.Data;
29using HeuristicLab.Encodings.RealVectorEncoding;
30using HeuristicLab.Optimization;
31using HeuristicLab.Parameters;
32using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
33using HeuristicLab.PluginInfrastructure;
[9980]34using HeuristicLab.Problems.Instances;
[3150]35
[3170]36namespace HeuristicLab.Problems.TestFunctions {
[3221]37  [Item("Single Objective Test Function", "Test function with real valued inputs and a single objective.")]
[3150]38  [StorableClass]
39  [Creatable("Problems")]
[9980]40  public sealed class SingleObjectiveTestFunctionProblem : SingleObjectiveHeuristicOptimizationProblem<ISingleObjectiveTestFunctionProblemEvaluator, IRealVectorCreator>, IStorableContent, IProblemInstanceConsumer<SOTFData> {
[4419]41    public string Filename { get; set; }
42
[3336]43    [Storable]
[3450]44    private StdDevStrategyVectorCreator strategyVectorCreator;
[3336]45    [Storable]
[3450]46    private StdDevStrategyVectorCrossover strategyVectorCrossover;
[3336]47    [Storable]
[3450]48    private StdDevStrategyVectorManipulator strategyVectorManipulator;
[3336]49
[3150]50    #region Parameter Properties
51    public ValueParameter<DoubleMatrix> BoundsParameter {
52      get { return (ValueParameter<DoubleMatrix>)Parameters["Bounds"]; }
53    }
54    public ValueParameter<IntValue> ProblemSizeParameter {
55      get { return (ValueParameter<IntValue>)Parameters["ProblemSize"]; }
56    }
[3781]57    public OptionalValueParameter<RealVector> BestKnownSolutionParameter {
58      get { return (OptionalValueParameter<RealVector>)Parameters["BestKnownSolution"]; }
59    }
[3150]60    #endregion
61
62    #region Properties
63    public DoubleMatrix Bounds {
64      get { return BoundsParameter.Value; }
65      set { BoundsParameter.Value = value; }
66    }
67    public IntValue ProblemSize {
68      get { return ProblemSizeParameter.Value; }
69      set { ProblemSizeParameter.Value = value; }
70    }
[3789]71    private BestSingleObjectiveTestFunctionSolutionAnalyzer BestSingleObjectiveTestFunctionSolutionAnalyzer {
[6938]72      get { return Operators.OfType<BestSingleObjectiveTestFunctionSolutionAnalyzer>().FirstOrDefault(); }
[3647]73    }
[8720]74    private SingleObjectivePopulationDiversityAnalyzer SingleObjectivePopulationDiversityAnalyzer {
75      get { return Operators.OfType<SingleObjectivePopulationDiversityAnalyzer>().FirstOrDefault(); }
76    }
[3150]77    #endregion
78
[6938]79    // BackwardsCompatibility3.3
80    #region Backwards compatible code, remove with 3.4
81    [Obsolete]
82    [Storable(Name = "operators")]
83    private IEnumerable<IOperator> oldOperators {
84      get { return null; }
85      set {
86        if (value != null && value.Any())
87          Operators.AddRange(value);
88      }
89    }
90    #endregion
[4098]91
[3150]92    [StorableConstructor]
[4118]93    private SingleObjectiveTestFunctionProblem(bool deserializing) : base(deserializing) { }
[4722]94    private SingleObjectiveTestFunctionProblem(SingleObjectiveTestFunctionProblem original, Cloner cloner)
95      : base(original, cloner) {
96      strategyVectorCreator = cloner.Clone(original.strategyVectorCreator);
97      strategyVectorCrossover = cloner.Clone(original.strategyVectorCrossover);
98      strategyVectorManipulator = cloner.Clone(original.strategyVectorManipulator);
[7351]99      RegisterEventHandlers();
[4722]100    }
[3170]101    public SingleObjectiveTestFunctionProblem()
[6938]102      : base(new AckleyEvaluator(), new UniformRandomRealVectorCreator()) {
103      Parameters.Add(new ValueParameter<DoubleMatrix>("Bounds", "The lower and upper bounds in each dimension.", Evaluator.Bounds));
[3150]104      Parameters.Add(new ValueParameter<IntValue>("ProblemSize", "The dimension of the problem.", new IntValue(2)));
[3781]105      Parameters.Add(new OptionalValueParameter<RealVector>("BestKnownSolution", "The best known solution for this test function instance."));
[3150]106
[6939]107      Maximization.Value = Evaluator.Maximization;
[7442]108      BestKnownQuality = new DoubleValue(Evaluator.BestKnownQuality);
[6939]109
[3450]110      strategyVectorCreator = new StdDevStrategyVectorCreator();
[3336]111      strategyVectorCreator.LengthParameter.ActualName = ProblemSizeParameter.Name;
[3450]112      strategyVectorCrossover = new StdDevStrategyVectorCrossover();
113      strategyVectorManipulator = new StdDevStrategyVectorManipulator();
114      strategyVectorManipulator.LearningRateParameter.Value = new DoubleValue(0.5);
115      strategyVectorManipulator.GeneralLearningRateParameter.Value = new DoubleValue(0.5);
[3336]116
[6938]117      SolutionCreator.RealVectorParameter.ActualName = "Point";
[3150]118      ParameterizeSolutionCreator();
119      ParameterizeEvaluator();
120
[4098]121      InitializeOperators();
[7351]122      RegisterEventHandlers();
[3783]123      UpdateStrategyVectorBounds();
[3150]124    }
125
126    public override IDeepCloneable Clone(Cloner cloner) {
[4722]127      return new SingleObjectiveTestFunctionProblem(this, cloner);
[3150]128    }
129
130    #region Events
[6938]131    protected override void OnSolutionCreatorChanged() {
132      base.OnSolutionCreatorChanged();
133      ParameterizeSolutionCreator();
134      ParameterizeAnalyzers();
135      SolutionCreator.RealVectorParameter.ActualNameChanged += new EventHandler(SolutionCreator_RealVectorParameter_ActualNameChanged);
136      SolutionCreator_RealVectorParameter_ActualNameChanged(null, EventArgs.Empty);
[3150]137    }
[6938]138    protected override void OnEvaluatorChanged() {
139      base.OnEvaluatorChanged();
[8493]140      bool problemSizeChange = ProblemSize.Value < Evaluator.MinimumProblemSize
141        || ProblemSize.Value > Evaluator.MaximumProblemSize;
142      if (problemSizeChange) {
143        ProblemSize.Value = Math.Max(Evaluator.MinimumProblemSize, Math.Min(ProblemSize.Value, Evaluator.MaximumProblemSize));
144      } else {
145        ParameterizeEvaluator();
146      }
[6938]147      UpdateMoveEvaluators();
148      ParameterizeAnalyzers();
149      Maximization.Value = Evaluator.Maximization;
150      BoundsParameter.Value = Evaluator.Bounds;
151      BestKnownQuality = new DoubleValue(Evaluator.BestKnownQuality);
152      Evaluator.QualityParameter.ActualNameChanged += new EventHandler(Evaluator_QualityParameter_ActualNameChanged);
153      Evaluator_QualityParameter_ActualNameChanged(null, EventArgs.Empty);
154      OnReset();
[3150]155    }
156    private void ProblemSizeParameter_ValueChanged(object sender, EventArgs e) {
157      ProblemSize.ValueChanged += new EventHandler(ProblemSize_ValueChanged);
158      ProblemSize_ValueChanged(null, EventArgs.Empty);
159    }
160    private void ProblemSize_ValueChanged(object sender, EventArgs e) {
[3336]161      if (ProblemSize.Value < 1) ProblemSize.Value = 1;
[3150]162      ParameterizeSolutionCreator();
[3781]163      ParameterizeEvaluator();
[3336]164      strategyVectorManipulator.GeneralLearningRateParameter.Value = new DoubleValue(1.0 / Math.Sqrt(2 * ProblemSize.Value));
165      strategyVectorManipulator.LearningRateParameter.Value = new DoubleValue(1.0 / Math.Sqrt(2 * Math.Sqrt(ProblemSize.Value)));
[3781]166      OnReset();
[3150]167    }
168    private void SolutionCreator_RealVectorParameter_ActualNameChanged(object sender, EventArgs e) {
169      ParameterizeEvaluator();
170      ParameterizeOperators();
[3647]171      ParameterizeAnalyzers();
[3150]172    }
173    private void Evaluator_QualityParameter_ActualNameChanged(object sender, EventArgs e) {
174      ParameterizeOperators();
175    }
[3154]176    private void BoundsParameter_ValueChanged(object sender, EventArgs e) {
177      Bounds.ToStringChanged += new EventHandler(Bounds_ToStringChanged);
178      Bounds_ToStringChanged(null, EventArgs.Empty);
179    }
180    private void Bounds_ToStringChanged(object sender, EventArgs e) {
181      if (Bounds.Columns != 2 || Bounds.Rows < 1)
182        Bounds = new DoubleMatrix(1, 2);
[3781]183      ParameterizeOperators();
184      UpdateStrategyVectorBounds();
[3154]185    }
186    private void Bounds_ItemChanged(object sender, EventArgs<int, int> e) {
187      if (e.Value2 == 0 && Bounds[e.Value, 1] <= Bounds[e.Value, 0])
188        Bounds[e.Value, 1] = Bounds[e.Value, 0] + 0.1;
189      if (e.Value2 == 1 && Bounds[e.Value, 0] >= Bounds[e.Value, 1])
190        Bounds[e.Value, 0] = Bounds[e.Value, 1] - 0.1;
[3781]191      ParameterizeOperators();
192      UpdateStrategyVectorBounds();
[3154]193    }
[3187]194    private void MoveGenerator_AdditiveMoveParameter_ActualNameChanged(object sender, EventArgs e) {
195      string name = ((ILookupParameter<AdditiveMove>)sender).ActualName;
196      foreach (IAdditiveRealVectorMoveOperator op in Operators.OfType<IAdditiveRealVectorMoveOperator>()) {
197        op.AdditiveMoveParameter.ActualName = name;
198      }
[3182]199    }
[3318]200    private void SphereEvaluator_Parameter_ValueChanged(object sender, EventArgs e) {
201      SphereEvaluator eval = (Evaluator as SphereEvaluator);
202      if (eval != null) {
203        foreach (ISphereMoveEvaluator op in Operators.OfType<ISphereMoveEvaluator>()) {
204          op.C = eval.C;
205          op.Alpha = eval.Alpha;
206        }
207      }
208    }
209    private void RastriginEvaluator_Parameter_ValueChanged(object sender, EventArgs e) {
210      RastriginEvaluator eval = (Evaluator as RastriginEvaluator);
211      if (eval != null) {
212        foreach (IRastriginMoveEvaluator op in Operators.OfType<IRastriginMoveEvaluator>()) {
213          op.A = eval.A;
214        }
215      }
216    }
[3336]217    private void strategyVectorCreator_BoundsParameter_ValueChanged(object sender, EventArgs e) {
[3781]218      strategyVectorManipulator.BoundsParameter.Value = (DoubleMatrix)strategyVectorCreator.BoundsParameter.Value.Clone();
[3336]219    }
220    private void strategyVectorCreator_StrategyParameterParameter_ActualNameChanged(object sender, EventArgs e) {
221      string name = strategyVectorCreator.StrategyParameterParameter.ActualName;
222      strategyVectorCrossover.ParentsParameter.ActualName = name;
223      strategyVectorCrossover.StrategyParameterParameter.ActualName = name;
224      strategyVectorManipulator.StrategyParameterParameter.ActualName = name;
225    }
[3150]226    #endregion
227
228    #region Helpers
229    [StorableHook(HookType.AfterDeserialization)]
[4722]230    private void AfterDeserialization() {
[4118]231      // BackwardsCompatibility3.3
232      #region Backwards compatible code (remove with 3.4)
[6938]233      if (Operators.Count == 0) InitializeOperators();
[4118]234      #endregion
[7351]235      RegisterEventHandlers();
[4118]236    }
237
[7351]238    private void RegisterEventHandlers() {
[3150]239      ProblemSizeParameter.ValueChanged += new EventHandler(ProblemSizeParameter_ValueChanged);
240      ProblemSize.ValueChanged += new EventHandler(ProblemSize_ValueChanged);
[3154]241      BoundsParameter.ValueChanged += new EventHandler(BoundsParameter_ValueChanged);
242      Bounds.ToStringChanged += new EventHandler(Bounds_ToStringChanged);
243      Bounds.ItemChanged += new EventHandler<EventArgs<int, int>>(Bounds_ItemChanged);
[3150]244      SolutionCreator.RealVectorParameter.ActualNameChanged += new EventHandler(SolutionCreator_RealVectorParameter_ActualNameChanged);
245      Evaluator.QualityParameter.ActualNameChanged += new EventHandler(Evaluator_QualityParameter_ActualNameChanged);
[3336]246      strategyVectorCreator.BoundsParameter.ValueChanged += new EventHandler(strategyVectorCreator_BoundsParameter_ValueChanged);
247      strategyVectorCreator.StrategyParameterParameter.ActualNameChanged += new EventHandler(strategyVectorCreator_StrategyParameterParameter_ActualNameChanged);
[3150]248    }
[3647]249    private void ParameterizeAnalyzers() {
[8720]250      if (BestSingleObjectiveTestFunctionSolutionAnalyzer != null) {
251        BestSingleObjectiveTestFunctionSolutionAnalyzer.RealVectorParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName;
252        BestSingleObjectiveTestFunctionSolutionAnalyzer.ResultsParameter.ActualName = "Results";
253        BestSingleObjectiveTestFunctionSolutionAnalyzer.QualityParameter.ActualName = Evaluator.QualityParameter.ActualName;
254        BestSingleObjectiveTestFunctionSolutionAnalyzer.BestKnownQualityParameter.ActualName = BestKnownQualityParameter.Name;
255        BestSingleObjectiveTestFunctionSolutionAnalyzer.BestKnownSolutionParameter.ActualName = BestKnownSolutionParameter.Name;
256        BestSingleObjectiveTestFunctionSolutionAnalyzer.MaximizationParameter.ActualName = MaximizationParameter.Name;
257        BestSingleObjectiveTestFunctionSolutionAnalyzer.EvaluatorParameter.ActualName = EvaluatorParameter.Name;
258        BestSingleObjectiveTestFunctionSolutionAnalyzer.BoundsParameter.ActualName = BoundsParameter.Name;
259      }
260
261      if (SingleObjectivePopulationDiversityAnalyzer != null) {
262        SingleObjectivePopulationDiversityAnalyzer.MaximizationParameter.ActualName = MaximizationParameter.Name;
263        SingleObjectivePopulationDiversityAnalyzer.QualityParameter.ActualName = Evaluator.QualityParameter.ActualName;
264        SingleObjectivePopulationDiversityAnalyzer.ResultsParameter.ActualName = "Results";
265        SingleObjectivePopulationDiversityAnalyzer.SimilarityCalculator = Operators.OfType<SingleObjectiveTestFunctionSimilarityCalculator>().SingleOrDefault();
266      }
[3647]267    }
[3150]268    private void InitializeOperators() {
[8334]269      Operators.Add(new SingleObjectiveTestFunctionImprovementOperator());
270      Operators.Add(new SingleObjectiveTestFunctionPathRelinker());
271      Operators.Add(new SingleObjectiveTestFunctionSimilarityCalculator());
272
[6938]273      Operators.Add(new BestSingleObjectiveTestFunctionSolutionAnalyzer());
[8720]274      Operators.Add(new SingleObjectivePopulationDiversityAnalyzer());
[3647]275      ParameterizeAnalyzers();
[6938]276      Operators.AddRange(ApplicationManager.Manager.GetInstances<IRealVectorOperator>().Cast<IOperator>());
277      Operators.Add(strategyVectorCreator);
278      Operators.Add(strategyVectorCrossover);
279      Operators.Add(strategyVectorManipulator);
[3209]280      UpdateMoveEvaluators();
281      ParameterizeOperators();
[3187]282      InitializeMoveGenerators();
[3150]283    }
[3187]284    private void InitializeMoveGenerators() {
285      foreach (IAdditiveRealVectorMoveOperator op in Operators.OfType<IAdditiveRealVectorMoveOperator>()) {
[3150]286        if (op is IMoveGenerator) {
[3187]287          op.AdditiveMoveParameter.ActualNameChanged += new EventHandler(MoveGenerator_AdditiveMoveParameter_ActualNameChanged);
[3150]288        }
289      }
[3187]290    }
291    private void UpdateMoveEvaluators() {
[3303]292      foreach (ISingleObjectiveTestFunctionMoveEvaluator op in Operators.OfType<ISingleObjectiveTestFunctionMoveEvaluator>().ToList())
[6938]293        Operators.Remove(op);
[3303]294      foreach (ISingleObjectiveTestFunctionMoveEvaluator op in ApplicationManager.Manager.GetInstances<ISingleObjectiveTestFunctionMoveEvaluator>())
295        if (op.EvaluatorType == Evaluator.GetType()) {
[6938]296          Operators.Add(op);
[3318]297          #region Synchronize evaluator specific parameters with the parameters of the corresponding move evaluators
298          if (op is ISphereMoveEvaluator) {
299            SphereEvaluator e = (Evaluator as SphereEvaluator);
300            e.AlphaParameter.ValueChanged += new EventHandler(SphereEvaluator_Parameter_ValueChanged);
301            e.CParameter.ValueChanged += new EventHandler(SphereEvaluator_Parameter_ValueChanged);
302            ISphereMoveEvaluator em = (op as ISphereMoveEvaluator);
303            em.C = e.C;
304            em.Alpha = e.Alpha;
305          } else if (op is IRastriginMoveEvaluator) {
306            RastriginEvaluator e = (Evaluator as RastriginEvaluator);
307            e.AParameter.ValueChanged += new EventHandler(RastriginEvaluator_Parameter_ValueChanged);
308            IRastriginMoveEvaluator em = (op as IRastriginMoveEvaluator);
309            em.A = e.A;
310          }
311          #endregion
[3303]312        }
313      ParameterizeOperators();
314      OnOperatorsChanged();
[3187]315    }
[3150]316    private void ParameterizeSolutionCreator() {
317      SolutionCreator.LengthParameter.Value = new IntValue(ProblemSize.Value);
[6051]318      SolutionCreator.LengthParameter.Hidden = true;
319      SolutionCreator.BoundsParameter.ActualName = BoundsParameter.Name;
320      SolutionCreator.BoundsParameter.Hidden = true;
[3150]321    }
322    private void ParameterizeEvaluator() {
323      Evaluator.PointParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName;
[6051]324      Evaluator.PointParameter.Hidden = true;
[8493]325      try {
326        BestKnownSolutionParameter.Value = Evaluator.GetBestKnownSolution(ProblemSize.Value);
[9980]327      } catch (ArgumentException e) {
[8493]328        ErrorHandling.ShowErrorDialog(e);
329        ProblemSize.Value = Evaluator.MinimumProblemSize;
330      }
[3150]331    }
332    private void ParameterizeOperators() {
[9258]333      foreach (var op in Operators.OfType<IRealVectorCrossover>()) {
[3150]334        op.ParentsParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName;
[6051]335        op.ParentsParameter.Hidden = true;
[3150]336        op.ChildParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName;
[6051]337        op.ChildParameter.Hidden = true;
[3182]338        op.BoundsParameter.ActualName = BoundsParameter.Name;
[6051]339        op.BoundsParameter.Hidden = true;
[3150]340      }
[9258]341      foreach (var op in Operators.OfType<IRealVectorManipulator>()) {
[3150]342        op.RealVectorParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName;
[6051]343        op.RealVectorParameter.Hidden = true;
[3182]344        op.BoundsParameter.ActualName = BoundsParameter.Name;
[6051]345        op.BoundsParameter.Hidden = true;
[3150]346      }
[9258]347      foreach (var op in Operators.OfType<IRealVectorMoveOperator>()) {
[3187]348        op.RealVectorParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName;
[6051]349        op.RealVectorParameter.Hidden = true;
[3150]350      }
[9258]351      foreach (var op in Operators.OfType<IRealVectorMoveGenerator>()) {
[3187]352        op.BoundsParameter.ActualName = BoundsParameter.Name;
[6051]353        op.BoundsParameter.Hidden = true;
[3187]354      }
[9258]355      foreach (var op in Operators.OfType<ISingleObjectiveTestFunctionAdditiveMoveEvaluator>()) {
[3187]356        op.QualityParameter.ActualName = Evaluator.QualityParameter.ActualName;
[6051]357        op.QualityParameter.Hidden = true;
[3187]358        op.RealVectorParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName;
[6051]359        op.RealVectorParameter.Hidden = true;
[3187]360      }
[9258]361      foreach (var op in Operators.OfType<IRealVectorParticleCreator>()) {
[5560]362        op.RealVectorParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName;
[6051]363        op.RealVectorParameter.Hidden = true;
[5560]364        op.BoundsParameter.ActualName = BoundsParameter.Name;
[6051]365        op.BoundsParameter.Hidden = true;
[5951]366        op.ProblemSizeParameter.ActualName = ProblemSizeParameter.Name;
[6051]367        op.ProblemSizeParameter.Hidden = true;
[5560]368      }
[9258]369      foreach (var op in Operators.OfType<IRealVectorParticleUpdater>()) {
[5560]370        op.RealVectorParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName;
[6051]371        op.RealVectorParameter.Hidden = true;
[5951]372        op.BoundsParameter.ActualName = BoundsParameter.Name;
[6051]373        op.BoundsParameter.Hidden = true;
[5560]374      }
[9258]375      foreach (var op in Operators.OfType<IRealVectorSwarmUpdater>()) {
[5561]376        op.RealVectorParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName;
[6051]377        op.RealVectorParameter.Hidden = true;
[5951]378        op.MaximizationParameter.ActualName = MaximizationParameter.Name;
[6051]379        op.MaximizationParameter.Hidden = true;
[5561]380      }
[9258]381      foreach (var op in Operators.OfType<IRealVectorMultiNeighborhoodShakingOperator>()) {
[6042]382        op.RealVectorParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName;
[6051]383        op.RealVectorParameter.Hidden = true;
384      }
[9258]385      foreach (var op in Operators.OfType<ISingleObjectiveImprovementOperator>()) {
[8334]386        op.SolutionParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName;
387        op.SolutionParameter.Hidden = true;
388      }
[9258]389      foreach (var op in Operators.OfType<ISingleObjectivePathRelinker>()) {
[8334]390        op.ParentsParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName;
391        op.ParentsParameter.Hidden = true;
392      }
[9258]393      foreach (var op in Operators.OfType<SingleObjectiveTestFunctionSimilarityCalculator>()) {
[8334]394        op.SolutionVariableName = SolutionCreator.RealVectorParameter.ActualName;
395        op.QualityVariableName = Evaluator.QualityParameter.ActualName;
396        op.Bounds = Bounds;
397      }
[3150]398    }
[3781]399    private void UpdateStrategyVectorBounds() {
[9258]400      var strategyBounds = (DoubleMatrix)Bounds.Clone();
[5381]401      for (int i = 0; i < strategyBounds.Rows; i++) {
[3781]402        if (strategyBounds[i, 0] < 0) strategyBounds[i, 0] = 0;
[5381]403        strategyBounds[i, 1] = 0.1 * (Bounds[i, 1] - Bounds[i, 0]);
404      }
[3781]405      strategyVectorCreator.BoundsParameter.Value = strategyBounds;
406    }
[3150]407    #endregion
[9980]408
409    public void Load(SOTFData data) {
410      Name = data.Name;
411      Description = data.Description;
[9982]412      Evaluator = data.Evaluator;
[9980]413    }
[3150]414  }
415}
Note: See TracBrowser for help on using the repository browser.