Free cookie consent management tool by TermsFeed Policy Generator

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

Last change on this file since 13357 was 13357, checked in by abeham, 8 years ago

#2521: changed solution name of combined encoding

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