source: branches/ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/MultiObjectiveProgrammableProblems.cs @ 13350

Last change on this file since 13350 was 13350, checked in by mkommend, 7 years ago

#2521: Adapted multi-objective programmable problem.

File size: 7.7 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 HeuristicLab.Common;
25using HeuristicLab.Core;
26using HeuristicLab.Encodings.BinaryVectorEncoding;
27using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
28
29namespace HeuristicLab.Problems.Programmable {
30  [Item("Binary Vector Programmable Problem (multi-objective)", "Represents a binary vector multi-objective problem that can be programmed with a script.")]
31  [Creatable(CreatableAttribute.Categories.Problems, Priority = 100)]
32  [StorableClass]
33  public sealed class MultiObjectiveBinaryVectorProgrammableProblem : MultiObjectiveProgrammableProblem<BinaryVectorEncoding, BinaryVector> {
34
35    [StorableConstructor]
36    private MultiObjectiveBinaryVectorProgrammableProblem(bool deserializing) : base(deserializing) { }
37    private MultiObjectiveBinaryVectorProgrammableProblem(MultiObjectiveBinaryVectorProgrammableProblem original, Cloner cloner) : base(original, cloner) { }
38
39    public MultiObjectiveBinaryVectorProgrammableProblem()
40      : base() {
41      var codeTemplate = ScriptTemplates.CompiledMultiObjectiveProblemDefinition_Template;
42      codeTemplate = codeTemplate.Replace(ENCODING_NAMESPACE, "HeuristicLab.Encodings.BinaryVectorEncoding");
43      codeTemplate = codeTemplate.Replace(ENCODING_CLASS, "BinaryVectorEncoding");
44      codeTemplate = codeTemplate.Replace(SOLUTION_CLASS, "BinaryVector");
45      ProblemScript.Code = codeTemplate;
46    }
47
48
49    public override IDeepCloneable Clone(Cloner cloner) {
50      return new MultiObjectiveBinaryVectorProgrammableProblem(this, cloner);
51    }
52  }
53
54  //TODO
55  /*
56  [Item("Integer Vector Programmable Problem (multi-objective)", "Represents an integer vector multi-objective problem that can be programmed with a script.")]
57  [Creatable(CreatableAttribute.Categories.Problems, Priority = 100)]
58  [StorableClass]
59  public sealed class MultiObjectiveIntegerVectorProgrammableProblem : MultiObjectiveProgrammableProblem<IntegerVectorEncoding, IntegerVector> {
60
61    [StorableConstructor]
62    private MultiObjectiveIntegerVectorProgrammableProblem(bool deserializing) : base(deserializing) { }
63    private MultiObjectiveIntegerVectorProgrammableProblem(MultiObjectiveIntegerVectorProgrammableProblem original, Cloner cloner) : base(original, cloner) { }
64    public MultiObjectiveIntegerVectorProgrammableProblem()
65      : base(string.Format(ScriptTemplates.CompiledMultiObjectiveProblemDefinition, "HeuristicLab.Encodings.IntegerVectorEncoding", "IntegerVectorEncoding", "IntegerVector")) { }
66
67    public override IDeepCloneable Clone(Cloner cloner) {
68      return new MultiObjectiveIntegerVectorProgrammableProblem(this, cloner);
69    }
70  }
71
72  [Item("Real Vector Programmable Problem (multi-objective)", "Represents a real vector multi-objective problem that can be programmed with a script.")]
73  [Creatable(CreatableAttribute.Categories.Problems, Priority = 100)]
74  [StorableClass]
75  public sealed class MultiObjectiveRealVectorProgrammableProblem : MultiObjectiveProgrammableProblem<RealVectorEncoding, RealVector> {
76
77    [StorableConstructor]
78    private MultiObjectiveRealVectorProgrammableProblem(bool deserializing) : base(deserializing) { }
79    private MultiObjectiveRealVectorProgrammableProblem(MultiObjectiveRealVectorProgrammableProblem original, Cloner cloner) : base(original, cloner) { }
80    public MultiObjectiveRealVectorProgrammableProblem()
81      : base(string.Format(ScriptTemplates.CompiledMultiObjectiveProblemDefinition, "HeuristicLab.Encodings.RealVectorEncoding", "RealVectorEncoding", "RealVector")) { }
82
83    public override IDeepCloneable Clone(Cloner cloner) {
84      return new MultiObjectiveRealVectorProgrammableProblem(this, cloner);
85    }
86  }
87
88  [Item("Permutation Programmable Problem (multi-objective)", "Represents a permutation multi-objective problem that can be programmed with a script.")]
89  [Creatable(CreatableAttribute.Categories.Problems, Priority = 100)]
90  [StorableClass]
91  public sealed class MultiObjectivePermutationProgrammableProblem : MultiObjectiveProgrammableProblem<PermutationEncoding, Permutation> {
92
93    [StorableConstructor]
94    private MultiObjectivePermutationProgrammableProblem(bool deserializing) : base(deserializing) { }
95    private MultiObjectivePermutationProgrammableProblem(MultiObjectivePermutationProgrammableProblem original, Cloner cloner) : base(original, cloner) { }
96    public MultiObjectivePermutationProgrammableProblem()
97      : base(string.Format(ScriptTemplates.CompiledMultiObjectiveProblemDefinition, "HeuristicLab.Encodings.PermutationEncoding", "PermutationEncoding", "Permutation")) { }
98
99    public override IDeepCloneable Clone(Cloner cloner) {
100      return new MultiObjectivePermutationProgrammableProblem(this, cloner);
101    }
102  }
103
104  [Item("Symbolic Expression Tree Programmable Problem (multi-objective)", "Represents a symbolic expression tree multi-objective problem that can be programmed with a script.")]
105  [Creatable(CreatableAttribute.Categories.Problems, Priority = 100)]
106  [StorableClass]
107  public sealed class MultiObjectiveSymbolicExpressionTreeProgrammableProblem : MultiObjectiveProgrammableProblem<SymbolicExpressionTreeEncoding, SymbolicExpressionTree> {
108
109    [StorableConstructor]
110    private MultiObjectiveSymbolicExpressionTreeProgrammableProblem(bool deserializing) : base(deserializing) { }
111    private MultiObjectiveSymbolicExpressionTreeProgrammableProblem(MultiObjectiveSymbolicExpressionTreeProgrammableProblem original, Cloner cloner) : base(original, cloner) { }
112    public MultiObjectiveSymbolicExpressionTreeProgrammableProblem()
113      : base(string.Format(ScriptTemplates.CompiledMultiObjectiveProblemDefinition, "HeuristicLab.Encodings.SymbolicExpressionTreeEncoding", "SymbolicExpressionTreeEncoding", "SymbolicExpressionTree")) { }
114
115    public override IDeepCloneable Clone(Cloner cloner) {
116      return new MultiObjectiveSymbolicExpressionTreeProgrammableProblem(this, cloner);
117    }
118  }
119
120  [Item("Linear Linkage Programmable Problem (multi-objective)", "Represents a linear linkage multi-objective problem that can be programmed with a script.")]
121  [Creatable(CreatableAttribute.Categories.Problems, Priority = 100)]
122  [StorableClass]
123  public sealed class MultiObjectiveLinearLinkageProgrammableProblem : MultiObjectiveProgrammableProblem<LinearLinkageEncoding, LinearLinkage> {
124
125    [StorableConstructor]
126    private MultiObjectiveLinearLinkageProgrammableProblem(bool deserializing) : base(deserializing) { }
127    private MultiObjectiveLinearLinkageProgrammableProblem(MultiObjectiveLinearLinkageProgrammableProblem original, Cloner cloner) : base(original, cloner) { }
128    public MultiObjectiveLinearLinkageProgrammableProblem()
129      : base(string.Format(ScriptTemplates.CompiledMultiObjectiveProblemDefinition, "HeuristicLab.Encodings.LinearLinkageEncoding", "LinearLinkageEncoding", "LinearLinkage")) { }
130
131    public override IDeepCloneable Clone(Cloner cloner) {
132      return new MultiObjectiveLinearLinkageProgrammableProblem(this, cloner);
133    }
134  }*/
135}
Note: See TracBrowser for help on using the repository browser.