Changeset 17545 for branches/2521_ProblemRefactoring/HeuristicLab.Encodings.BinaryVectorEncoding/3.3
- Timestamp:
- 05/19/20 09:59:57 (4 years ago)
- Location:
- branches/2521_ProblemRefactoring/HeuristicLab.Encodings.BinaryVectorEncoding/3.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2521_ProblemRefactoring/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/BinaryVectorEncoding.cs
r17544 r17545 67 67 public BinaryVectorEncoding(string name, int length) 68 68 : base(name) { 69 Parameters.Add(LengthParameter = new ValueParameter<IntValue>(Name + ".Length", new IntValue(length , @readonly: true)) { ReadOnly = true });69 Parameters.Add(LengthParameter = new ValueParameter<IntValue>(Name + ".Length", new IntValue(length)) { ReadOnly = true }); 70 70 71 71 SolutionCreator = new RandomBinaryVectorCreator(); -
branches/2521_ProblemRefactoring/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/BinaryVectorMultiObjectiveProblem.cs
r17544 r17545 20 20 #endregion 21 21 22 using System;23 22 using System.Linq; 24 23 using HEAL.Attic; … … 36 35 public IResultDefinition<ParetoFrontScatterPlot<BinaryVector>> BestResult { get { return BestResultParameter; } } 37 36 [Storable] protected ReferenceParameter<IntValue> DimensionRefParameter { get; private set; } 38 public IValueParameter<IntValue> DimensionParameter => DimensionRefParameter;39 37 40 38 public int Dimension { 41 get { return DimensionRefParameter.Value.Value; }42 set { DimensionRefParameter.Value.Value= value; }39 get { return Encoding.Length; } 40 set { Encoding.Length = value; } 43 41 } 44 42 … … 92 90 93 91 private void RegisterEventHandlers() { 94 DimensionRefParameter.Value.ValueChanged += DimensionParameter_Value_ValueChanged; 95 } 96 97 private void DimensionParameter_Value_ValueChanged(object sender, EventArgs e) { 98 DimensionOnChanged(); 92 Encoding.PropertyChanged += (sender, args) => { 93 if (args.PropertyName == nameof(Encoding.Length)) 94 DimensionOnChanged(); 95 }; 99 96 } 100 97
Note: See TracChangeset
for help on using the changeset viewer.