- Timestamp:
- 04/20/20 17:31:31 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2521_ProblemRefactoring/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/BinaryVectorProblem.cs
r17229 r17517 33 33 [StorableType("2F6FEB34-BD19-47AF-9484-7F48565C0C43")] 34 34 public abstract class BinaryVectorProblem : SingleObjectiveProblem<BinaryVectorEncoding, BinaryVector> { 35 [Storable] public IResultParameter<BinaryVector> BestSolutionParameter { get; private set; } 36 35 37 public int Length { 36 38 get { return Encoding.Length; } … … 47 49 protected BinaryVectorProblem(BinaryVectorProblem original, Cloner cloner) 48 50 : base(original, cloner) { 51 BestSolutionParameter = cloner.Clone(original.BestSolutionParameter); 49 52 RegisterEventHandlers(); 50 53 } … … 53 56 protected BinaryVectorProblem(BinaryVectorEncoding encoding) : base(encoding) { 54 57 EncodingParameter.ReadOnly = true; 58 BestSolutionParameter = new ResultParameter<BinaryVector>("Best Solution", "The best solution."); 59 Parameters.Add(BestSolutionParameter); 55 60 56 61 Operators.Add(new HammingSimilarityCalculator()); … … 65 70 base.Analyze(vectors, qualities, results, random); 66 71 var best = GetBestSolution(vectors, qualities); 67 68 results.AddOrUpdateResult("Best Solution", (IItem)best.Item1.Clone()); 72 BestSolutionParameter.ActualValue = (BinaryVector)best.Item1.Clone(); 69 73 } 70 74
Note: See TracChangeset
for help on using the changeset viewer.