Free cookie consent management tool by TermsFeed Policy Generator

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

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

#2521: work in progress (removed solution creator parameter from encoding), OrienteeringProblem and test functions are broken

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