- Timestamp:
- 11/30/15 15:12:34 (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
r13390 r13422 34 34 [Creatable(CreatableAttribute.Categories.Problems, Priority = 120)] 35 35 [StorableClass] 36 public abstractclass MultiObjectiveProgrammableProblem<TEncoding, TSolution> : MultiObjectiveProblem<TEncoding, TSolution>, IProgrammableItem, IProgrammableProblem36 public class MultiObjectiveProgrammableProblem<TEncoding, TSolution> : MultiObjectiveProblem<TEncoding, TSolution>, IProgrammableItem, IProgrammableProblem 37 37 where TEncoding : class, IEncoding<TSolution> 38 38 where TSolution : class, ISolution { … … 66 66 RegisterEvents(); 67 67 } 68 69 public override IDeepCloneable Clone(Cloner cloner) { 70 return new MultiObjectiveProgrammableProblem<TEncoding, TSolution>(this, cloner); 71 } 72 68 73 public MultiObjectiveProgrammableProblem() 69 74 : base() { … … 71 76 new MultiObjectiveProblemDefinitionScript<TEncoding, TSolution>() { Name = Name })); 72 77 ProblemScript.Encoding = (TEncoding)Encoding.Clone(); 78 79 var codeTemplate = ScriptTemplates.MultiObjectiveProblem_Template; 80 codeTemplate = codeTemplate.Replace(ENCODING_NAMESPACE, typeof(TEncoding).Namespace); 81 codeTemplate = codeTemplate.Replace(ENCODING_CLASS, typeof(TEncoding).Name); 82 codeTemplate = codeTemplate.Replace(SOLUTION_CLASS, typeof(TSolution).Name); 83 ProblemScript.Code = codeTemplate; 84 73 85 RegisterEvents(); 74 86 } -
branches/ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/SingleObjectiveProgrammableProblem.cs
r13390 r13422 34 34 namespace HeuristicLab.Problems.Programmable { 35 35 [Item("Programmable Problem (single-objective)", "Represents a single-objective problem that can be programmed with a script.")] 36 [Creatable(CreatableAttribute.Categories.Problems, Priority = 110)] 36 37 [StorableClass] 37 public abstractclass SingleObjectiveProgrammableProblem<TEncoding, TSolution> : SingleObjectiveProblem<TEncoding, TSolution>, IProgrammableItem, IProgrammableProblem38 public class SingleObjectiveProgrammableProblem<TEncoding, TSolution> : SingleObjectiveProblem<TEncoding, TSolution>, IProgrammableItem, IProgrammableProblem 38 39 where TEncoding : class, IEncoding<TSolution> 39 40 where TSolution : class, ISolution { … … 67 68 RegisterEvents(); 68 69 } 70 71 public override IDeepCloneable Clone(Cloner cloner) { 72 return new SingleObjectiveProgrammableProblem<TEncoding, TSolution>(this, cloner); 73 } 74 69 75 public SingleObjectiveProgrammableProblem() 70 76 : base() { 71 Parameters.Add(new FixedValueParameter<SingleObjectiveProblemDefinitionScript<TEncoding, TSolution>>("ProblemScript", "Defines the problem.", 72 new SingleObjectiveProblemDefinitionScript<TEncoding, TSolution>() { Name = Name })); 77 Parameters.Add(new FixedValueParameter<SingleObjectiveProblemDefinitionScript<TEncoding, TSolution>>("ProblemScript", "Defines the problem.", new SingleObjectiveProblemDefinitionScript<TEncoding, TSolution>() { Name = Name })); 73 78 ProblemScript.Encoding = (TEncoding)Encoding.Clone(); 79 80 var codeTemplate = ScriptTemplates.SingleObjectiveProblem_Template; 81 codeTemplate = codeTemplate.Replace(ENCODING_NAMESPACE, typeof(TEncoding).Namespace); 82 codeTemplate = codeTemplate.Replace(ENCODING_CLASS, typeof(TEncoding).Name); 83 codeTemplate = codeTemplate.Replace(SOLUTION_CLASS, typeof(TSolution).Name); 84 ProblemScript.Code = codeTemplate; 85 74 86 Operators.Add(new BestScopeSolutionAnalyzer()); 75 87 RegisterEvents();
Note: See TracChangeset
for help on using the changeset viewer.