Free cookie consent management tool by TermsFeed Policy Generator

source: branches/2521_ProblemRefactoring/HeuristicLab.Problems.ExternalEvaluation/3.4/ExternalEvaluationProblemInstances.cs @ 17570

Last change on this file since 17570 was 17570, checked in by abeham, 4 years ago

#2521: adapted knapsack, added base call to symbolic expression tree encoding, changed parameterization operators in base classes

File size: 25.2 KB
Line 
1#region License Information
2
3/* HeuristicLab
4 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
5 *
6 * This file is part of HeuristicLab.
7 *
8 * HeuristicLab is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * (at your option) any later version.
12 *
13 * HeuristicLab is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
20 */
21
22#endregion
23
24using HEAL.Attic;
25using HeuristicLab.Common;
26using HeuristicLab.Core;
27using HeuristicLab.Data;
28using HeuristicLab.Encodings.BinaryVectorEncoding;
29using HeuristicLab.Encodings.IntegerVectorEncoding;
30using HeuristicLab.Encodings.LinearLinkageEncoding;
31using HeuristicLab.Encodings.PermutationEncoding;
32using HeuristicLab.Encodings.RealVectorEncoding;
33using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
34using HeuristicLab.Optimization;
35using HeuristicLab.Parameters;
36
37namespace HeuristicLab.Problems.ExternalEvaluation {
38  #region single-objective
39  [Item("Binary Vector External Evaluation Problem (single-objective)", "Represents a binary vector single-objective problem that is evaluated by a separate process.")]
40  [Creatable(CreatableAttribute.Categories.ExternalEvaluationProblemsSingleObjective, Priority = 100)]
41  [StorableType("4ea0ded8-4451-4011-b88e-4d0680721b01")]
42  public sealed class SingleObjectiveBinaryVectorExternalEvaluationProblem : ExternalEvaluationProblem<BinaryVectorEncoding, BinaryVector> {
43    [Storable] private ReferenceParameter<IntValue> DimensionRefParameter;
44    public IValueParameter<IntValue> DimensionParameter => DimensionRefParameter;
45
46    public int Dimension {
47      get => DimensionRefParameter.Value.Value;
48      set => DimensionRefParameter.Value.Value = value;
49    }
50
51    [StorableConstructor]
52    private SingleObjectiveBinaryVectorExternalEvaluationProblem(StorableConstructorFlag _) : base(_) { }
53    private SingleObjectiveBinaryVectorExternalEvaluationProblem(SingleObjectiveBinaryVectorExternalEvaluationProblem original, Cloner cloner)
54      : base(original, cloner) {
55      DimensionRefParameter = cloner.Clone(original.DimensionRefParameter);
56    }
57
58    public SingleObjectiveBinaryVectorExternalEvaluationProblem()
59      : base(new BinaryVectorEncoding()) {
60      Parameters.Add(DimensionRefParameter = new ReferenceParameter<IntValue>("Dimension", "The dimension of the vector.", Encoding.LengthParameter));
61      // TODO: Add and parameterize additional operators,
62    }
63
64
65    public override IDeepCloneable Clone(Cloner cloner) {
66      return new SingleObjectiveBinaryVectorExternalEvaluationProblem(this, cloner);
67    }
68  }
69
70  [Item("Integer Vector External Evaluation Problem (single-objective)", "Represents an integer vector single-objective problem that is evaluated by a separate process.")]
71  [Creatable(CreatableAttribute.Categories.ExternalEvaluationProblemsSingleObjective, Priority = 101)]
72  [StorableType("46465e8c-11d8-4d02-8c45-de41a08db7fa")]
73  public sealed class SingleObjectiveIntegerVectorExternalEvaluationProblem : ExternalEvaluationProblem<IntegerVectorEncoding, IntegerVector> {
74    [Storable] private ReferenceParameter<IntValue> DimensionRefParameter;
75    public IValueParameter<IntValue> DimensionParameter => DimensionRefParameter;
76    [Storable] private ReferenceParameter<IntMatrix> BoundsRefParameter;
77    public IValueParameter<IntMatrix> BoundsParameter => BoundsRefParameter;
78
79    public int Dimension {
80      get => DimensionRefParameter.Value.Value;
81      set => DimensionRefParameter.Value.Value = value;
82    }
83
84    public IntMatrix Bounds {
85      get => BoundsRefParameter.Value;
86      set => BoundsRefParameter.Value = value;
87    }
88
89    [StorableConstructor]
90    private SingleObjectiveIntegerVectorExternalEvaluationProblem(StorableConstructorFlag _) : base(_) { }
91    private SingleObjectiveIntegerVectorExternalEvaluationProblem(SingleObjectiveIntegerVectorExternalEvaluationProblem original, Cloner cloner)
92      : base(original, cloner) {
93      DimensionRefParameter = cloner.Clone(original.DimensionRefParameter);
94      BoundsRefParameter = cloner.Clone(original.BoundsRefParameter);
95    }
96
97    public SingleObjectiveIntegerVectorExternalEvaluationProblem()
98      : base(new IntegerVectorEncoding()) {
99      Parameters.Add(DimensionRefParameter = new ReferenceParameter<IntValue>("Dimension", "The dimension of the vector.", Encoding.LengthParameter));
100      Parameters.Add(BoundsRefParameter = new ReferenceParameter<IntMatrix>("Bounds", "The bounding box and step size of the elements.", Encoding.BoundsParameter));
101      // TODO: Add and parameterize additional operators,
102    }
103
104
105    public override IDeepCloneable Clone(Cloner cloner) {
106      return new SingleObjectiveIntegerVectorExternalEvaluationProblem(this, cloner);
107    }
108  }
109
110  [Item("Real Vector External Evaluation Problem (single-objective)", "Represents a real vector single-objective problem that is evaluated by a separate process.")]
111  [Creatable(CreatableAttribute.Categories.ExternalEvaluationProblemsSingleObjective, Priority = 102)]
112  [StorableType("637f091f-6601-494e-bafb-2a8ea474210c")]
113  public sealed class SingleObjectiveRealVectorExternalEvaluationProblem : ExternalEvaluationProblem<RealVectorEncoding, RealVector> {
114    [Storable] private ReferenceParameter<IntValue> DimensionRefParameter;
115    public IValueParameter<IntValue> DimensionParameter => DimensionRefParameter;
116    [Storable] private ReferenceParameter<DoubleMatrix> BoundsRefParameter;
117    public IValueParameter<DoubleMatrix> BoundsParameter => BoundsRefParameter;
118
119    public int Dimension {
120      get => DimensionRefParameter.Value.Value;
121      set => DimensionRefParameter.Value.Value = value;
122    }
123
124    public DoubleMatrix Bounds {
125      get => BoundsRefParameter.Value;
126      set => BoundsRefParameter.Value = value;
127    }
128
129    [StorableConstructor]
130    private SingleObjectiveRealVectorExternalEvaluationProblem(StorableConstructorFlag _) : base(_) { }
131    private SingleObjectiveRealVectorExternalEvaluationProblem(SingleObjectiveRealVectorExternalEvaluationProblem original, Cloner cloner)
132      : base(original, cloner) {
133      DimensionRefParameter = cloner.Clone(original.DimensionRefParameter);
134      BoundsRefParameter = cloner.Clone(original.BoundsRefParameter);
135    }
136
137    public SingleObjectiveRealVectorExternalEvaluationProblem()
138      : base(new RealVectorEncoding()) {
139      Parameters.Add(DimensionRefParameter = new ReferenceParameter<IntValue>("Dimension", "The dimension of the vector.", Encoding.LengthParameter));
140      Parameters.Add(BoundsRefParameter = new ReferenceParameter<DoubleMatrix>("Bounds", "The bounding box of the elements.", Encoding.BoundsParameter));
141      // TODO: Add and parameterize additional operators,
142    }
143
144
145    public override IDeepCloneable Clone(Cloner cloner) {
146      return new SingleObjectiveRealVectorExternalEvaluationProblem(this, cloner);
147    }
148  }
149
150  [Item("Permutation External Evaluation Problem (single-objective)", "Represents a permutation single-objective problem that is evaluated by a separate process.")]
151  [Creatable(CreatableAttribute.Categories.ExternalEvaluationProblemsSingleObjective, Priority = 103)]
152  [StorableType("ad9d45f8-b97e-49a7-b3d2-487d9a2cbdf9")]
153  public sealed class SingleObjectivePermutationExternalEvaluationProblem : ExternalEvaluationProblem<PermutationEncoding, Permutation> {
154    [Storable] private ReferenceParameter<IntValue> DimensionRefParameter;
155    public IValueParameter<IntValue> DimensionParameter => DimensionRefParameter;
156
157    public int Dimension {
158      get => DimensionRefParameter.Value.Value;
159      set => DimensionRefParameter.Value.Value = value;
160    }
161
162    [StorableConstructor]
163    private SingleObjectivePermutationExternalEvaluationProblem(StorableConstructorFlag _) : base(_) { }
164    private SingleObjectivePermutationExternalEvaluationProblem(SingleObjectivePermutationExternalEvaluationProblem original, Cloner cloner)
165      : base(original, cloner) {
166      DimensionRefParameter = cloner.Clone(original.DimensionRefParameter);
167    }
168
169    public SingleObjectivePermutationExternalEvaluationProblem()
170      : base(new PermutationEncoding()) {
171      Parameters.Add(DimensionRefParameter = new ReferenceParameter<IntValue>("Dimension", "The dimension of the vector.", Encoding.LengthParameter));
172      // TODO: Add and parameterize additional operators,
173    }
174
175
176    public override IDeepCloneable Clone(Cloner cloner) {
177      return new SingleObjectivePermutationExternalEvaluationProblem(this, cloner);
178    }
179  }
180
181  [Item("Symbolic Expression Tree External Evaluation Problem (single-objective)", "Represents a symbolic expression tree single-objective problem that is evaluated by a separate process.")]
182  [Creatable(CreatableAttribute.Categories.ExternalEvaluationProblemsSingleObjective, Priority = 104)]
183  [StorableType("9b3ee4a8-7076-4edd-ae7e-4188bc49aaa3")]
184  public sealed class SingleObjectiveSymbolicExpressionTreeExternalEvaluationProblem : ExternalEvaluationProblem<SymbolicExpressionTreeEncoding, ISymbolicExpressionTree> {
185
186    [StorableConstructor]
187    private SingleObjectiveSymbolicExpressionTreeExternalEvaluationProblem(StorableConstructorFlag _) : base(_) { }
188    private SingleObjectiveSymbolicExpressionTreeExternalEvaluationProblem(SingleObjectiveSymbolicExpressionTreeExternalEvaluationProblem original, Cloner cloner) : base(original, cloner) { }
189
190    public SingleObjectiveSymbolicExpressionTreeExternalEvaluationProblem()
191      : base(new SymbolicExpressionTreeEncoding()) {
192      // TODO: Change to ReferenceParameter
193      var lengthParameter = new FixedValueParameter<IntValue>("TreeLength", "The total amount of nodes.", new IntValue(50));
194      Parameters.Add(lengthParameter);
195      Encoding.TreeLengthParameter = lengthParameter;
196      var depthParameter = new FixedValueParameter<IntValue>("TreeDepth", "The depth of the tree.", new IntValue(10));
197      Parameters.Add(depthParameter);
198      Encoding.TreeDepthParameter = depthParameter;
199      // TODO: Add and parameterize additional operators,
200    }
201
202
203    public override IDeepCloneable Clone(Cloner cloner) {
204      return new SingleObjectiveSymbolicExpressionTreeExternalEvaluationProblem(this, cloner);
205    }
206  }
207
208  [Item("Linear Linkage External Evaluation Problem (single-objective)", "Represents a linear linkage single-objective problem that is evaluated by a separate process.")]
209  [Creatable(CreatableAttribute.Categories.ExternalEvaluationProblemsSingleObjective, Priority = 105)]
210  [StorableType("945a35d9-89a8-4423-9ea0-21829ac68887")]
211  public sealed class SingleObjectiveLinearLinkageExternalEvaluationProblem : ExternalEvaluationProblem<LinearLinkageEncoding, LinearLinkage> {
212    [Storable] private ReferenceParameter<IntValue> DimensionRefParameter;
213    public IValueParameter<IntValue> DimensionParameter => DimensionRefParameter;
214
215    public int Dimension {
216      get => DimensionRefParameter.Value.Value;
217      set => DimensionRefParameter.Value.Value = value;
218    }
219
220    [StorableConstructor]
221    private SingleObjectiveLinearLinkageExternalEvaluationProblem(StorableConstructorFlag _) : base(_) { }
222    private SingleObjectiveLinearLinkageExternalEvaluationProblem(SingleObjectiveLinearLinkageExternalEvaluationProblem original, Cloner cloner)
223      : base(original, cloner) {
224      DimensionRefParameter = cloner.Clone(original.DimensionRefParameter);
225    }
226
227    public SingleObjectiveLinearLinkageExternalEvaluationProblem()
228      : base(new LinearLinkageEncoding()) {
229      Parameters.Add(DimensionRefParameter = new ReferenceParameter<IntValue>("Dimension", "The dimension of the vector.", Encoding.LengthParameter));
230      // TODO: Add and parameterize additional operators,
231    }
232
233
234    public override IDeepCloneable Clone(Cloner cloner) {
235      return new SingleObjectiveLinearLinkageExternalEvaluationProblem(this, cloner);
236    }
237  }
238
239  [Item("Combined Encoding External Evaluation Problem (single-objective)", "Represents a combined encoding single-objective problem that is evaluated by a separate process.")]
240  [Creatable(CreatableAttribute.Categories.ExternalEvaluationProblemsSingleObjective, Priority = 1000)]
241  [StorableType("0effb975-c1ff-4485-afc9-5f4cf30ac62b")]
242  public sealed class SingleObjectiveCombinedEncodingExternalEvaluationProblem : ExternalEvaluationProblem<CombinedEncoding, CombinedSolution> {
243
244    [StorableConstructor]
245    private SingleObjectiveCombinedEncodingExternalEvaluationProblem(StorableConstructorFlag _) : base(_) { }
246    private SingleObjectiveCombinedEncodingExternalEvaluationProblem(SingleObjectiveCombinedEncodingExternalEvaluationProblem original, Cloner cloner) : base(original, cloner) { }
247    public SingleObjectiveCombinedEncodingExternalEvaluationProblem() : base(new CombinedEncoding()) { }
248
249    public override IDeepCloneable Clone(Cloner cloner) {
250      return new SingleObjectiveCombinedEncodingExternalEvaluationProblem(this, cloner);
251    }
252  }
253  #endregion
254
255  #region multi-objective
256  [Item("Binary Vector External Evaluation Problem (multi-objective)", "Represents a binary vector multi-objective problem that is evaluated by a separate process.")]
257  [Creatable(CreatableAttribute.Categories.ExternalEvaluationProblemsMultiObjective, Priority = 100)]
258  [StorableType("f14c7e88-b74d-4cad-ae55-83daf7b4c288")]
259  public sealed class MultiObjectiveBinaryVectorExternalEvaluationProblem : MultiObjectiveExternalEvaluationProblem<BinaryVectorEncoding, BinaryVector> {
260    [Storable] private ReferenceParameter<IntValue> DimensionRefParameter;
261    public IValueParameter<IntValue> DimensionParameter => DimensionRefParameter;
262
263    public int Dimension {
264      get => DimensionRefParameter.Value.Value;
265      set => DimensionRefParameter.Value.Value = value;
266    }
267
268    [StorableConstructor]
269    private MultiObjectiveBinaryVectorExternalEvaluationProblem(StorableConstructorFlag _) : base(_) { }
270    private MultiObjectiveBinaryVectorExternalEvaluationProblem(MultiObjectiveBinaryVectorExternalEvaluationProblem original, Cloner cloner)
271      : base(original, cloner) {
272      DimensionRefParameter = cloner.Clone(original.DimensionRefParameter);
273    }
274
275    public MultiObjectiveBinaryVectorExternalEvaluationProblem()
276      : base(new BinaryVectorEncoding()) {
277      Parameters.Add(DimensionRefParameter = new ReferenceParameter<IntValue>("Dimension", "The dimension of the vector.", Encoding.LengthParameter));
278      // TODO: Add and parameterize additional operators,
279    }
280
281
282    public override IDeepCloneable Clone(Cloner cloner) {
283      return new MultiObjectiveBinaryVectorExternalEvaluationProblem(this, cloner);
284    }
285  }
286
287  [Item("Integer Vector External Evaluation Problem (multi-objective)", "Represents an integer vector multi-objective problem that is evaluated by a separate process.")]
288  [Creatable(CreatableAttribute.Categories.ExternalEvaluationProblemsMultiObjective, Priority = 101)]
289  [StorableType("90a82c2f-6c37-4ffd-8495-bee278c583d3")]
290  public sealed class MultiObjectiveIntegerVectorExternalEvaluationProblem : MultiObjectiveExternalEvaluationProblem<IntegerVectorEncoding, IntegerVector> {
291    [Storable] private ReferenceParameter<IntValue> DimensionRefParameter;
292    public IValueParameter<IntValue> DimensionParameter => DimensionRefParameter;
293    [Storable] private ReferenceParameter<IntMatrix> BoundsRefParameter;
294    public IValueParameter<IntMatrix> BoundsParameter => BoundsRefParameter;
295
296    public int Dimension {
297      get => DimensionRefParameter.Value.Value;
298      set => DimensionRefParameter.Value.Value = value;
299    }
300
301    public IntMatrix Bounds {
302      get => BoundsRefParameter.Value;
303      set => BoundsRefParameter.Value = value;
304    }
305
306    [StorableConstructor]
307    private MultiObjectiveIntegerVectorExternalEvaluationProblem(StorableConstructorFlag _) : base(_) { }
308    private MultiObjectiveIntegerVectorExternalEvaluationProblem(MultiObjectiveIntegerVectorExternalEvaluationProblem original, Cloner cloner)
309      : base(original, cloner) {
310      DimensionRefParameter = cloner.Clone(original.DimensionRefParameter);
311      BoundsRefParameter = cloner.Clone(original.BoundsRefParameter);
312    }
313
314    public MultiObjectiveIntegerVectorExternalEvaluationProblem()
315      : base(new IntegerVectorEncoding()) {
316      Parameters.Add(DimensionRefParameter = new ReferenceParameter<IntValue>("Dimension", "The dimension of the vector.", Encoding.LengthParameter));
317      Parameters.Add(BoundsRefParameter = new ReferenceParameter<IntMatrix>("Bounds", "The bounding box and step size of the elements.", Encoding.BoundsParameter));
318      // TODO: Add and parameterize additional operators,
319    }
320
321
322    public override IDeepCloneable Clone(Cloner cloner) {
323      return new MultiObjectiveIntegerVectorExternalEvaluationProblem(this, cloner);
324    }
325  }
326
327  [Item("Real Vector External Evaluation Problem (multi-objective)", "Represents a real vector multi-objective problem that is evaluated by a separate process.")]
328  [Creatable(CreatableAttribute.Categories.ExternalEvaluationProblemsMultiObjective, Priority = 102)]
329  [StorableType("38e1d068-d569-48c5-bad6-cbdd685b7c6b")]
330  public sealed class MultiObjectiveRealVectorExternalEvaluationProblem : MultiObjectiveExternalEvaluationProblem<RealVectorEncoding, RealVector> {
331    [Storable] private ReferenceParameter<IntValue> DimensionRefParameter;
332    public IValueParameter<IntValue> DimensionParameter => DimensionRefParameter;
333    [Storable] private ReferenceParameter<DoubleMatrix> BoundsRefParameter;
334    public IValueParameter<DoubleMatrix> BoundsParameter => BoundsRefParameter;
335
336    public int Dimension {
337      get => DimensionRefParameter.Value.Value;
338      set => DimensionRefParameter.Value.Value = value;
339    }
340
341    public DoubleMatrix Bounds {
342      get => BoundsRefParameter.Value;
343      set => BoundsRefParameter.Value = value;
344    }
345
346    [StorableConstructor]
347    private MultiObjectiveRealVectorExternalEvaluationProblem(StorableConstructorFlag _) : base(_) { }
348    private MultiObjectiveRealVectorExternalEvaluationProblem(MultiObjectiveRealVectorExternalEvaluationProblem original, Cloner cloner)
349      : base(original, cloner) {
350      DimensionRefParameter = cloner.Clone(original.DimensionRefParameter);
351      BoundsRefParameter = cloner.Clone(original.BoundsRefParameter);
352    }
353
354    public MultiObjectiveRealVectorExternalEvaluationProblem()
355      : base(new RealVectorEncoding()) {
356      Parameters.Add(DimensionRefParameter = new ReferenceParameter<IntValue>("Dimension", "The dimension of the vector.", Encoding.LengthParameter));
357      Parameters.Add(BoundsRefParameter = new ReferenceParameter<DoubleMatrix>("Bounds", "The bounding box of the elements.", Encoding.BoundsParameter));
358      // TODO: Add and parameterize additional operators,
359    }
360
361
362    public override IDeepCloneable Clone(Cloner cloner) {
363      return new MultiObjectiveRealVectorExternalEvaluationProblem(this, cloner);
364    }
365  }
366
367  [Item("Permutation External Evaluation Problem (multi-objective)", "Represents a permutation multi-objective problem that is evaluated by a separate process.")]
368  [Creatable(CreatableAttribute.Categories.ExternalEvaluationProblemsMultiObjective, Priority = 103)]
369  [StorableType("f1b265b0-ac7c-4c36-b346-5b3f2c37694b")]
370  public sealed class MultiObjectivePermutationExternalEvaluationProblem : MultiObjectiveExternalEvaluationProblem<PermutationEncoding, Permutation> {
371    [Storable] private ReferenceParameter<IntValue> DimensionRefParameter;
372    public IValueParameter<IntValue> DimensionParameter => DimensionRefParameter;
373
374    public int Dimension {
375      get => DimensionRefParameter.Value.Value;
376      set => DimensionRefParameter.Value.Value = value;
377    }
378
379    [StorableConstructor]
380    private MultiObjectivePermutationExternalEvaluationProblem(StorableConstructorFlag _) : base(_) { }
381    private MultiObjectivePermutationExternalEvaluationProblem(MultiObjectivePermutationExternalEvaluationProblem original, Cloner cloner)
382      : base(original, cloner) {
383      DimensionRefParameter = cloner.Clone(original.DimensionRefParameter);
384    }
385
386    public MultiObjectivePermutationExternalEvaluationProblem()
387      : base(new PermutationEncoding()) {
388      Parameters.Add(DimensionRefParameter = new ReferenceParameter<IntValue>("Dimension", "The dimension of the vector.", Encoding.LengthParameter));
389      // TODO: Add and parameterize additional operators,
390    }
391
392
393    public override IDeepCloneable Clone(Cloner cloner) {
394      return new MultiObjectivePermutationExternalEvaluationProblem(this, cloner);
395    }
396  }
397
398  [Item("Symbolic Expression Tree External Evaluation Problem (multi-objective)", "Represents a symbolic expression tree multi-objective problem that is evaluated by a separate process.")]
399  [Creatable(CreatableAttribute.Categories.ExternalEvaluationProblemsMultiObjective, Priority = 104)]
400  [StorableType("fb6834e2-2d56-4711-a3f8-5e0ab55cd040")]
401  public sealed class MultiObjectiveSymbolicExpressionTreeExternalEvaluationProblem : MultiObjectiveExternalEvaluationProblem<SymbolicExpressionTreeEncoding, ISymbolicExpressionTree> {
402
403    [StorableConstructor]
404    private MultiObjectiveSymbolicExpressionTreeExternalEvaluationProblem(StorableConstructorFlag _) : base(_) { }
405    private MultiObjectiveSymbolicExpressionTreeExternalEvaluationProblem(MultiObjectiveSymbolicExpressionTreeExternalEvaluationProblem original, Cloner cloner) : base(original, cloner) { }
406
407    public MultiObjectiveSymbolicExpressionTreeExternalEvaluationProblem()
408      : base(new SymbolicExpressionTreeEncoding()) {
409      // TODO: Change to ReferenceParameter
410      var lengthParameter = new FixedValueParameter<IntValue>("TreeLength", "The total amount of nodes.", new IntValue(50));
411      Parameters.Add(lengthParameter);
412      Encoding.TreeLengthParameter = lengthParameter;
413      var depthParameter = new FixedValueParameter<IntValue>("TreeDepth", "The depth of the tree.", new IntValue(10));
414      Parameters.Add(depthParameter);
415      Encoding.TreeDepthParameter = depthParameter;
416      // TODO: Add and parameterize additional operators,
417    }
418
419
420    public override IDeepCloneable Clone(Cloner cloner) {
421      return new MultiObjectiveSymbolicExpressionTreeExternalEvaluationProblem(this, cloner);
422    }
423  }
424
425  [Item("Linear Linkage External Evaluation Problem (multi-objective)", "Represents a linear linkage multi-objective problem that is evaluated by a separate process.")]
426  [Creatable(CreatableAttribute.Categories.ExternalEvaluationProblemsMultiObjective, Priority = 105)]
427  [StorableType("ed0c1129-651d-465f-87b0-f412f3e3b3d1")]
428  public sealed class MultiObjectiveLinearLinkageExternalEvaluationProblem : MultiObjectiveExternalEvaluationProblem<LinearLinkageEncoding, LinearLinkage> {
429    [Storable] private ReferenceParameter<IntValue> DimensionRefParameter;
430    public IValueParameter<IntValue> DimensionParameter => DimensionRefParameter;
431
432    public int Dimension {
433      get => DimensionRefParameter.Value.Value;
434      set => DimensionRefParameter.Value.Value = value;
435    }
436
437    [StorableConstructor]
438    private MultiObjectiveLinearLinkageExternalEvaluationProblem(StorableConstructorFlag _) : base(_) { }
439    private MultiObjectiveLinearLinkageExternalEvaluationProblem(MultiObjectiveLinearLinkageExternalEvaluationProblem original, Cloner cloner)
440      : base(original, cloner) {
441      DimensionRefParameter = cloner.Clone(original.DimensionRefParameter);
442    }
443
444    public MultiObjectiveLinearLinkageExternalEvaluationProblem()
445      : base(new LinearLinkageEncoding()) {
446      Parameters.Add(DimensionRefParameter = new ReferenceParameter<IntValue>("Dimension", "The dimension of the vector.", Encoding.LengthParameter));
447      // TODO: Add and parameterize additional operators,
448    }
449
450
451    public override IDeepCloneable Clone(Cloner cloner) {
452      return new MultiObjectiveLinearLinkageExternalEvaluationProblem(this, cloner);
453    }
454  }
455
456  [Item("Combined Encoding External Evaluation Problem (multi-objective)", "Represents a combined encoding multi-objective problem that is evaluated by a separate process.")]
457  [Creatable(CreatableAttribute.Categories.ExternalEvaluationProblemsMultiObjective, Priority = 1000)]
458  [StorableType("5f136869-1750-4d96-ba7e-b25edd2bcab1")]
459  public sealed class MultiObjectiveCombinedEncodingExternalEvaluationProblem : MultiObjectiveExternalEvaluationProblem<CombinedEncoding, CombinedSolution> {
460
461    [StorableConstructor]
462    private MultiObjectiveCombinedEncodingExternalEvaluationProblem(StorableConstructorFlag _) : base(_) { }
463    private MultiObjectiveCombinedEncodingExternalEvaluationProblem(MultiObjectiveCombinedEncodingExternalEvaluationProblem original, Cloner cloner) : base(original, cloner) { }
464    public MultiObjectiveCombinedEncodingExternalEvaluationProblem() : base(new CombinedEncoding()) { }
465
466    public override IDeepCloneable Clone(Cloner cloner) {
467      return new MultiObjectiveCombinedEncodingExternalEvaluationProblem(this, cloner);
468    }
469  }
470  #endregion
471}
Note: See TracBrowser for help on using the repository browser.