Changeset 13364 for branches/ProblemRefactoring
- Timestamp:
- 11/24/15 16:42:09 (9 years ago)
- Location:
- branches/ProblemRefactoring
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ProblemRefactoring/HeuristicLab.Algorithms.ParameterlessPopulationPyramid/3.3/ParameterlessPopulationPyramid.cs
r13361 r13364 43 43 public class ParameterlessPopulationPyramid : BasicAlgorithm { 44 44 public override Type ProblemType { 45 get { return typeof(ISingleObjectiveProblem <BinaryVectorEncoding, BinaryVector>); }45 get { return typeof(ISingleObjectiveProblemDefinition<BinaryVectorEncoding, BinaryVector>); } 46 46 } 47 47 public new ISingleObjectiveProblemDefinition<BinaryVectorEncoding, BinaryVector> Problem { -
branches/ProblemRefactoring/HeuristicLab.Encodings.IntegerVectorEncoding/3.3/IntegerVector.cs
r12012 r13364 24 24 using HeuristicLab.Core; 25 25 using HeuristicLab.Data; 26 using HeuristicLab.Optimization; 26 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 28 … … 29 30 [StorableClass] 30 31 [Item("IntegerVector", "Represents a vector of integer values.")] 31 public class IntegerVector : IntArray {32 public class IntegerVector : IntArray, ISolution { 32 33 [StorableConstructor] 33 34 protected IntegerVector(bool deserializing) : base(deserializing) { } -
branches/ProblemRefactoring/HeuristicLab.Encodings.IntegerVectorEncoding/3.3/IntegerVectorEncoding.cs
r12837 r13364 34 34 [Item("IntegerVectorEncoding", "Describes an integer vector encoding.")] 35 35 [StorableClass] 36 public sealed class IntegerVectorEncoding : Encoding<I IntegerVectorCreator> {36 public sealed class IntegerVectorEncoding : Encoding<IntegerVector> { 37 37 #region Encoding Parameters 38 38 [Storable] … … 271 271 #endregion 272 272 } 273 274 public static class IndividualExtensionMethods {275 public static IntegerVector IntegerVector(this Individual individual) {276 var encoding = individual.GetEncoding<IntegerVectorEncoding>();277 return individual.IntegerVector(encoding.Name);278 }279 public static IntegerVector IntegerVector(this Individual individual, string name) {280 return (IntegerVector)individual[name];281 }282 }283 273 } -
branches/ProblemRefactoring/HeuristicLab.Encodings.IntegerVectorEncoding/3.3/Interfaces/IIntegerVectorCreator.cs
r12012 r13364 28 28 /// An interface which represents an operator for creating vectors of int-valued data. 29 29 /// </summary> 30 public interface IIntegerVectorCreator : ISolutionCreator , IBoundedIntegerVectorOperator {30 public interface IIntegerVectorCreator : ISolutionCreator<IntegerVector>, IBoundedIntegerVectorOperator { 31 31 IValueLookupParameter<IntValue> LengthParameter { get; } 32 32 ILookupParameter<IntegerVector> IntegerVectorParameter { get; } -
branches/ProblemRefactoring/HeuristicLab.Problems.Knapsack.Views/3.3/HeuristicLab.Problems.Knapsack.Views-3.3.csproj
r11623 r13364 165 165 <Private>False</Private> 166 166 </ProjectReference> 167 <ProjectReference Include="..\..\HeuristicLab.Optimization\3.3\HeuristicLab.Optimization-3.3.csproj"> 168 <Project>{14ab8d24-25bc-400c-a846-4627aa945192}</Project> 169 <Name>HeuristicLab.Optimization-3.3</Name> 170 <Private>False</Private> 171 </ProjectReference> 167 172 <ProjectReference Include="..\..\HeuristicLab.PluginInfrastructure\3.3\HeuristicLab.PluginInfrastructure-3.3.csproj"> 168 173 <Project>{94186A6A-5176-4402-AE83-886557B53CCA}</Project> -
branches/ProblemRefactoring/HeuristicLab.Problems.Knapsack/3.3/KnapsackProblem.cs
r13173 r13364 38 38 [Creatable(CreatableAttribute.Categories.CombinatorialProblems, Priority = 200)] 39 39 [StorableClass] 40 public sealed class KnapsackProblem : SingleObjectiveHeuristicOptimizationProblem<IKnapsackEvaluator, IBinaryVectorCreator>, IStorableContent { 40 public sealed class KnapsackProblem : SingleObjectiveHeuristicOptimizationProblem<IKnapsackEvaluator, IBinaryVectorCreator>, 41 ISingleObjectiveProblem<BinaryVectorEncoding, BinaryVector>, IStorableContent { 41 42 public string Filename { get; set; } 42 43 -
branches/ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/HeuristicLab.Problems.Programmable-3.3.csproj
r13361 r13364 153 153 <Project>{66d249c3-a01d-42a8-82a2-919bc8ec3d83}</Project> 154 154 <Name>HeuristicLab.Encodings.BinaryVectorEncoding-3.3</Name> 155 <Private>False</Private> 156 </ProjectReference> 157 <ProjectReference Include="..\..\HeuristicLab.Encodings.IntegerVectorEncoding\3.3\HeuristicLab.Encodings.IntegerVectorEncoding-3.3.csproj"> 158 <Project>{ddfb14dd-2a85-493c-a52d-e69729bbaeb0}</Project> 159 <Name>HeuristicLab.Encodings.IntegerVectorEncoding-3.3</Name> 160 <Private>False</Private> 155 161 </ProjectReference> 156 162 <ProjectReference Include="..\..\HeuristicLab.Encodings.RealVectorEncoding\3.3\HeuristicLab.Encodings.RealVectorEncoding-3.3.csproj"> 157 163 <Project>{bb6d334a-4bb6-4674-9883-31a6ebb32cab}</Project> 158 164 <Name>HeuristicLab.Encodings.RealVectorEncoding-3.3</Name> 165 <Private>False</Private> 159 166 </ProjectReference> 160 167 <ProjectReference Include="..\..\HeuristicLab.Operators\3.3\HeuristicLab.Operators-3.3.csproj"> -
branches/ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/ProgrammableProblemInstances.cs
r13361 r13364 25 25 using HeuristicLab.Core; 26 26 using HeuristicLab.Encodings.BinaryVectorEncoding; 27 using HeuristicLab.Encodings.IntegerVectorEncoding; 27 28 using HeuristicLab.Encodings.RealVectorEncoding; 28 29 using HeuristicLab.Optimization; … … 79 80 } 80 81 81 //[Item("Integer Vector Programmable Problem (single-objective)", "Represents an integer vector single-objective problem that can be programmed with a script.")] 82 //[Creatable(CreatableAttribute.Categories.Problems, Priority = 100)] 83 //[StorableClass] 84 //public sealed class SingleObjectiveIntegerVectorProgrammableProblem : SingleObjectiveProgrammableProblem<IntegerVectorEncoding, IntegerVector> { 85 86 // [StorableConstructor] 87 // private SingleObjectiveIntegerVectorProgrammableProblem(bool deserializing) : base(deserializing) { } 88 // private SingleObjectiveIntegerVectorProgrammableProblem(SingleObjectiveIntegerVectorProgrammableProblem original, Cloner cloner) : base(original, cloner) { } 89 // public SingleObjectiveIntegerVectorProgrammableProblem() 90 // : base(string.Format(ScriptTemplates.CompiledSingleObjectiveProblemDefinition, "HeuristicLab.Encodings.IntegerVectorEncoding", "IntegerVectorEncoding", "IntegerVector")) { } 91 92 // public override IDeepCloneable Clone(Cloner cloner) { 93 // return new SingleObjectiveIntegerVectorProgrammableProblem(this, cloner); 94 // } 95 //} 82 [Item("Integer Vector Programmable Problem (single-objective)", "Represents an integer vector single-objective problem that can be programmed with a script.")] 83 [Creatable(CreatableAttribute.Categories.Problems, Priority = 100)] 84 [StorableClass] 85 public sealed class SingleObjectiveIntegerVectorProgrammableProblem : SingleObjectiveProgrammableProblem<IntegerVectorEncoding, IntegerVector> { 86 87 [StorableConstructor] 88 private SingleObjectiveIntegerVectorProgrammableProblem(bool deserializing) : base(deserializing) { } 89 private SingleObjectiveIntegerVectorProgrammableProblem(SingleObjectiveIntegerVectorProgrammableProblem original, Cloner cloner) : base(original, cloner) { } 90 91 public SingleObjectiveIntegerVectorProgrammableProblem() 92 : base() { 93 var codeTemplate = ScriptTemplates.CompiledSingleObjectiveProblemDefinition_Template; 94 codeTemplate = codeTemplate.Replace(ENCODING_NAMESPACE, "HeuristicLab.Encodings.IntegerVectorEncoding"); 95 codeTemplate = codeTemplate.Replace(ENCODING_CLASS, "IntegerVectorEncoding"); 96 codeTemplate = codeTemplate.Replace(SOLUTION_CLASS, "IntegerVector"); 97 ProblemScript.Code = codeTemplate; 98 } 99 100 public override IDeepCloneable Clone(Cloner cloner) { 101 return new SingleObjectiveIntegerVectorProgrammableProblem(this, cloner); 102 } 103 } 96 104 97 105 [Item("Real Vector Programmable Problem (single-objective)", "Represents a real vector single-objective problem that can be programmed with a script.")] … … 216 224 } 217 225 218 //[Item("Integer Vector Programmable Problem (multi-objective)", "Represents an integer vector multi-objective problem that can be programmed with a script.")] 219 //[Creatable(CreatableAttribute.Categories.Problems, Priority = 100)] 220 //[StorableClass] 221 //public sealed class MultiObjectiveIntegerVectorProgrammableProblem : MultiObjectiveProgrammableProblem<IntegerVectorEncoding, IntegerVector> { 222 223 // [StorableConstructor] 224 // private MultiObjectiveIntegerVectorProgrammableProblem(bool deserializing) : base(deserializing) { } 225 // private MultiObjectiveIntegerVectorProgrammableProblem(MultiObjectiveIntegerVectorProgrammableProblem original, Cloner cloner) : base(original, cloner) { } 226 // public MultiObjectiveIntegerVectorProgrammableProblem() 227 // : base(string.Format(ScriptTemplates.CompiledMultiObjectiveProblemDefinition, "HeuristicLab.Encodings.IntegerVectorEncoding", "IntegerVectorEncoding", "IntegerVector")) { } 228 229 // public override IDeepCloneable Clone(Cloner cloner) { 230 // return new MultiObjectiveIntegerVectorProgrammableProblem(this, cloner); 231 // } 232 //} 226 [Item("Integer Vector Programmable Problem (multi-objective)", "Represents an integer vector multi-objective problem that can be programmed with a script.")] 227 [Creatable(CreatableAttribute.Categories.Problems, Priority = 100)] 228 [StorableClass] 229 public sealed class MultiObjectiveIntegerVectorProgrammableProblem : MultiObjectiveProgrammableProblem<IntegerVectorEncoding, IntegerVector> { 230 231 [StorableConstructor] 232 private MultiObjectiveIntegerVectorProgrammableProblem(bool deserializing) : base(deserializing) { } 233 private MultiObjectiveIntegerVectorProgrammableProblem(MultiObjectiveIntegerVectorProgrammableProblem original, Cloner cloner) : base(original, cloner) { } 234 235 public MultiObjectiveIntegerVectorProgrammableProblem() 236 : base() { 237 var codeTemplate = ScriptTemplates.CompiledSingleObjectiveProblemDefinition_Template; 238 codeTemplate = codeTemplate.Replace(ENCODING_NAMESPACE, "HeuristicLab.Encodings.IntegerVectorEncoding"); 239 codeTemplate = codeTemplate.Replace(ENCODING_CLASS, "IntegerVectorEncoding"); 240 codeTemplate = codeTemplate.Replace(SOLUTION_CLASS, "IntegerVector"); 241 ProblemScript.Code = codeTemplate; 242 } 243 244 public override IDeepCloneable Clone(Cloner cloner) { 245 return new MultiObjectiveIntegerVectorProgrammableProblem(this, cloner); 246 } 247 } 233 248 234 249 [Item("Real Vector Programmable Problem (multi-objective)", "Represents a real vector multi-objective problem that can be programmed with a script.")]
Note: See TracChangeset
for help on using the changeset viewer.