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

Last change on this file since 17544 was 17544, checked in by abeham, 8 weeks ago

#2521: worked on refactoring, worked a lot on binary encoding / problems

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