- Timestamp:
- 07/23/20 16:21:55 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2521_ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Problem.cs
r17614 r17695 37 37 where TEvaluator : class, IEvaluator { 38 38 39 [Storable] protected ConstrainedValueParameter<ISolutionCreator> SolutionCreatorParameter { get; private set; }40 41 39 //TODO remove parameter for encoding? 42 40 protected IValueParameter<TEncoding> EncodingParameter { … … 50 48 if (value == null) throw new ArgumentNullException("Encoding must not be null."); 51 49 EncodingParameter.Value = value; 52 }53 }54 55 ISolutionCreator IHeuristicOptimizationProblem.SolutionCreator { get => SolutionCreatorParameter.Value; }56 IParameter IHeuristicOptimizationProblem.SolutionCreatorParameter { get => SolutionCreatorParameter; }57 58 event EventHandler IHeuristicOptimizationProblem.SolutionCreatorChanged {59 add {60 SolutionCreatorParameter.ValueChanged += value;61 }62 remove {63 SolutionCreatorParameter.ValueChanged -= value;64 50 } 65 51 } … … 103 89 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.", encoding) { Hidden = true }); 104 90 Parameters.Add(new ValueParameter<TEvaluator>("Evaluator", "The operator used to evaluate a solution.") { Hidden = true }); 105 Parameters.Add(SolutionCreatorParameter = new ConstrainedValueParameter<ISolutionCreator>("SolutionCreator", "The operator used to create a solution.")); 106 91 107 92 oldEncoding = Encoding; 108 93 Parameterize(); … … 114 99 : base(original, cloner) { 115 100 oldEncoding = cloner.Clone(original.oldEncoding); 116 SolutionCreatorParameter = cloner.Clone(original.SolutionCreatorParameter);117 101 RegisterEvents(); 118 102 } … … 123 107 private void AfterDeserialization() { 124 108 oldEncoding = Encoding; 125 // TODO: remove below126 if (SolutionCreatorParameter == null) Parameters.Add(SolutionCreatorParameter = new ConstrainedValueParameter<ISolutionCreator>("SolutionCreator", "The operator used to create a solution."));127 128 109 RegisterEvents(); 129 110 } … … 160 141 Encoding.ConfigureOperators(Operators); 161 142 162 SolutionCreatorParameter.Repopulate(GetOperators());163 143 //var multiEncoding = Encoding as MultiEncoding; 164 144 //if (multiEncoding != null) multiEncoding.EncodingsChanged += MultiEncodingOnEncodingsChanged;
Note: See TracChangeset
for help on using the changeset viewer.