1 | #region License Information
|
---|
2 | /* HeuristicLab
|
---|
3 | * Copyright (C) 2002-2012 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 |
|
---|
22 | using System;
|
---|
23 | using System.Drawing;
|
---|
24 | using System.Linq;
|
---|
25 | using HeuristicLab.Common;
|
---|
26 | using HeuristicLab.Common.Resources;
|
---|
27 | using HeuristicLab.Core;
|
---|
28 | using HeuristicLab.Data;
|
---|
29 | using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
|
---|
30 | using HeuristicLab.Optimization;
|
---|
31 | using HeuristicLab.Parameters;
|
---|
32 | using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
|
---|
33 | using HeuristicLab.PluginInfrastructure;
|
---|
34 | using HeuristicLab.Problems.Instances;
|
---|
35 |
|
---|
36 | namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
|
---|
37 | [StorableClass]
|
---|
38 | public abstract class SymbolicDataAnalysisProblem<T, U, V> : HeuristicOptimizationProblem<U, V>, IDataAnalysisProblem<T>, ISymbolicDataAnalysisProblem, IStorableContent,
|
---|
39 | IProblemInstanceConsumer<T>, IProblemInstanceExporter<T>
|
---|
40 | where T : class, IDataAnalysisProblemData
|
---|
41 | where U : class, ISymbolicDataAnalysisEvaluator<T>
|
---|
42 | where V : class, ISymbolicDataAnalysisSolutionCreator {
|
---|
43 |
|
---|
44 | #region parameter names & descriptions
|
---|
45 | private const string ProblemDataParameterName = "ProblemData";
|
---|
46 | private const string SymbolicExpressionTreeGrammarParameterName = "SymbolicExpressionTreeGrammar";
|
---|
47 | private const string SymbolicExpressionTreeInterpreterParameterName = "SymbolicExpressionTreeInterpreter";
|
---|
48 | private const string MaximumSymbolicExpressionTreeDepthParameterName = "MaximumSymbolicExpressionTreeDepth";
|
---|
49 | private const string MaximumSymbolicExpressionTreeLengthParameterName = "MaximumSymbolicExpressionTreeLength";
|
---|
50 | private const string MaximumFunctionDefinitionsParameterName = "MaximumFunctionDefinitions";
|
---|
51 | private const string MaximumFunctionArgumentsParameterName = "MaximumFunctionArguments";
|
---|
52 | private const string RelativeNumberOfEvaluatedSamplesParameterName = "RelativeNumberOfEvaluatedSamples";
|
---|
53 | private const string FitnessCalculationPartitionParameterName = "FitnessCalculationPartition";
|
---|
54 | private const string ValidationPartitionParameterName = "ValidationPartition";
|
---|
55 |
|
---|
56 | private const string ProblemDataParameterDescription = "";
|
---|
57 | private const string SymbolicExpressionTreeGrammarParameterDescription = "The grammar that should be used for symbolic expression tree.";
|
---|
58 | private const string SymoblicExpressionTreeInterpreterParameterDescription = "The interpreter that should be used to evaluate the symbolic expression tree.";
|
---|
59 | 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.";
|
---|
60 | private const string MaximumSymbolicExpressionTreeLengthParameterDescription = "Maximal length of the symbolic expression.";
|
---|
61 | private const string MaximumFunctionDefinitionsParameterDescription = "Maximal number of automatically defined functions";
|
---|
62 | private const string MaximumFunctionArgumentsParameterDescription = "Maximal number of arguments of automatically defined functions.";
|
---|
63 | private const string RelativeNumberOfEvaluatedSamplesParameterDescription = "The relative number of samples of the dataset partition, which should be randomly chosen for evaluation.";
|
---|
64 | private const string FitnessCalculationPartitionParameterDescription = "The partition of the problem data training partition, that should be used to calculate the fitness of an individual.";
|
---|
65 | private const string ValidationPartitionParameterDescription = "The partition of the problem data training partition, that should be used to select the best model from (optional).";
|
---|
66 | #endregion
|
---|
67 |
|
---|
68 | #region parameter properties
|
---|
69 | IParameter IDataAnalysisProblem.ProblemDataParameter {
|
---|
70 | get { return ProblemDataParameter; }
|
---|
71 | }
|
---|
72 | public IValueParameter<T> ProblemDataParameter {
|
---|
73 | get { return (IValueParameter<T>)Parameters[ProblemDataParameterName]; }
|
---|
74 | }
|
---|
75 | public IValueParameter<ISymbolicDataAnalysisGrammar> SymbolicExpressionTreeGrammarParameter {
|
---|
76 | get { return (IValueParameter<ISymbolicDataAnalysisGrammar>)Parameters[SymbolicExpressionTreeGrammarParameterName]; }
|
---|
77 | }
|
---|
78 | public IValueParameter<ISymbolicDataAnalysisExpressionTreeInterpreter> SymbolicExpressionTreeInterpreterParameter {
|
---|
79 | get { return (IValueParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>)Parameters[SymbolicExpressionTreeInterpreterParameterName]; }
|
---|
80 | }
|
---|
81 | public IFixedValueParameter<IntValue> MaximumSymbolicExpressionTreeDepthParameter {
|
---|
82 | get { return (IFixedValueParameter<IntValue>)Parameters[MaximumSymbolicExpressionTreeDepthParameterName]; }
|
---|
83 | }
|
---|
84 | public IFixedValueParameter<IntValue> MaximumSymbolicExpressionTreeLengthParameter {
|
---|
85 | get { return (IFixedValueParameter<IntValue>)Parameters[MaximumSymbolicExpressionTreeLengthParameterName]; }
|
---|
86 | }
|
---|
87 | public IFixedValueParameter<IntValue> MaximumFunctionDefinitionsParameter {
|
---|
88 | get { return (IFixedValueParameter<IntValue>)Parameters[MaximumFunctionDefinitionsParameterName]; }
|
---|
89 | }
|
---|
90 | public IFixedValueParameter<IntValue> MaximumFunctionArgumentsParameter {
|
---|
91 | get { return (IFixedValueParameter<IntValue>)Parameters[MaximumFunctionArgumentsParameterName]; }
|
---|
92 | }
|
---|
93 | public IFixedValueParameter<PercentValue> RelativeNumberOfEvaluatedSamplesParameter {
|
---|
94 | get { return (IFixedValueParameter<PercentValue>)Parameters[RelativeNumberOfEvaluatedSamplesParameterName]; }
|
---|
95 | }
|
---|
96 | public IFixedValueParameter<IntRange> FitnessCalculationPartitionParameter {
|
---|
97 | get { return (IFixedValueParameter<IntRange>)Parameters[FitnessCalculationPartitionParameterName]; }
|
---|
98 | }
|
---|
99 | public IFixedValueParameter<IntRange> ValidationPartitionParameter {
|
---|
100 | get { return (IFixedValueParameter<IntRange>)Parameters[ValidationPartitionParameterName]; }
|
---|
101 | }
|
---|
102 | #endregion
|
---|
103 |
|
---|
104 | #region properties
|
---|
105 | public string Filename { get; set; }
|
---|
106 | public static new Image StaticItemImage { get { return VSImageLibrary.Type; } }
|
---|
107 |
|
---|
108 | IDataAnalysisProblemData IDataAnalysisProblem.ProblemData {
|
---|
109 | get { return ProblemData; }
|
---|
110 | }
|
---|
111 | public T ProblemData {
|
---|
112 | get { return ProblemDataParameter.Value; }
|
---|
113 | set { ProblemDataParameter.Value = value; }
|
---|
114 | }
|
---|
115 |
|
---|
116 | public ISymbolicDataAnalysisGrammar SymbolicExpressionTreeGrammar {
|
---|
117 | get { return SymbolicExpressionTreeGrammarParameter.Value; }
|
---|
118 | set { SymbolicExpressionTreeGrammarParameter.Value = value; }
|
---|
119 | }
|
---|
120 | public ISymbolicDataAnalysisExpressionTreeInterpreter SymbolicExpressionTreeInterpreter {
|
---|
121 | get { return SymbolicExpressionTreeInterpreterParameter.Value; }
|
---|
122 | set { SymbolicExpressionTreeInterpreterParameter.Value = value; }
|
---|
123 | }
|
---|
124 |
|
---|
125 | public IntValue MaximumSymbolicExpressionTreeDepth {
|
---|
126 | get { return MaximumSymbolicExpressionTreeDepthParameter.Value; }
|
---|
127 | }
|
---|
128 | public IntValue MaximumSymbolicExpressionTreeLength {
|
---|
129 | get { return MaximumSymbolicExpressionTreeLengthParameter.Value; }
|
---|
130 | }
|
---|
131 | public IntValue MaximumFunctionDefinitions {
|
---|
132 | get { return MaximumFunctionDefinitionsParameter.Value; }
|
---|
133 | }
|
---|
134 | public IntValue MaximumFunctionArguments {
|
---|
135 | get { return MaximumFunctionArgumentsParameter.Value; }
|
---|
136 | }
|
---|
137 | public PercentValue RelativeNumberOfEvaluatedSamples {
|
---|
138 | get { return RelativeNumberOfEvaluatedSamplesParameter.Value; }
|
---|
139 | }
|
---|
140 |
|
---|
141 | public IntRange FitnessCalculationPartition {
|
---|
142 | get { return FitnessCalculationPartitionParameter.Value; }
|
---|
143 | }
|
---|
144 | public IntRange ValidationPartition {
|
---|
145 | get { return ValidationPartitionParameter.Value; }
|
---|
146 | }
|
---|
147 | #endregion
|
---|
148 |
|
---|
149 | [StorableConstructor]
|
---|
150 | protected SymbolicDataAnalysisProblem(bool deserializing) : base(deserializing) { }
|
---|
151 | [StorableHook(HookType.AfterDeserialization)]
|
---|
152 | private void AfterDeserialization() {
|
---|
153 | RegisterEventHandlers();
|
---|
154 | }
|
---|
155 | protected SymbolicDataAnalysisProblem(SymbolicDataAnalysisProblem<T, U, V> original, Cloner cloner)
|
---|
156 | : base(original, cloner) {
|
---|
157 | RegisterEventHandlers();
|
---|
158 | }
|
---|
159 |
|
---|
160 | protected SymbolicDataAnalysisProblem(T problemData, U evaluator, V solutionCreator)
|
---|
161 | : base(evaluator, solutionCreator) {
|
---|
162 | Parameters.Add(new ValueParameter<T>(ProblemDataParameterName, ProblemDataParameterDescription, problemData));
|
---|
163 | Parameters.Add(new ValueParameter<ISymbolicDataAnalysisGrammar>(SymbolicExpressionTreeGrammarParameterName, SymbolicExpressionTreeGrammarParameterDescription));
|
---|
164 | Parameters.Add(new ValueParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>(SymbolicExpressionTreeInterpreterParameterName, SymoblicExpressionTreeInterpreterParameterDescription));
|
---|
165 | Parameters.Add(new FixedValueParameter<IntValue>(MaximumSymbolicExpressionTreeDepthParameterName, MaximumSymbolicExpressionTreeDepthParameterDescription));
|
---|
166 | Parameters.Add(new FixedValueParameter<IntValue>(MaximumSymbolicExpressionTreeLengthParameterName, MaximumSymbolicExpressionTreeLengthParameterDescription));
|
---|
167 | Parameters.Add(new FixedValueParameter<IntValue>(MaximumFunctionDefinitionsParameterName, MaximumFunctionDefinitionsParameterDescription));
|
---|
168 | Parameters.Add(new FixedValueParameter<IntValue>(MaximumFunctionArgumentsParameterName, MaximumFunctionArgumentsParameterDescription));
|
---|
169 | Parameters.Add(new FixedValueParameter<IntRange>(FitnessCalculationPartitionParameterName, FitnessCalculationPartitionParameterDescription));
|
---|
170 | Parameters.Add(new FixedValueParameter<IntRange>(ValidationPartitionParameterName, ValidationPartitionParameterDescription));
|
---|
171 | Parameters.Add(new FixedValueParameter<PercentValue>(RelativeNumberOfEvaluatedSamplesParameterName, RelativeNumberOfEvaluatedSamplesParameterDescription, new PercentValue(1)));
|
---|
172 |
|
---|
173 | SymbolicExpressionTreeInterpreterParameter.Hidden = true;
|
---|
174 | MaximumFunctionArgumentsParameter.Hidden = true;
|
---|
175 | MaximumFunctionDefinitionsParameter.Hidden = true;
|
---|
176 |
|
---|
177 | SymbolicExpressionTreeGrammar = new TypeCoherentExpressionGrammar();
|
---|
178 | SymbolicExpressionTreeInterpreter = new SymbolicDataAnalysisExpressionTreeInterpreter();
|
---|
179 |
|
---|
180 | FitnessCalculationPartition.Start = ProblemData.TrainingPartition.Start;
|
---|
181 | FitnessCalculationPartition.End = ProblemData.TrainingPartition.End;
|
---|
182 |
|
---|
183 | InitializeOperators();
|
---|
184 |
|
---|
185 | UpdateGrammar();
|
---|
186 | RegisterEventHandlers();
|
---|
187 | }
|
---|
188 |
|
---|
189 | protected virtual void UpdateGrammar() {
|
---|
190 | SymbolicExpressionTreeGrammar.MaximumFunctionArguments = MaximumFunctionArguments.Value;
|
---|
191 | SymbolicExpressionTreeGrammar.MaximumFunctionDefinitions = MaximumFunctionDefinitions.Value;
|
---|
192 | foreach (var varSymbol in SymbolicExpressionTreeGrammar.Symbols.OfType<HeuristicLab.Problems.DataAnalysis.Symbolic.Variable>()) {
|
---|
193 | if (!varSymbol.Fixed) varSymbol.VariableNames = ProblemData.AllowedInputVariables;
|
---|
194 | }
|
---|
195 | foreach (var varSymbol in SymbolicExpressionTreeGrammar.Symbols.OfType<HeuristicLab.Problems.DataAnalysis.Symbolic.VariableCondition>()) {
|
---|
196 | if (!varSymbol.Fixed) varSymbol.VariableNames = ProblemData.AllowedInputVariables;
|
---|
197 | }
|
---|
198 | }
|
---|
199 |
|
---|
200 | private void InitializeOperators() {
|
---|
201 | Operators.AddRange(ApplicationManager.Manager.GetInstances<ISymbolicExpressionTreeOperator>());
|
---|
202 | Operators.AddRange(ApplicationManager.Manager.GetInstances<ISymbolicDataAnalysisExpressionCrossover<T>>());
|
---|
203 | Operators.Add(new SymbolicExpressionSymbolFrequencyAnalyzer());
|
---|
204 | Operators.Add(new SymbolicDataAnalysisVariableFrequencyAnalyzer());
|
---|
205 | Operators.Add(new MinAverageMaxSymbolicExpressionTreeLengthAnalyzer());
|
---|
206 | Operators.Add(new SymbolicExpressionTreeLengthAnalyzer());
|
---|
207 | ParameterizeOperators();
|
---|
208 | }
|
---|
209 |
|
---|
210 | #region events
|
---|
211 | private void RegisterEventHandlers() {
|
---|
212 | ProblemDataParameter.ValueChanged += new EventHandler(ProblemDataParameter_ValueChanged);
|
---|
213 | ProblemDataParameter.Value.Changed += (object sender, EventArgs e) => OnProblemDataChanged();
|
---|
214 |
|
---|
215 | SymbolicExpressionTreeGrammarParameter.ValueChanged += new EventHandler(SymbolicExpressionTreeGrammarParameter_ValueChanged);
|
---|
216 |
|
---|
217 | MaximumFunctionArguments.ValueChanged += new EventHandler(ArchitectureParameterValue_ValueChanged);
|
---|
218 | MaximumFunctionDefinitions.ValueChanged += new EventHandler(ArchitectureParameterValue_ValueChanged);
|
---|
219 | MaximumSymbolicExpressionTreeDepth.ValueChanged += new EventHandler(MaximumSymbolicExpressionTreeDepth_ValueChanged);
|
---|
220 | }
|
---|
221 |
|
---|
222 | private void ProblemDataParameter_ValueChanged(object sender, EventArgs e) {
|
---|
223 | ValidationPartition.Start = 0;
|
---|
224 | ValidationPartition.End = 0;
|
---|
225 | ProblemDataParameter.Value.Changed += (object s, EventArgs args) => OnProblemDataChanged();
|
---|
226 | OnProblemDataChanged();
|
---|
227 | }
|
---|
228 |
|
---|
229 | private void SymbolicExpressionTreeGrammarParameter_ValueChanged(object sender, EventArgs e) {
|
---|
230 | UpdateGrammar();
|
---|
231 | }
|
---|
232 |
|
---|
233 | private void ArchitectureParameterValue_ValueChanged(object sender, EventArgs e) {
|
---|
234 | UpdateGrammar();
|
---|
235 | }
|
---|
236 |
|
---|
237 | private void MaximumSymbolicExpressionTreeDepth_ValueChanged(object sender, EventArgs e) {
|
---|
238 | if (MaximumSymbolicExpressionTreeDepth != null && MaximumSymbolicExpressionTreeDepth.Value < 3)
|
---|
239 | MaximumSymbolicExpressionTreeDepth.Value = 3;
|
---|
240 | }
|
---|
241 |
|
---|
242 | protected override void OnSolutionCreatorChanged() {
|
---|
243 | base.OnSolutionCreatorChanged();
|
---|
244 | SolutionCreator.SymbolicExpressionTreeParameter.ActualNameChanged += new EventHandler(SolutionCreator_SymbolicExpressionTreeParameter_ActualNameChanged);
|
---|
245 | ParameterizeOperators();
|
---|
246 | }
|
---|
247 |
|
---|
248 | private void SolutionCreator_SymbolicExpressionTreeParameter_ActualNameChanged(object sender, EventArgs e) {
|
---|
249 | ParameterizeOperators();
|
---|
250 | }
|
---|
251 |
|
---|
252 | protected override void OnEvaluatorChanged() {
|
---|
253 | base.OnEvaluatorChanged();
|
---|
254 | ParameterizeOperators();
|
---|
255 | }
|
---|
256 |
|
---|
257 | public event EventHandler ProblemDataChanged;
|
---|
258 | protected virtual void OnProblemDataChanged() {
|
---|
259 | FitnessCalculationPartition.Start = ProblemData.TrainingPartition.Start;
|
---|
260 | FitnessCalculationPartition.End = ProblemData.TrainingPartition.End;
|
---|
261 |
|
---|
262 | UpdateGrammar();
|
---|
263 | ParameterizeOperators();
|
---|
264 |
|
---|
265 | var handler = ProblemDataChanged;
|
---|
266 | if (handler != null) handler(this, EventArgs.Empty);
|
---|
267 |
|
---|
268 | OnReset();
|
---|
269 | }
|
---|
270 | #endregion
|
---|
271 |
|
---|
272 | protected virtual void ParameterizeOperators() {
|
---|
273 | var operators = Parameters.OfType<IValueParameter>().Select(p => p.Value).OfType<IOperator>().Union(Operators).ToList();
|
---|
274 |
|
---|
275 | foreach (var op in operators.OfType<ISymbolicExpressionTreeGrammarBasedOperator>()) {
|
---|
276 | op.SymbolicExpressionTreeGrammarParameter.ActualName = SymbolicExpressionTreeGrammarParameterName;
|
---|
277 | }
|
---|
278 | foreach (var op in operators.OfType<ISymbolicExpressionTreeSizeConstraintOperator>()) {
|
---|
279 | op.MaximumSymbolicExpressionTreeDepthParameter.ActualName = MaximumSymbolicExpressionTreeDepthParameterName;
|
---|
280 | op.MaximumSymbolicExpressionTreeLengthParameter.ActualName = MaximumSymbolicExpressionTreeLengthParameterName;
|
---|
281 | }
|
---|
282 | foreach (var op in operators.OfType<ISymbolicExpressionTreeArchitectureAlteringOperator>()) {
|
---|
283 | op.MaximumFunctionArgumentsParameter.ActualName = MaximumFunctionArgumentsParameterName;
|
---|
284 | op.MaximumFunctionDefinitionsParameter.ActualName = MaximumFunctionDefinitionsParameterName;
|
---|
285 | }
|
---|
286 | foreach (var op in operators.OfType<ISymbolicDataAnalysisEvaluator<T>>()) {
|
---|
287 | op.ProblemDataParameter.ActualName = ProblemDataParameterName;
|
---|
288 | op.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
|
---|
289 | op.EvaluationPartitionParameter.ActualName = FitnessCalculationPartitionParameter.Name;
|
---|
290 | op.RelativeNumberOfEvaluatedSamplesParameter.ActualName = RelativeNumberOfEvaluatedSamplesParameter.Name;
|
---|
291 | }
|
---|
292 | foreach (var op in operators.OfType<ISymbolicExpressionTreeCrossover>()) {
|
---|
293 | op.ParentsParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
|
---|
294 | op.ChildParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
|
---|
295 | }
|
---|
296 | foreach (var op in operators.OfType<ISymbolicExpressionTreeManipulator>()) {
|
---|
297 | op.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
|
---|
298 | }
|
---|
299 | foreach (var op in operators.OfType<ISymbolicExpressionTreeAnalyzer>()) {
|
---|
300 | op.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
|
---|
301 | }
|
---|
302 | foreach (var op in operators.OfType<ISymbolicDataAnalysisAnalyzer>()) {
|
---|
303 | op.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
|
---|
304 | }
|
---|
305 | foreach (var op in operators.OfType<ISymbolicDataAnalysisValidationAnalyzer<U, T>>()) {
|
---|
306 | op.RelativeNumberOfEvaluatedSamplesParameter.ActualName = RelativeNumberOfEvaluatedSamplesParameter.Name;
|
---|
307 | op.ValidationPartitionParameter.ActualName = ValidationPartitionParameter.Name;
|
---|
308 | }
|
---|
309 | foreach (var op in operators.OfType<ISymbolicDataAnalysisInterpreterOperator>()) {
|
---|
310 | op.SymbolicDataAnalysisTreeInterpreterParameter.ActualName = SymbolicExpressionTreeInterpreterParameterName;
|
---|
311 | }
|
---|
312 | foreach (var op in operators.OfType<ISymbolicDataAnalysisExpressionCrossover<T>>()) {
|
---|
313 | op.EvaluationPartitionParameter.ActualName = FitnessCalculationPartitionParameterName;
|
---|
314 | }
|
---|
315 | foreach (var op in operators.OfType<ISymbolicDataAnalysisExpressionCrossover<T>>()) {
|
---|
316 | op.ProblemDataParameter.ActualName = ProblemDataParameter.Name;
|
---|
317 | op.EvaluationPartitionParameter.ActualName = FitnessCalculationPartitionParameter.Name;
|
---|
318 | op.RelativeNumberOfEvaluatedSamplesParameter.ActualName = RelativeNumberOfEvaluatedSamplesParameter.Name;
|
---|
319 | op.EvaluatorParameter.ActualName = EvaluatorParameter.Name;
|
---|
320 | }
|
---|
321 | var comparers = ApplicationManager.Manager.GetInstances<ISymbolicExpressionTreeNodeComparer>().ToList();
|
---|
322 | if (comparers.Count > 0)
|
---|
323 | foreach (var op in operators.OfType<ITracingSymbolicExpressionTreeOperator>()) {
|
---|
324 | op.SymbolicExpressionTreeNodeComparerParameter.ActualValue = comparers.First();
|
---|
325 | }
|
---|
326 | }
|
---|
327 |
|
---|
328 | #region Import & Export
|
---|
329 | public void Load(T data) {
|
---|
330 | Name = data.Name;
|
---|
331 | Description = data.Description;
|
---|
332 | ProblemData = data;
|
---|
333 | OnReset();
|
---|
334 | }
|
---|
335 |
|
---|
336 | public T Export() {
|
---|
337 | return ProblemData;
|
---|
338 | }
|
---|
339 | #endregion
|
---|
340 | }
|
---|
341 | }
|
---|