- Timestamp:
- 04/18/19 11:01:14 (6 years ago)
- Location:
- branches/2521_ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2521_ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/MultiObjectiveProgrammableProblem.cs
r16751 r16811 71 71 } 72 72 73 public MultiObjectiveProgrammableProblem( )74 : base( ) {73 public MultiObjectiveProgrammableProblem(TEncoding encoding) 74 : base(encoding) { 75 75 Parameters.Add(new FixedValueParameter<MultiObjectiveProblemDefinitionScript<TEncoding, TEncodedSolution>>("ProblemScript", "Defines the problem.", 76 76 new MultiObjectiveProblemDefinitionScript<TEncoding, TEncodedSolution>() { Name = Name })); 77 ProblemScript.Encoding = (TEncoding) Encoding.Clone();77 ProblemScript.Encoding = (TEncoding)encoding.Clone(); 78 78 79 79 var codeTemplate = ScriptTemplates.MultiObjectiveProblem_Template; -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/ProgrammableProblemInstances.cs
r16725 r16811 45 45 46 46 public SingleObjectiveBinaryVectorProgrammableProblem() 47 : base( ) {47 : base(new BinaryVectorEncoding()) { 48 48 var codeTemplate = ScriptTemplates.SingleObjectiveProblem_Template; 49 49 codeTemplate = codeTemplate.Replace(ENCODING_NAMESPACE, "HeuristicLab.Encodings.BinaryVectorEncoding"); … … 69 69 70 70 public SingleObjectiveIntegerVectorProgrammableProblem() 71 : base( ) {71 : base(new IntegerVectorEncoding()) { 72 72 var codeTemplate = ScriptTemplates.SingleObjectiveProblem_Template; 73 73 codeTemplate = codeTemplate.Replace(ENCODING_NAMESPACE, "HeuristicLab.Encodings.IntegerVectorEncoding"); … … 92 92 93 93 public SingleObjectiveRealVectorProgrammableProblem() 94 : base( ) {94 : base(new RealVectorEncoding()) { 95 95 var codeTemplate = ScriptTemplates.SingleObjectiveProblem_Template; 96 96 codeTemplate = codeTemplate.Replace(ENCODING_NAMESPACE, "HeuristicLab.Encodings.RealVectorEncoding"); … … 115 115 116 116 public SingleObjectivePermutationProgrammableProblem() 117 : base( ) {117 : base(new PermutationEncoding()) { 118 118 var codeTemplate = ScriptTemplates.SingleObjectiveProblem_Template; 119 119 codeTemplate = codeTemplate.Replace(ENCODING_NAMESPACE, "HeuristicLab.Encodings.PermutationEncoding"); … … 137 137 private SingleObjectiveSymbolicExpressionTreeProgrammableProblem(SingleObjectiveSymbolicExpressionTreeProgrammableProblem original, Cloner cloner) : base(original, cloner) { } 138 138 public SingleObjectiveSymbolicExpressionTreeProgrammableProblem() 139 : base( ) {139 : base(new SymbolicExpressionTreeEncoding()) { 140 140 var codeTemplate = ScriptTemplates.SingleObjectiveProblem_Template; 141 141 codeTemplate = codeTemplate.Replace(ENCODING_NAMESPACE, "HeuristicLab.Encodings.SymbolicExpressionTreeEncoding"); … … 159 159 private SingleObjectiveLinearLinkageProgrammableProblem(SingleObjectiveLinearLinkageProgrammableProblem original, Cloner cloner) : base(original, cloner) { } 160 160 public SingleObjectiveLinearLinkageProgrammableProblem() 161 : base( ) {161 : base(new LinearLinkageEncoding()) { 162 162 var codeTemplate = ScriptTemplates.SingleObjectiveProblem_Template; 163 163 codeTemplate = codeTemplate.Replace(ENCODING_NAMESPACE, "HeuristicLab.Encodings.LinearLinkageEncoding"); … … 182 182 183 183 public SingleObjectiveCombinedEncodingProgrammableProblem() 184 : base( ) {184 : base(new CombinedEncoding()) { 185 185 ProblemScript.Code = ScriptTemplates.SingleObjectiveCombinedEncodingProblem_Template; 186 186 } … … 204 204 205 205 public MultiObjectiveBinaryVectorProgrammableProblem() 206 : base( ) {206 : base(new BinaryVectorEncoding()) { 207 207 var codeTemplate = ScriptTemplates.MultiObjectiveProblem_Template; 208 208 codeTemplate = codeTemplate.Replace(ENCODING_NAMESPACE, "HeuristicLab.Encodings.BinaryVectorEncoding"); … … 228 228 229 229 public MultiObjectiveIntegerVectorProgrammableProblem() 230 : base( ) {230 : base(new IntegerVectorEncoding()) { 231 231 var codeTemplate = ScriptTemplates.MultiObjectiveProblem_Template; 232 232 codeTemplate = codeTemplate.Replace(ENCODING_NAMESPACE, "HeuristicLab.Encodings.IntegerVectorEncoding"); … … 251 251 252 252 public MultiObjectiveRealVectorProgrammableProblem() 253 : base( ) {253 : base(new RealVectorEncoding()) { 254 254 var codeTemplate = ScriptTemplates.MultiObjectiveProblem_Template; 255 255 codeTemplate = codeTemplate.Replace(ENCODING_NAMESPACE, "HeuristicLab.Encodings.RealVectorEncoding"); … … 273 273 private MultiObjectivePermutationProgrammableProblem(MultiObjectivePermutationProgrammableProblem original, Cloner cloner) : base(original, cloner) { } 274 274 public MultiObjectivePermutationProgrammableProblem() 275 : base( ) {275 : base(new PermutationEncoding()) { 276 276 var codeTemplate = ScriptTemplates.MultiObjectiveProblem_Template; 277 277 codeTemplate = codeTemplate.Replace(ENCODING_NAMESPACE, "HeuristicLab.Encodings.PermutationEncoding"); … … 295 295 private MultiObjectiveSymbolicExpressionTreeProgrammableProblem(MultiObjectiveSymbolicExpressionTreeProgrammableProblem original, Cloner cloner) : base(original, cloner) { } 296 296 public MultiObjectiveSymbolicExpressionTreeProgrammableProblem() 297 : base( ) {297 : base(new SymbolicExpressionTreeEncoding()) { 298 298 var codeTemplate = ScriptTemplates.MultiObjectiveProblem_Template; 299 299 codeTemplate = codeTemplate.Replace(ENCODING_NAMESPACE, "HeuristicLab.Encodings.SymbolicExpressionTreeEncoding"); … … 317 317 private MultiObjectiveLinearLinkageProgrammableProblem(MultiObjectiveLinearLinkageProgrammableProblem original, Cloner cloner) : base(original, cloner) { } 318 318 public MultiObjectiveLinearLinkageProgrammableProblem() 319 : base( ) {319 : base(new LinearLinkageEncoding()) { 320 320 var codeTemplate = ScriptTemplates.MultiObjectiveProblem_Template; 321 321 codeTemplate = codeTemplate.Replace(ENCODING_NAMESPACE, "HeuristicLab.Encodings.LinearLinkageEncoding"); … … 340 340 341 341 public MultiObjectiveCombinedEncodingProgrammableProblem() 342 : base( ) {342 : base(new CombinedEncoding()) { 343 343 ProblemScript.Code = ScriptTemplates.MultiObjectiveCombinedEncodingProblem_Template; 344 344 } -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/SingleObjectiveProgrammableProblem.cs
r16751 r16811 73 73 [StorableConstructor] 74 74 protected SingleObjectiveProgrammableProblem(StorableConstructorFlag _) : base(_) { } 75 public SingleObjectiveProgrammableProblem( )76 : base( ) {75 public SingleObjectiveProgrammableProblem(TEncoding encoding) 76 : base(encoding) { 77 77 Parameters.Add(new FixedValueParameter<SingleObjectiveProblemDefinitionScript<TEncoding, TEncodedSolution>>("ProblemScript", "Defines the problem.", new SingleObjectiveProblemDefinitionScript<TEncoding, TEncodedSolution>() { Name = Name })); 78 ProblemScript.Encoding = (TEncoding) Encoding.Clone();78 ProblemScript.Encoding = (TEncoding)encoding.Clone(); 79 79 80 80 var codeTemplate = ScriptTemplates.SingleObjectiveProblem_Template;
Note: See TracChangeset
for help on using the changeset viewer.