- Timestamp:
- 11/24/15 16:43:32 (9 years ago)
- Location:
- branches/ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/MultiObjectiveProgrammableProblem.cs
r13350 r13365 71 71 : base() { 72 72 Parameters.Add(new FixedValueParameter<MultiObjectiveProblemDefinitionScript<TEncoding, TSolution>>("ProblemScript", "Defines the problem.", 73 new MultiObjectiveProblemDefinitionScript<TEncoding, TSolution>() { Name = Name, Encoding = Encoding })); 73 new MultiObjectiveProblemDefinitionScript<TEncoding, TSolution>() { Name = Name })); 74 ProblemScript.Encoding = Encoding = (TEncoding)Encoding.Clone(); 74 75 RegisterEvents(); 75 76 } … … 87 88 Parameters.Remove("Maximization"); 88 89 Parameters.Add(new ValueParameter<BoolArray>("Maximization", "Set to false if the problem should be minimized.", (BoolArray)new BoolArray(Maximization).AsReadOnly()) { Hidden = true }); 90 var multiEnc = ProblemScript.Encoding as MultiEncoding; 91 if (multiEnc != null) multiEnc.Clear(); 92 ProblemScript.Initialize(); 93 Encoding = (TEncoding)ProblemScript.Encoding.Clone(); 89 94 90 ProblemScript.Initialize();91 95 OnOperatorsChanged(); 92 96 OnReset(); -
branches/ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/SingleObjectiveProgrammableProblem.cs
r13350 r13365 73 73 : base() { 74 74 Parameters.Add(new FixedValueParameter<SingleObjectiveProblemDefinitionScript<TEncoding, TSolution>>("ProblemScript", "Defines the problem.", 75 new SingleObjectiveProblemDefinitionScript<TEncoding, TSolution>() { Name = Name, Encoding = Encoding })); 75 new SingleObjectiveProblemDefinitionScript<TEncoding, TSolution>() { Name = Name })); 76 ProblemScript.Encoding = Encoding = (TEncoding)Encoding.Clone(); 76 77 Operators.Add(new BestScopeSolutionAnalyzer()); 77 78 RegisterEvents(); … … 90 91 Parameters.Remove("Maximization"); 91 92 Parameters.Add(new FixedValueParameter<BoolValue>("Maximization", "Set to false if the problem should be minimized.", (BoolValue)new BoolValue(Maximization).AsReadOnly()) { Hidden = true }); 93 var multiEnc = ProblemScript.Encoding as MultiEncoding; 94 if (multiEnc != null) multiEnc.Clear(); 92 95 ProblemScript.Initialize(); 96 Encoding = (TEncoding)ProblemScript.Encoding.Clone(); 93 97 94 98 OnOperatorsChanged();
Note: See TracChangeset
for help on using the changeset viewer.