Changeset 13350
- Timestamp:
- 11/23/15 21:38:35 (9 years ago)
- Location:
- branches/ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3
- Files:
-
- 1 added
- 6 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/HeuristicLab.Problems.Programmable-3.3.csproj
r13348 r13350 90 90 </Compile> 91 91 <Compile Include="Interfaces\IProgrammableProblem.cs" /> 92 <Compile Include="MultiObjectiveProblemDefinitionScript.cs" /> 93 <Compile Include="MultiObjectiveProgrammableProblem.cs" /> 92 94 <Compile Include="ProblemDefinitionScript.cs"> 93 95 <SubType>Code</SubType> 94 96 </Compile> 95 97 <Compile Include="ProblemDefinitionScriptException.cs" /> 98 <Compile Include="MultiObjectiveProgrammableProblems.cs" /> 96 99 <Compile Include="SingleObjectiveProgrammableProblems.cs" /> 97 100 <Content Include="Templates\CompiledSingleObjectiveProblemDefinition_Template.cs" /> 101 <Content Include="Templates\CompiledMultiObjectiveProblemDefinition_Template.cs"> 102 <SubType>Code</SubType> 103 </Content> 98 104 <Compile Include="Templates\ScriptTemplates.Designer.cs"> 99 105 <AutoGen>True</AutoGen> -
branches/ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/MultiObjectiveProblemDefinitionScript.cs
r13218 r13350 28 28 [Item("Multi-objective Problem Definition Script", "Script that defines the parameter vector and evaluates the solution for a programmable problem.")] 29 29 [StorableClass] 30 public sealed class MultiObjectiveProblemDefinitionScript : ProblemDefinitionScript, IMultiObjectiveProblemDefinition, IStorableContent { 30 public sealed class MultiObjectiveProblemDefinitionScript<TEncoding, TSolution> : ProblemDefinitionScript<TEncoding, TSolution>, IMultiObjectiveProblemDefinition<TEncoding, TSolution>, IStorableContent 31 where TEncoding : class, IEncoding<TSolution> 32 where TSolution : class, ISolution { 31 33 public string Filename { get; set; } 32 34 33 private new IMultiObjectiveProblemDefinition CompiledProblemDefinition {34 get { return (IMultiObjectiveProblemDefinition )base.CompiledProblemDefinition; }35 private new IMultiObjectiveProblemDefinition<TEncoding, TSolution> CompiledProblemDefinition { 36 get { return (IMultiObjectiveProblemDefinition<TEncoding, TSolution>)base.CompiledProblemDefinition; } 35 37 } 36 38 37 39 [StorableConstructor] 38 40 private MultiObjectiveProblemDefinitionScript(bool deserializing) : base(deserializing) { } 39 private MultiObjectiveProblemDefinitionScript(MultiObjectiveProblemDefinitionScript original, Cloner cloner) : base(original, cloner) { }40 public MultiObjectiveProblemDefinitionScript() : base(ScriptTemplates.CompiledMultiObjectiveProblemDefinition ) { }41 private MultiObjectiveProblemDefinitionScript(MultiObjectiveProblemDefinitionScript<TEncoding, TSolution> original, Cloner cloner) : base(original, cloner) { } 42 public MultiObjectiveProblemDefinitionScript() : base(ScriptTemplates.CompiledMultiObjectiveProblemDefinition_Template) { } 41 43 42 44 public override IDeepCloneable Clone(Cloner cloner) { 43 return new MultiObjectiveProblemDefinitionScript (this, cloner);45 return new MultiObjectiveProblemDefinitionScript<TEncoding, TSolution>(this, cloner); 44 46 } 45 47 46 bool[] IMultiObjectiveProblemDefinition .Maximization {48 bool[] IMultiObjectiveProblemDefinition<TEncoding, TSolution>.Maximization { 47 49 get { return CompiledProblemDefinition.Maximization; } 48 50 } 49 51 50 double[] IMultiObjectiveProblemDefinition .Evaluate(Individualindividual, IRandom random) {52 double[] IMultiObjectiveProblemDefinition<TEncoding, TSolution>.Evaluate(TSolution individual, IRandom random) { 51 53 return CompiledProblemDefinition.Evaluate(individual, random); 52 54 } 53 55 54 void IMultiObjectiveProblemDefinition .Analyze(Individual[] individuals, double[][] qualities, ResultCollection results, IRandom random) {56 void IMultiObjectiveProblemDefinition<TEncoding, TSolution>.Analyze(TSolution[] individuals, double[][] qualities, ResultCollection results, IRandom random) { 55 57 CompiledProblemDefinition.Analyze(individuals, qualities, results, random); 56 58 } -
branches/ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/MultiObjectiveProgrammableProblem.cs
r13336 r13350 28 28 using HeuristicLab.Parameters; 29 29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 30 using HeuristicLab.Scripting; 30 31 31 32 namespace HeuristicLab.Problems.Programmable { … … 33 34 [Creatable(CreatableAttribute.Categories.Problems, Priority = 120)] 34 35 [StorableClass] 35 public sealed class MultiObjectiveProgrammableProblem : MultiObjectiveProblem<IEncoding>, IProgrammableItem { 36 public class MultiObjectiveProgrammableProblem<TEncoding, TSolution> : MultiObjectiveProblem<TEncoding, TSolution>, IProgrammableItem, IProgrammableProblem 37 where TEncoding : class, IEncoding<TSolution> 38 where TSolution : class, ISolution { 39 protected static readonly string ENCODING_NAMESPACE = "ENCODING_NAMESPACE"; 40 protected static readonly string ENCODING_CLASS = "ENCODING_CLASS"; 41 protected static readonly string SOLUTION_CLASS = "SOLUTION_CLASS"; 42 36 43 public static new Image StaticItemImage { 37 44 get { return VSImageLibrary.Script; } 38 45 } 39 46 40 private FixedValueParameter<MultiObjectiveProblemDefinitionScript > MultiObjectiveProblemScriptParameter {41 get { return (FixedValueParameter<MultiObjectiveProblemDefinitionScript >)Parameters["ProblemScript"]; }47 private FixedValueParameter<MultiObjectiveProblemDefinitionScript<TEncoding, TSolution>> MultiObjectiveProblemScriptParameter { 48 get { return (FixedValueParameter<MultiObjectiveProblemDefinitionScript<TEncoding, TSolution>>)Parameters["ProblemScript"]; } 42 49 } 43 50 44 public MultiObjectiveProblemDefinitionScript ProblemScript { 51 Script IProgrammableProblem.ProblemScript { 52 get { return ProblemScript; } 53 } 54 public MultiObjectiveProblemDefinitionScript<TEncoding, TSolution> ProblemScript { 45 55 get { return MultiObjectiveProblemScriptParameter.Value; } 46 56 } 47 57 48 public IMultiObjectiveProblemDefinition ProblemDefinition {58 public IMultiObjectiveProblemDefinition<TEncoding, TSolution> ProblemDefinition { 49 59 get { return MultiObjectiveProblemScriptParameter.Value; } 50 60 } 51 61 52 pr ivate MultiObjectiveProgrammableProblem(MultiObjectiveProgrammableProblemoriginal, Cloner cloner)62 protected MultiObjectiveProgrammableProblem(MultiObjectiveProgrammableProblem<TEncoding, TSolution> original, Cloner cloner) 53 63 : base(original, cloner) { 54 64 RegisterEvents(); 55 65 } 56 public override IDeepCloneable Clone(Cloner cloner) { return new MultiObjectiveProgrammableProblem (this, cloner); }66 public override IDeepCloneable Clone(Cloner cloner) { return new MultiObjectiveProgrammableProblem<TEncoding, TSolution>(this, cloner); } 57 67 58 68 [StorableConstructor] 59 pr ivateMultiObjectiveProgrammableProblem(bool deserializing) : base(deserializing) { }69 protected MultiObjectiveProgrammableProblem(bool deserializing) : base(deserializing) { } 60 70 public MultiObjectiveProgrammableProblem() 61 71 : base() { 62 Parameters.Add(new FixedValueParameter<MultiObjectiveProblemDefinitionScript>("ProblemScript", "Defines the problem.", new MultiObjectiveProblemDefinitionScript() { Name = Name })); 72 Parameters.Add(new FixedValueParameter<MultiObjectiveProblemDefinitionScript<TEncoding, TSolution>>("ProblemScript", "Defines the problem.", 73 new MultiObjectiveProblemDefinitionScript<TEncoding, TSolution>() { Name = Name, Encoding = Encoding })); 63 74 RegisterEvents(); 64 75 } … … 77 88 Parameters.Add(new ValueParameter<BoolArray>("Maximization", "Set to false if the problem should be minimized.", (BoolArray)new BoolArray(Maximization).AsReadOnly()) { Hidden = true }); 78 89 79 Encoding = ProblemDefinition.Encoding;90 ProblemScript.Initialize(); 80 91 OnOperatorsChanged(); 81 92 OnReset(); … … 86 97 } 87 98 88 public override double[] Evaluate( Individualindividual, IRandom random) {99 public override double[] Evaluate(TSolution individual, IRandom random) { 89 100 return ProblemDefinition.Evaluate(individual, random); 90 101 } 91 102 92 public override void Analyze( Individual[] individuals, double[][] qualities, ResultCollection results, IRandom random) {103 public override void Analyze(TSolution[] individuals, double[][] qualities, ResultCollection results, IRandom random) { 93 104 ProblemDefinition.Analyze(individuals, qualities, results, random); 94 105 } -
branches/ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/MultiObjectiveProgrammableProblems.cs
r13348 r13350 28 28 29 29 namespace HeuristicLab.Problems.Programmable { 30 [Item("Binary Vector Programmable Problem ( single-objective)", "Represents a binary vector single-objective problem that can be programmed with a script.")]30 [Item("Binary Vector Programmable Problem (multi-objective)", "Represents a binary vector multi-objective problem that can be programmed with a script.")] 31 31 [Creatable(CreatableAttribute.Categories.Problems, Priority = 100)] 32 32 [StorableClass] 33 public sealed class SingleObjectiveBinaryVectorProgrammableProblem : SingleObjectiveProgrammableProblem<BinaryVectorEncoding, BinaryVector> {33 public sealed class MultiObjectiveBinaryVectorProgrammableProblem : MultiObjectiveProgrammableProblem<BinaryVectorEncoding, BinaryVector> { 34 34 35 35 [StorableConstructor] 36 private SingleObjectiveBinaryVectorProgrammableProblem(bool deserializing) : base(deserializing) { }37 private SingleObjectiveBinaryVectorProgrammableProblem(SingleObjectiveBinaryVectorProgrammableProblem original, Cloner cloner) : base(original, cloner) { }36 private MultiObjectiveBinaryVectorProgrammableProblem(bool deserializing) : base(deserializing) { } 37 private MultiObjectiveBinaryVectorProgrammableProblem(MultiObjectiveBinaryVectorProgrammableProblem original, Cloner cloner) : base(original, cloner) { } 38 38 39 public SingleObjectiveBinaryVectorProgrammableProblem()39 public MultiObjectiveBinaryVectorProgrammableProblem() 40 40 : base() { 41 var codeTemplate = ScriptTemplates.Compiled SingleObjectiveProblemDefinition_Template;41 var codeTemplate = ScriptTemplates.CompiledMultiObjectiveProblemDefinition_Template; 42 42 codeTemplate = codeTemplate.Replace(ENCODING_NAMESPACE, "HeuristicLab.Encodings.BinaryVectorEncoding"); 43 43 codeTemplate = codeTemplate.Replace(ENCODING_CLASS, "BinaryVectorEncoding"); … … 48 48 49 49 public override IDeepCloneable Clone(Cloner cloner) { 50 return new SingleObjectiveBinaryVectorProgrammableProblem(this, cloner); 51 } 52 } 53 /* 54 [Item("Integer Vector Programmable Problem (single-objective)", "Represents an integer vector single-objective problem that can be programmed with a script.")] 55 [Creatable(CreatableAttribute.Categories.Problems, Priority = 100)] 56 [StorableClass] 57 public sealed class SingleObjectiveIntegerVectorProgrammableProblem : SingleObjectiveProgrammableProblem<IntegerVectorEncoding, IntegerVector> { 58 59 [StorableConstructor] 60 private SingleObjectiveIntegerVectorProgrammableProblem(bool deserializing) : base(deserializing) { } 61 private SingleObjectiveIntegerVectorProgrammableProblem(SingleObjectiveIntegerVectorProgrammableProblem original, Cloner cloner) : base(original, cloner) { } 62 public SingleObjectiveIntegerVectorProgrammableProblem() 63 : base(string.Format(ScriptTemplates.CompiledSingleObjectiveProblemDefinition, "HeuristicLab.Encodings.IntegerVectorEncoding", "IntegerVectorEncoding", "IntegerVector")) { } 64 65 public override IDeepCloneable Clone(Cloner cloner) { 66 return new SingleObjectiveIntegerVectorProgrammableProblem(this, cloner); 50 return new MultiObjectiveBinaryVectorProgrammableProblem(this, cloner); 67 51 } 68 52 } 69 53 70 [Item("Real Vector Programmable Problem (single-objective)", "Represents a real vector single-objective problem that can be programmed with a script.")] 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.")] 71 57 [Creatable(CreatableAttribute.Categories.Problems, Priority = 100)] 72 58 [StorableClass] 73 public sealed class SingleObjectiveRealVectorProgrammableProblem : SingleObjectiveProgrammableProblem<RealVectorEncoding, RealVector> {59 public sealed class MultiObjectiveIntegerVectorProgrammableProblem : MultiObjectiveProgrammableProblem<IntegerVectorEncoding, IntegerVector> { 74 60 75 61 [StorableConstructor] 76 private SingleObjectiveRealVectorProgrammableProblem(bool deserializing) : base(deserializing) { }77 private SingleObjectiveRealVectorProgrammableProblem(SingleObjectiveRealVectorProgrammableProblem original, Cloner cloner) : base(original, cloner) { }78 public SingleObjectiveRealVectorProgrammableProblem()79 : base(string.Format(ScriptTemplates.Compiled SingleObjectiveProblemDefinition, "HeuristicLab.Encodings.RealVectorEncoding", "RealVectorEncoding", "RealVector")) { }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")) { } 80 66 81 67 public override IDeepCloneable Clone(Cloner cloner) { 82 return new SingleObjectiveRealVectorProgrammableProblem(this, cloner);68 return new MultiObjectiveIntegerVectorProgrammableProblem(this, cloner); 83 69 } 84 70 } 85 71 86 [Item(" Permutation Programmable Problem (single-objective)", "Represents a permutation single-objective problem that can be programmed with a script.")]72 [Item("Real Vector Programmable Problem (multi-objective)", "Represents a real vector multi-objective problem that can be programmed with a script.")] 87 73 [Creatable(CreatableAttribute.Categories.Problems, Priority = 100)] 88 74 [StorableClass] 89 public sealed class SingleObjectivePermutationProgrammableProblem : SingleObjectiveProgrammableProblem<PermutationEncoding, Permutation> {75 public sealed class MultiObjectiveRealVectorProgrammableProblem : MultiObjectiveProgrammableProblem<RealVectorEncoding, RealVector> { 90 76 91 77 [StorableConstructor] 92 private SingleObjectivePermutationProgrammableProblem(bool deserializing) : base(deserializing) { }93 private SingleObjectivePermutationProgrammableProblem(SingleObjectivePermutationProgrammableProblem original, Cloner cloner) : base(original, cloner) { }94 public SingleObjectivePermutationProgrammableProblem()95 : base(string.Format(ScriptTemplates.Compiled SingleObjectiveProblemDefinition, "HeuristicLab.Encodings.PermutationEncoding", "PermutationEncoding", "Permutation")) { }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")) { } 96 82 97 83 public override IDeepCloneable Clone(Cloner cloner) { 98 return new SingleObjectivePermutationProgrammableProblem(this, cloner);84 return new MultiObjectiveRealVectorProgrammableProblem(this, cloner); 99 85 } 100 86 } 101 87 102 [Item(" Symbolic Expression Tree Programmable Problem (single-objective)", "Represents a symbolic expression tree single-objective problem that can be programmed with a script.")]88 [Item("Permutation Programmable Problem (multi-objective)", "Represents a permutation multi-objective problem that can be programmed with a script.")] 103 89 [Creatable(CreatableAttribute.Categories.Problems, Priority = 100)] 104 90 [StorableClass] 105 public sealed class SingleObjectiveSymbolicExpressionTreeProgrammableProblem : SingleObjectiveProgrammableProblem<SymbolicExpressionTreeEncoding, SymbolicExpressionTree> {91 public sealed class MultiObjectivePermutationProgrammableProblem : MultiObjectiveProgrammableProblem<PermutationEncoding, Permutation> { 106 92 107 93 [StorableConstructor] 108 private SingleObjectiveSymbolicExpressionTreeProgrammableProblem(bool deserializing) : base(deserializing) { }109 private SingleObjectiveSymbolicExpressionTreeProgrammableProblem(SingleObjectiveSymbolicExpressionTreeProgrammableProblem original, Cloner cloner) : base(original, cloner) { }110 public SingleObjectiveSymbolicExpressionTreeProgrammableProblem()111 : base(string.Format(ScriptTemplates.Compiled SingleObjectiveProblemDefinition, "HeuristicLab.Encodings.SymbolicExpressionTreeEncoding", "SymbolicExpressionTreeEncoding", "SymbolicExpressionTree")) { }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")) { } 112 98 113 99 public override IDeepCloneable Clone(Cloner cloner) { 114 return new SingleObjectiveSymbolicExpressionTreeProgrammableProblem(this, cloner);100 return new MultiObjectivePermutationProgrammableProblem(this, cloner); 115 101 } 116 102 } 117 103 118 [Item(" Linear Linkage Programmable Problem (single-objective)", "Represents a linear linkage single-objective problem that can be programmed with a script.")]104 [Item("Symbolic Expression Tree Programmable Problem (multi-objective)", "Represents a symbolic expression tree multi-objective problem that can be programmed with a script.")] 119 105 [Creatable(CreatableAttribute.Categories.Problems, Priority = 100)] 120 106 [StorableClass] 121 public sealed class SingleObjectiveLinearLinkageProgrammableProblem : SingleObjectiveProgrammableProblem<LinearLinkageEncoding, LinearLinkage> {107 public sealed class MultiObjectiveSymbolicExpressionTreeProgrammableProblem : MultiObjectiveProgrammableProblem<SymbolicExpressionTreeEncoding, SymbolicExpressionTree> { 122 108 123 109 [StorableConstructor] 124 private SingleObjectiveLinearLinkageProgrammableProblem(bool deserializing) : base(deserializing) { }125 private SingleObjectiveLinearLinkageProgrammableProblem(SingleObjectiveLinearLinkageProgrammableProblem original, Cloner cloner) : base(original, cloner) { }126 public SingleObjectiveLinearLinkageProgrammableProblem()127 : base(string.Format(ScriptTemplates.Compiled SingleObjectiveProblemDefinition, "HeuristicLab.Encodings.LinearLinkageEncoding", "LinearLinkageEncoding", "LinearLinkage")) { }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")) { } 128 114 129 115 public override IDeepCloneable Clone(Cloner cloner) { 130 return new SingleObjectiveLinearLinkageProgrammableProblem(this, 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); 131 133 } 132 134 }*/ -
branches/ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/SingleObjectiveProblemDefinitionScript.cs
r13345 r13350 29 29 [Item("Single-objective Problem Definition Script", "Script that defines the parameter vector and evaluates the solution for a programmable problem.")] 30 30 [StorableClass] 31 public class SingleObjectiveProblemDefinitionScript<TEncoding, TSolution> : ProblemDefinitionScript<TEncoding, TSolution>, ISingleObjectiveProblemDefinition<TEncoding, TSolution>, IStorableContent31 public sealed class SingleObjectiveProblemDefinitionScript<TEncoding, TSolution> : ProblemDefinitionScript<TEncoding, TSolution>, ISingleObjectiveProblemDefinition<TEncoding, TSolution>, IStorableContent 32 32 where TEncoding : class, IEncoding<TSolution> 33 33 where TSolution : class, ISolution { 34 34 public string Filename { get; set; } 35 35 36 pr otectednew ISingleObjectiveProblemDefinition<TEncoding, TSolution> CompiledProblemDefinition {36 private new ISingleObjectiveProblemDefinition<TEncoding, TSolution> CompiledProblemDefinition { 37 37 get { return (ISingleObjectiveProblemDefinition<TEncoding, TSolution>)base.CompiledProblemDefinition; } 38 38 } 39 39 40 40 [StorableConstructor] 41 pr otectedSingleObjectiveProblemDefinitionScript(bool deserializing) : base(deserializing) { }42 pr otectedSingleObjectiveProblemDefinitionScript(SingleObjectiveProblemDefinitionScript<TEncoding, TSolution> original, Cloner cloner) : base(original, cloner) { }41 private SingleObjectiveProblemDefinitionScript(bool deserializing) : base(deserializing) { } 42 private SingleObjectiveProblemDefinitionScript(SingleObjectiveProblemDefinitionScript<TEncoding, TSolution> original, Cloner cloner) : base(original, cloner) { } 43 43 public SingleObjectiveProblemDefinitionScript(string codeTemplate) : base(codeTemplate) { } 44 44 public SingleObjectiveProblemDefinitionScript() { } -
branches/ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/SingleObjectiveProgrammableProblem.cs
r13348 r13350 30 30 using HeuristicLab.Parameters; 31 31 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 32 using HeuristicLab.Scripting; 32 33 33 34 namespace HeuristicLab.Problems.Programmable { … … 49 50 } 50 51 52 53 Script IProgrammableProblem.ProblemScript { 54 get { return ProblemScript; } 55 } 51 56 public SingleObjectiveProblemDefinitionScript<TEncoding, TSolution> ProblemScript { 52 57 get { return SingleObjectiveProblemScriptParameter.Value; } … … 67 72 public SingleObjectiveProgrammableProblem() 68 73 : base() { 69 Parameters.Add(new FixedValueParameter<SingleObjectiveProblemDefinitionScript<TEncoding, TSolution>>("ProblemScript", "Defines the problem.", new SingleObjectiveProblemDefinitionScript<TEncoding, TSolution>() { Name = Name, Encoding = Encoding })); 74 Parameters.Add(new FixedValueParameter<SingleObjectiveProblemDefinitionScript<TEncoding, TSolution>>("ProblemScript", "Defines the problem.", 75 new SingleObjectiveProblemDefinitionScript<TEncoding, TSolution>() { Name = Name, Encoding = Encoding })); 70 76 Operators.Add(new BestScopeSolutionAnalyzer()); 71 77 RegisterEvents(); … … 104 110 return ProblemDefinition.GetNeighbors(individual, random); 105 111 } 106 107 #region IProgrammableProblem Members108 Scripting.Script IProgrammableProblem.ProblemScript {109 get { return ProblemScript; }110 }111 #endregion112 112 } 113 113 } -
branches/ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/SingleObjectiveProgrammableProblems.cs
r13348 r13350 51 51 } 52 52 } 53 //TODO 53 54 /* 54 55 [Item("Integer Vector Programmable Problem (single-objective)", "Represents an integer vector single-objective problem that can be programmed with a script.")]
Note: See TracChangeset
for help on using the changeset viewer.