Changeset 17544 for branches/2521_ProblemRefactoring/HeuristicLab.Problems.Binary/3.3/OneMaxProblem.cs
- Timestamp:
- 05/18/20 18:55:08 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2521_ProblemRefactoring/HeuristicLab.Problems.Binary/3.3/OneMaxProblem.cs
r17382 r17544 20 20 #endregion 21 21 22 using System;23 22 using System.Linq; 24 23 using System.Threading; … … 26 25 using HeuristicLab.Common; 27 26 using HeuristicLab.Core; 27 using HeuristicLab.Data; 28 28 using HeuristicLab.Encodings.BinaryVectorEncoding; 29 29 using HeuristicLab.Optimization; … … 37 37 public OneMaxProblem() : base() { 38 38 Maximization = true; 39 Encoding.Length = 10; 40 BestKnownQuality = Encoding.Length; 41 } 42 43 [StorableConstructor] 44 protected OneMaxProblem(StorableConstructorFlag _) : base(_) { } 45 46 protected OneMaxProblem(OneMaxProblem original, Cloner cloner) : base(original, cloner) { } 47 public override IDeepCloneable Clone(Cloner cloner) { 48 return new OneMaxProblem(this, cloner); 39 DimensionRefParameter.ForceValue(new IntValue(10, @readonly: false)); 40 BestKnownQuality = Dimension; 49 41 } 50 42 … … 54 46 } 55 47 56 protected override void LengthParameter_ValueChanged(object sender, EventArgs e) { 57 base.LengthParameter_ValueChanged(sender, e); 58 BestKnownQuality = Length; 48 [StorableConstructor] 49 protected OneMaxProblem(StorableConstructorFlag _) : base(_) { } 50 protected OneMaxProblem(OneMaxProblem original, Cloner cloner) : base(original, cloner) { } 51 public override IDeepCloneable Clone(Cloner cloner) { 52 return new OneMaxProblem(this, cloner); 53 } 54 55 protected override void DimensionOnChanged() { 56 base.DimensionOnChanged(); 57 BestKnownQuality = Dimension; 59 58 } 60 59 }
Note: See TracChangeset
for help on using the changeset viewer.