Free cookie consent management tool by TermsFeed Policy Generator

source: branches/GrammaticalEvolution/HeuristicLab.Problems.GrammaticalEvolution/Symbolic/GESymbolicDataAnalysisProblem.cs @ 10073

Last change on this file since 10073 was 10073, checked in by sawinkle, 11 years ago

#2109:

  • Renamed all identifiers within the files to include 'GE', where necessary.
  • Changed the namespaces of all files to 'HeuristicLab.Problems.GrammaticalEvolution'.
  • Added the parameters IntegerVector, GenotypeToPhenotype and SymbolicExpressionTreeGrammar to the Evaluator classes, where necessary.
  • Changed the SolutionCreator from ISymbolicDataAnalysisSolutionCreator to IIntegerVectorCreator; changed the Evaluator from ISymbolicDataAnalysisEvaluator<T> to IGESymbolicDataAnalysisEvaluator<T>; the problem data class/interface IDataAnalysisProblemData stays the same.
  • The methods Evaluate() and Calculate() of the specific Evaluators won't change -> the genotype-to-phenotype mapping process is done within the Apply() method.
File size: 22.1 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
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
22using System;
23using System.Drawing;
24using System.Linq;
25using HeuristicLab.Common;
26using HeuristicLab.Common.Resources;
27using HeuristicLab.Core;
28using HeuristicLab.Data;
29using HeuristicLab.Encodings.IntegerVectorEncoding;
30using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
31using HeuristicLab.Optimization;
32using HeuristicLab.Parameters;
33using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
34using HeuristicLab.PluginInfrastructure;
35using HeuristicLab.Problems.DataAnalysis;
36using HeuristicLab.Problems.DataAnalysis.Symbolic;
37using HeuristicLab.Problems.GrammaticalEvolution.Mappers;
38using HeuristicLab.Problems.Instances;
39
40namespace HeuristicLab.Problems.GrammaticalEvolution {
41  [StorableClass]
42  // TODO: ISymbolicDataAnalysisProblem -> IGESymbolicDataAnalysisProblem
43  public abstract class GESymbolicDataAnalysisProblem<T, U, V> : HeuristicOptimizationProblem<U, V>, IDataAnalysisProblem<T>, ISymbolicDataAnalysisProblem, IStorableContent,
44    IProblemInstanceConsumer<T>, IProblemInstanceExporter<T>
45    where T : class, IDataAnalysisProblemData
46    where U : class, IGESymbolicDataAnalysisEvaluator<T>
47    where V : class, IIntegerVectorCreator {
48
49    #region parameter names & descriptions
50    private const string ProblemDataParameterName = "ProblemData";
51    private const string SymbolicExpressionTreeGrammarParameterName = "SymbolicExpressionTreeGrammar";
52    private const string SymbolicExpressionTreeInterpreterParameterName = "SymbolicExpressionTreeInterpreter";
53    private const string MaximumSymbolicExpressionTreeDepthParameterName = "MaximumSymbolicExpressionTreeDepth";
54    private const string MaximumSymbolicExpressionTreeLengthParameterName = "MaximumSymbolicExpressionTreeLength";
55    private const string MaximumFunctionDefinitionsParameterName = "MaximumFunctionDefinitions";
56    private const string MaximumFunctionArgumentsParameterName = "MaximumFunctionArguments";
57    private const string RelativeNumberOfEvaluatedSamplesParameterName = "RelativeNumberOfEvaluatedSamples";
58    private const string FitnessCalculationPartitionParameterName = "FitnessCalculationPartition";
59    private const string ValidationPartitionParameterName = "ValidationPartition";
60    private const string ApplyLinearScalingParameterName = "ApplyLinearScaling";
61    private const string BoundsParameterName = "Bounds";
62    private const string GenotypeToPhenotypeMapperParameterName = "GenotypeToPhenotypeMapper";
63
64    private const string ProblemDataParameterDescription = "";
65    private const string SymbolicExpressionTreeGrammarParameterDescription = "The grammar that should be used for symbolic expression tree.";
66    private const string SymoblicExpressionTreeInterpreterParameterDescription = "The interpreter that should be used to evaluate the symbolic expression tree.";
67    private const string MaximumSymbolicExpressionTreeDepthParameterDescription = "Maximal depth of the symbolic expression. The minimum depth needed for the algorithm is 3 because two levels are reserved for the ProgramRoot and the Start symbol.";
68    private const string MaximumSymbolicExpressionTreeLengthParameterDescription = "Maximal length of the symbolic expression.";
69    private const string MaximumFunctionDefinitionsParameterDescription = "Maximal number of automatically defined functions";
70    private const string MaximumFunctionArgumentsParameterDescription = "Maximal number of arguments of automatically defined functions.";
71    private const string RelativeNumberOfEvaluatedSamplesParameterDescription = "The relative number of samples of the dataset partition, which should be randomly chosen for evaluation.";
72    private const string FitnessCalculationPartitionParameterDescription = "The partition of the problem data training partition, that should be used to calculate the fitness of an individual.";
73    private const string ValidationPartitionParameterDescription = "The partition of the problem data training partition, that should be used to select the best model from (optional).";
74    private const string ApplyLinearScalingParameterDescription = "Flag that indicates if the individual should be linearly scaled before evaluating.";
75    private const string BoundsParameterDescription = "The integer number range in which the single genomes of a genotype are created.";
76    private const string GenotypeToPhenotypeMapperParameterDescription = "Maps the genotype (an integer vector) to the phenotype (a symbolic expression tree).";
77    #endregion
78
79    #region parameter properties
80    IParameter IDataAnalysisProblem.ProblemDataParameter {
81      get { return ProblemDataParameter; }
82    }
83    public IValueParameter<T> ProblemDataParameter {
84      get { return (IValueParameter<T>)Parameters[ProblemDataParameterName]; }
85    }
86    public IValueParameter<ISymbolicDataAnalysisGrammar> SymbolicExpressionTreeGrammarParameter {
87      get { return (IValueParameter<ISymbolicDataAnalysisGrammar>)Parameters[SymbolicExpressionTreeGrammarParameterName]; }
88    }
89    public IValueParameter<ISymbolicDataAnalysisExpressionTreeInterpreter> SymbolicExpressionTreeInterpreterParameter {
90      get { return (IValueParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>)Parameters[SymbolicExpressionTreeInterpreterParameterName]; }
91    }
92    public IFixedValueParameter<IntValue> MaximumSymbolicExpressionTreeDepthParameter {
93      get { return (IFixedValueParameter<IntValue>)Parameters[MaximumSymbolicExpressionTreeDepthParameterName]; }
94    }
95    public IFixedValueParameter<IntValue> MaximumSymbolicExpressionTreeLengthParameter {
96      get { return (IFixedValueParameter<IntValue>)Parameters[MaximumSymbolicExpressionTreeLengthParameterName]; }
97    }
98    public IFixedValueParameter<IntValue> MaximumFunctionDefinitionsParameter {
99      get { return (IFixedValueParameter<IntValue>)Parameters[MaximumFunctionDefinitionsParameterName]; }
100    }
101    public IFixedValueParameter<IntValue> MaximumFunctionArgumentsParameter {
102      get { return (IFixedValueParameter<IntValue>)Parameters[MaximumFunctionArgumentsParameterName]; }
103    }
104    public IFixedValueParameter<PercentValue> RelativeNumberOfEvaluatedSamplesParameter {
105      get { return (IFixedValueParameter<PercentValue>)Parameters[RelativeNumberOfEvaluatedSamplesParameterName]; }
106    }
107    public IFixedValueParameter<IntRange> FitnessCalculationPartitionParameter {
108      get { return (IFixedValueParameter<IntRange>)Parameters[FitnessCalculationPartitionParameterName]; }
109    }
110    public IFixedValueParameter<IntRange> ValidationPartitionParameter {
111      get { return (IFixedValueParameter<IntRange>)Parameters[ValidationPartitionParameterName]; }
112    }
113    public IFixedValueParameter<BoolValue> ApplyLinearScalingParameter {
114      get { return (IFixedValueParameter<BoolValue>)Parameters[ApplyLinearScalingParameterName]; }
115    }
116    public IValueParameter<IntMatrix> BoundsParameter {
117      get { return (IValueParameter<IntMatrix>)Parameters[BoundsParameterName]; }
118    }
119    public IValueParameter<IGenotypeToPhenotypeMapper> GenotypeToPhenotypeMapperParameter {
120      get { return (IValueParameter<IGenotypeToPhenotypeMapper>)Parameters[GenotypeToPhenotypeMapperParameterName]; }
121    }
122    #endregion
123
124    #region properties
125    public string Filename { get; set; }
126    public static new Image StaticItemImage { get { return VSImageLibrary.Type; } }
127
128    IDataAnalysisProblemData IDataAnalysisProblem.ProblemData {
129      get { return ProblemData; }
130    }
131    public T ProblemData {
132      get { return ProblemDataParameter.Value; }
133      set { ProblemDataParameter.Value = value; }
134    }
135
136    public ISymbolicDataAnalysisGrammar SymbolicExpressionTreeGrammar {
137      get { return SymbolicExpressionTreeGrammarParameter.Value; }
138      set { SymbolicExpressionTreeGrammarParameter.Value = value; }
139    }
140    public ISymbolicDataAnalysisExpressionTreeInterpreter SymbolicExpressionTreeInterpreter {
141      get { return SymbolicExpressionTreeInterpreterParameter.Value; }
142      set { SymbolicExpressionTreeInterpreterParameter.Value = value; }
143    }
144
145    public IntValue MaximumSymbolicExpressionTreeDepth {
146      get { return MaximumSymbolicExpressionTreeDepthParameter.Value; }
147    }
148    public IntValue MaximumSymbolicExpressionTreeLength {
149      get { return MaximumSymbolicExpressionTreeLengthParameter.Value; }
150    }
151    public IntValue MaximumFunctionDefinitions {
152      get { return MaximumFunctionDefinitionsParameter.Value; }
153    }
154    public IntValue MaximumFunctionArguments {
155      get { return MaximumFunctionArgumentsParameter.Value; }
156    }
157    public PercentValue RelativeNumberOfEvaluatedSamples {
158      get { return RelativeNumberOfEvaluatedSamplesParameter.Value; }
159    }
160
161    public IntRange FitnessCalculationPartition {
162      get { return FitnessCalculationPartitionParameter.Value; }
163    }
164    public IntRange ValidationPartition {
165      get { return ValidationPartitionParameter.Value; }
166    }
167    public BoolValue ApplyLinearScaling {
168      get { return ApplyLinearScalingParameter.Value; }
169    }
170    #endregion
171
172    [StorableConstructor]
173    protected GESymbolicDataAnalysisProblem(bool deserializing) : base(deserializing) { }
174    [StorableHook(HookType.AfterDeserialization)]
175    private void AfterDeserialization() {
176      if (!Parameters.ContainsKey(ApplyLinearScalingParameterName)) {
177        Parameters.Add(new FixedValueParameter<BoolValue>(ApplyLinearScalingParameterName, ApplyLinearScalingParameterDescription, new BoolValue(false)));
178        ApplyLinearScalingParameter.Hidden = true;
179
180        //it is assumed that for all symbolic regression algorithms linear scaling was set to true
181        //there is no possibility to determine the previous value of the parameter as it was stored in the evaluator
182        if (GetType().Name.Contains("SymbolicRegression"))
183          ApplyLinearScaling.Value = true;
184      }
185
186      RegisterEventHandlers();
187    }
188    protected GESymbolicDataAnalysisProblem(GESymbolicDataAnalysisProblem<T, U, V> original, Cloner cloner)
189      : base(original, cloner) {
190      RegisterEventHandlers();
191    }
192
193    protected GESymbolicDataAnalysisProblem(T problemData, U evaluator, V solutionCreator)
194      : base(evaluator, solutionCreator) {
195      Parameters.Add(new ValueParameter<T>(ProblemDataParameterName, ProblemDataParameterDescription, problemData));
196      Parameters.Add(new ValueParameter<ISymbolicDataAnalysisGrammar>(SymbolicExpressionTreeGrammarParameterName, SymbolicExpressionTreeGrammarParameterDescription));
197      Parameters.Add(new ValueParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>(SymbolicExpressionTreeInterpreterParameterName, SymoblicExpressionTreeInterpreterParameterDescription));
198      Parameters.Add(new FixedValueParameter<IntValue>(MaximumSymbolicExpressionTreeDepthParameterName, MaximumSymbolicExpressionTreeDepthParameterDescription));
199      Parameters.Add(new FixedValueParameter<IntValue>(MaximumSymbolicExpressionTreeLengthParameterName, MaximumSymbolicExpressionTreeLengthParameterDescription));
200      Parameters.Add(new FixedValueParameter<IntValue>(MaximumFunctionDefinitionsParameterName, MaximumFunctionDefinitionsParameterDescription));
201      Parameters.Add(new FixedValueParameter<IntValue>(MaximumFunctionArgumentsParameterName, MaximumFunctionArgumentsParameterDescription));
202      Parameters.Add(new FixedValueParameter<IntRange>(FitnessCalculationPartitionParameterName, FitnessCalculationPartitionParameterDescription));
203      Parameters.Add(new FixedValueParameter<IntRange>(ValidationPartitionParameterName, ValidationPartitionParameterDescription));
204      Parameters.Add(new FixedValueParameter<PercentValue>(RelativeNumberOfEvaluatedSamplesParameterName, RelativeNumberOfEvaluatedSamplesParameterDescription, new PercentValue(1)));
205      Parameters.Add(new FixedValueParameter<BoolValue>(ApplyLinearScalingParameterName, ApplyLinearScalingParameterDescription, new BoolValue(false)));
206      IntMatrix m = new IntMatrix(new int[,] { { 0, 100 } });
207      Parameters.Add(new ValueParameter<IntMatrix>(BoundsParameterName, BoundsParameterDescription, m));
208      Parameters.Add(new ValueParameter<IGenotypeToPhenotypeMapper>(GenotypeToPhenotypeMapperParameterName, GenotypeToPhenotypeMapperParameterDescription, new DepthFirstMapper()));
209
210      SymbolicExpressionTreeInterpreterParameter.Hidden = true;
211      MaximumFunctionArgumentsParameter.Hidden = true;
212      MaximumFunctionDefinitionsParameter.Hidden = true;
213      ApplyLinearScalingParameter.Hidden = true;
214
215      SymbolicExpressionTreeGrammar = new TypeCoherentExpressionGrammar();
216      SymbolicExpressionTreeInterpreter = new SymbolicDataAnalysisExpressionTreeLinearInterpreter();
217
218      FitnessCalculationPartition.Start = ProblemData.TrainingPartition.Start;
219      FitnessCalculationPartition.End = ProblemData.TrainingPartition.End;
220
221      InitializeOperators();
222
223      UpdateGrammar();
224      RegisterEventHandlers();
225    }
226
227    protected virtual void UpdateGrammar() {
228      SymbolicExpressionTreeGrammar.MaximumFunctionArguments = MaximumFunctionArguments.Value;
229      SymbolicExpressionTreeGrammar.MaximumFunctionDefinitions = MaximumFunctionDefinitions.Value;
230      foreach (var varSymbol in SymbolicExpressionTreeGrammar.Symbols.OfType<HeuristicLab.Problems.DataAnalysis.Symbolic.Variable>()) {
231        if (!varSymbol.Fixed) {
232          varSymbol.AllVariableNames = ProblemData.InputVariables.Select(x => x.Value);
233          varSymbol.VariableNames = ProblemData.AllowedInputVariables;
234        }
235      }
236      foreach (var varSymbol in SymbolicExpressionTreeGrammar.Symbols.OfType<HeuristicLab.Problems.DataAnalysis.Symbolic.VariableCondition>()) {
237        if (!varSymbol.Fixed) {
238          varSymbol.AllVariableNames = ProblemData.InputVariables.Select(x => x.Value);
239          varSymbol.VariableNames = ProblemData.AllowedInputVariables;
240        }
241      }
242    }
243
244    private void InitializeOperators() {
245      Operators.AddRange(ApplicationManager.Manager.GetInstances<IIntegerVectorOperator>().OfType<IOperator>());
246      Operators.AddRange(ApplicationManager.Manager.GetInstances<ISymbolicDataAnalysisExpressionCrossover<T>>());
247      Operators.Add(new SymbolicExpressionSymbolFrequencyAnalyzer());
248      Operators.Add(new SymbolicDataAnalysisVariableFrequencyAnalyzer());
249      Operators.Add(new MinAverageMaxSymbolicExpressionTreeLengthAnalyzer());
250      Operators.Add(new SymbolicExpressionTreeLengthAnalyzer());
251      ParameterizeOperators();
252    }
253
254    #region events
255    private void RegisterEventHandlers() {
256      ProblemDataParameter.ValueChanged += new EventHandler(ProblemDataParameter_ValueChanged);
257      ProblemDataParameter.Value.Changed += (object sender, EventArgs e) => OnProblemDataChanged();
258
259      SymbolicExpressionTreeGrammarParameter.ValueChanged += new EventHandler(SymbolicExpressionTreeGrammarParameter_ValueChanged);
260
261      MaximumFunctionArguments.ValueChanged += new EventHandler(ArchitectureParameterValue_ValueChanged);
262      MaximumFunctionDefinitions.ValueChanged += new EventHandler(ArchitectureParameterValue_ValueChanged);
263      MaximumSymbolicExpressionTreeDepth.ValueChanged += new EventHandler(MaximumSymbolicExpressionTreeDepth_ValueChanged);
264    }
265
266    private void ProblemDataParameter_ValueChanged(object sender, EventArgs e) {
267      ValidationPartition.Start = 0;
268      ValidationPartition.End = 0;
269      ProblemDataParameter.Value.Changed += (object s, EventArgs args) => OnProblemDataChanged();
270      OnProblemDataChanged();
271    }
272
273    private void SymbolicExpressionTreeGrammarParameter_ValueChanged(object sender, EventArgs e) {
274      UpdateGrammar();
275    }
276
277    private void ArchitectureParameterValue_ValueChanged(object sender, EventArgs e) {
278      UpdateGrammar();
279    }
280
281    private void MaximumSymbolicExpressionTreeDepth_ValueChanged(object sender, EventArgs e) {
282      if (MaximumSymbolicExpressionTreeDepth != null && MaximumSymbolicExpressionTreeDepth.Value < 3)
283        MaximumSymbolicExpressionTreeDepth.Value = 3;
284    }
285
286    /*
287    protected override void OnSolutionCreatorChanged() {
288      base.OnSolutionCreatorChanged();
289      ParameterizeOperators();
290    }
291    */
292
293    protected override void OnEvaluatorChanged() {
294      base.OnEvaluatorChanged();
295      Evaluator.SymbolicExpressionTreeParameter.ActualNameChanged += new EventHandler(Evaluator_SymbolicExpressionTreeParameter_ActualNameChanged);
296      ParameterizeOperators();
297    }
298
299    private void Evaluator_SymbolicExpressionTreeParameter_ActualNameChanged(object sender, EventArgs e) {
300      ParameterizeOperators();
301    }
302
303    public event EventHandler ProblemDataChanged;
304    protected virtual void OnProblemDataChanged() {
305      FitnessCalculationPartition.Start = ProblemData.TrainingPartition.Start;
306      FitnessCalculationPartition.End = ProblemData.TrainingPartition.End;
307
308      UpdateGrammar();
309      ParameterizeOperators();
310
311      var handler = ProblemDataChanged;
312      if (handler != null) handler(this, EventArgs.Empty);
313
314      OnReset();
315    }
316    #endregion
317
318    protected virtual void ParameterizeOperators() {
319      var operators = Parameters.OfType<IValueParameter>().Select(p => p.Value).OfType<IOperator>().Union(Operators).ToList();
320
321      foreach (var op in operators.OfType<ISymbolicExpressionTreeGrammarBasedOperator>()) {
322        op.SymbolicExpressionTreeGrammarParameter.ActualName = SymbolicExpressionTreeGrammarParameter.Name;
323      }
324      /*
325      foreach (var op in operators.OfType<ISymbolicExpressionTreeSizeConstraintOperator>()) {
326        op.MaximumSymbolicExpressionTreeDepthParameter.ActualName = MaximumSymbolicExpressionTreeDepthParameter.Name;
327        op.MaximumSymbolicExpressionTreeLengthParameter.ActualName = MaximumSymbolicExpressionTreeLengthParameter.Name;
328      }
329      foreach (var op in operators.OfType<ISymbolicExpressionTreeArchitectureAlteringOperator>()) {
330        op.MaximumFunctionArgumentsParameter.ActualName = MaximumFunctionArgumentsParameter.Name;
331        op.MaximumFunctionDefinitionsParameter.ActualName = MaximumFunctionDefinitionsParameter.Name;
332      }
333      */
334      foreach (var op in operators.OfType<IGESymbolicDataAnalysisEvaluator<T>>()) {
335        op.ProblemDataParameter.ActualName = ProblemDataParameterName;
336        op.SymbolicExpressionTreeParameter.ActualName = Evaluator.SymbolicExpressionTreeParameter.ActualName;
337        op.EvaluationPartitionParameter.ActualName = FitnessCalculationPartitionParameter.Name;
338        op.RelativeNumberOfEvaluatedSamplesParameter.ActualName = RelativeNumberOfEvaluatedSamplesParameter.Name;
339        op.ApplyLinearScalingParameter.ActualName = ApplyLinearScalingParameter.Name;
340      }
341      foreach (var op in operators.OfType<IIntegerVectorCrossover>()) {
342        op.ParentsParameter.ActualName = Evaluator.SymbolicExpressionTreeParameter.ActualName;
343        op.ChildParameter.ActualName = Evaluator.SymbolicExpressionTreeParameter.ActualName;
344      }
345      foreach (var op in operators.OfType<IIntegerVectorManipulator>()) {
346        op.IntegerVectorParameter.ActualName = SolutionCreator.IntegerVectorParameter.ActualName;
347      }
348      foreach (var op in operators.OfType<IIntegerVectorCreator>()) {
349        op.BoundsParameter.ActualName = BoundsParameter.Name;
350        op.LengthParameter.ActualName = MaximumSymbolicExpressionTreeLengthParameter.Name;
351      }
352      foreach (var op in operators.OfType<ISymbolicExpressionTreeAnalyzer>()) {
353        op.SymbolicExpressionTreeParameter.ActualName = Evaluator.SymbolicExpressionTreeParameter.ActualName;
354      }
355      foreach (var op in operators.OfType<ISymbolicDataAnalysisSingleObjectiveAnalyzer>()) {
356        op.ApplyLinearScalingParameter.ActualName = ApplyLinearScalingParameter.Name;
357      }
358      foreach (var op in operators.OfType<ISymbolicDataAnalysisMultiObjectiveAnalyzer>()) {
359        op.ApplyLinearScalingParameter.ActualName = ApplyLinearScalingParameter.Name;
360      }
361      foreach (var op in operators.OfType<ISymbolicDataAnalysisAnalyzer>()) {
362        op.SymbolicExpressionTreeParameter.ActualName = Evaluator.SymbolicExpressionTreeParameter.ActualName;
363      }
364      foreach (var op in operators.OfType<IGESymbolicDataAnalysisValidationAnalyzer<U, T>>()) {
365        op.RelativeNumberOfEvaluatedSamplesParameter.ActualName = RelativeNumberOfEvaluatedSamplesParameter.Name;
366        op.ValidationPartitionParameter.ActualName = ValidationPartitionParameter.Name;
367      }
368      foreach (var op in operators.OfType<ISymbolicDataAnalysisInterpreterOperator>()) {
369        op.SymbolicDataAnalysisTreeInterpreterParameter.ActualName = SymbolicExpressionTreeInterpreterParameter.Name;
370      }
371      foreach (var op in operators.OfType<ISymbolicDataAnalysisExpressionCrossover<T>>()) {
372        op.EvaluationPartitionParameter.ActualName = FitnessCalculationPartitionParameter.Name;
373        op.ProblemDataParameter.ActualName = ProblemDataParameter.Name;
374        op.EvaluationPartitionParameter.ActualName = FitnessCalculationPartitionParameter.Name;
375        op.RelativeNumberOfEvaluatedSamplesParameter.ActualName = RelativeNumberOfEvaluatedSamplesParameter.Name;
376        op.EvaluatorParameter.ActualName = EvaluatorParameter.Name;
377      }
378    }
379
380    #region Import & Export
381    public virtual void Load(T data) {
382      Name = data.Name;
383      Description = data.Description;
384      ProblemData = data;
385    }
386
387    public virtual T Export() {
388      return ProblemData;
389    }
390    #endregion
391  }
392}
Note: See TracBrowser for help on using the repository browser.