Changeset 13339 for branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Problem.cs
- Timestamp:
- 11/23/15 16:14:57 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Problem.cs
r13336 r13339 30 30 namespace HeuristicLab.Optimization { 31 31 [StorableClass] 32 public abstract class Problem<TSolution, TEvaluator> : HeuristicOptimizationProblem<TEvaluator, ISolutionCreator<TSolution>>, IProblemDefinition, IStorableContent 32 public abstract class Problem<TEncoding, TSolution, TEvaluator> : HeuristicOptimizationProblem<TEvaluator, ISolutionCreator<TSolution>>, IProblemDefinition<TEncoding, TSolution>, IStorableContent 33 where TEncoding : class, IEncoding<TSolution> 33 34 where TSolution : class, ISolution 34 35 where TEvaluator : class, IEvaluator { … … 36 37 public string Filename { get; set; } 37 38 38 protected IValueParameter< IEncoding<TSolution>> EncodingParameter {39 get { return (IValueParameter< IEncoding<TSolution>>)Parameters["Encoding"]; }39 protected IValueParameter<TEncoding> EncodingParameter { 40 get { return (IValueParameter<TEncoding>)Parameters["Encoding"]; } 40 41 } 41 42 42 public IEncoding<TSolution>Encoding {43 public TEncoding Encoding { 43 44 get { return EncodingParameter.Value; } 44 45 protected set { … … 61 62 protected Problem() 62 63 : base() { 63 Parameters.Add(new ValueParameter<IEncoding<TSolution>>("Encoding", "Describes the configuration of the encoding, what the variables are called, what type they are and their bounds if any.")); 64 if (Encoding != null) Parameterize(); 64 Parameters.Add(new ValueParameter<TEncoding>("Encoding", "Describes the configuration of the encoding, what the variables are called, what type they are and their bounds if any.")); 65 if (Encoding != null) { 66 SolutionCreator = Encoding.SolutionCreator; 67 Parameterize(); 68 } 65 69 RegisterEvents(); 66 70 } 67 71 68 protected Problem(Problem<T Solution, TEvaluator> original, Cloner cloner)72 protected Problem(Problem<TEncoding, TSolution, TEvaluator> original, Cloner cloner) 69 73 : base(original, cloner) { 70 74 RegisterEvents();
Note: See TracChangeset
for help on using the changeset viewer.