Changeset 16948 for branches/2521_ProblemRefactoring/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/BinaryVectorMultiObjectiveProblem.cs
- Timestamp:
- 05/13/19 15:21:54 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2521_ProblemRefactoring/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/BinaryVectorMultiObjectiveProblem.cs
r16876 r16948 28 28 using HeuristicLab.Common; 29 29 using HeuristicLab.Core; 30 using HeuristicLab.Data;31 30 using HeuristicLab.Optimization; 32 using HeuristicLab.Parameters;33 31 34 32 namespace HeuristicLab.Encodings.BinaryVectorEncoding { … … 38 36 get { return Encoding.Length; } 39 37 set { Encoding.Length = value; } 40 }41 42 private IFixedValueParameter<IntValue> LengthParameter {43 get { return (IFixedValueParameter<IntValue>)Parameters["Length"]; }44 38 } 45 39 … … 56 50 } 57 51 58 protected BinaryVectorMultiObjectiveProblem() : base(new BinaryVectorEncoding()) { 59 var lengthParameter = new FixedValueParameter<IntValue>("Length", "The length of the BinaryVector.", new IntValue(10)); 60 Parameters.Add(lengthParameter); 61 Encoding.LengthParameter = lengthParameter; 52 protected BinaryVectorMultiObjectiveProblem() : this(new BinaryVectorEncoding() { Length = 10 }) { } 53 protected BinaryVectorMultiObjectiveProblem(BinaryVectorEncoding encoding) : base(encoding) { 54 EncodingParameter.ReadOnly = true; 62 55 63 56 Operators.Add(new HammingSimilarityCalculator()); … … 75 68 protected override void OnEncodingChanged() { 76 69 base.OnEncodingChanged(); 77 Encoding.LengthParameter = LengthParameter;78 70 Parameterize(); 79 71 } … … 87 79 88 80 private void RegisterEventHandlers() { 89 LengthParameter.Value.ValueChanged += LengthParameter_ValueChanged;81 Encoding.LengthParameter.Value.ValueChanged += LengthParameter_ValueChanged; 90 82 } 91 83
Note: See TracChangeset
for help on using the changeset viewer.