- Timestamp:
- 09/15/20 17:09:10 (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/BinaryVectorMultiObjectiveProblem.cs
r17695 r17747 33 33 [StorableType("b64caac0-a23a-401a-bb7e-ffa3e22b80ea")] 34 34 public abstract class BinaryVectorMultiObjectiveProblem : MultiObjectiveProblem<BinaryVectorEncoding, BinaryVector> { 35 [Storable] protected IResultParameter<ParetoFrontScatterPlot<BinaryVector>> BestResultParameter { get; private set; }36 35 [Storable] protected ReferenceParameter<IntValue> DimensionRefParameter { get; private set; } 36 [Storable] public IResult<ParetoFrontScatterPlot<BinaryVector>> BestParetoFrontResult { get; private set; } 37 37 38 38 public int Dimension { 39 39 get { return DimensionRefParameter.Value.Value; } 40 40 protected set { DimensionRefParameter.Value.Value = value; } 41 } 42 43 protected ParetoFrontScatterPlot<BinaryVector> BestParetoFront { 44 get => BestParetoFrontResult.Value; 45 set => BestParetoFrontResult.Value = value; 41 46 } 42 47 … … 50 55 protected BinaryVectorMultiObjectiveProblem(BinaryVectorMultiObjectiveProblem original, Cloner cloner) 51 56 : base(original, cloner) { 52 BestResultParameter = cloner.Clone(original.BestResultParameter);53 57 DimensionRefParameter = cloner.Clone(original.DimensionRefParameter); 58 BestParetoFrontResult = cloner.Clone(original.BestParetoFrontResult); 59 54 60 RegisterEventHandlers(); 55 61 } … … 59 65 EncodingParameter.ReadOnly = true; 60 66 EvaluatorParameter.ReadOnly = true; 61 Parameters.Add(BestResultParameter = new ResultParameter<ParetoFrontScatterPlot<BinaryVector>>("Best Pareto Front", "The best Pareto front found."));62 67 Parameters.Add(DimensionRefParameter = new ReferenceParameter<IntValue>("Dimension", "The dimension of the binary vector problem.", Encoding.LengthParameter)); 68 Results.Add(BestParetoFrontResult = new Result<ParetoFrontScatterPlot<BinaryVector>>("Best Pareto Front", "The best Pareto front found so far.")); 63 69 64 70 Operators.Add(new HammingSimilarityCalculator()); … … 75 81 var plot = new ParetoFrontScatterPlot<BinaryVector>(fronts, individuals, qualities, Objectives, BestKnownFront); 76 82 77 Best ResultParameter.ActualValue= plot;83 BestParetoFront = plot; 78 84 } 79 85 -
branches/2521_ProblemRefactoring/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/BinaryVectorProblem.cs
r17745 r17747 37 37 [Storable] public IResult<ISingleObjectiveSolutionContext<BinaryVector>> BestSolutionResult { get; private set; } 38 38 39 private ISingleObjectiveSolutionContext<BinaryVector> BestSolution {40 get => BestSolutionResult.Value;41 set => BestSolutionResult.Value = value;42 }43 44 39 public int Dimension { 45 40 get { return DimensionRefParameter.Value.Value; } 46 41 protected set { DimensionRefParameter.Value.Value = value; } 42 } 43 44 protected ISingleObjectiveSolutionContext<BinaryVector> BestSolution { 45 get => BestSolutionResult.Value; 46 set => BestSolutionResult.Value = value; 47 47 } 48 48 … … 66 66 EvaluatorParameter.ReadOnly = true; 67 67 Parameters.Add(DimensionRefParameter = new ReferenceParameter<IntValue>("Dimension", "The dimension of the binary vector problem.", Encoding.LengthParameter)); 68 Results.Add(BestSolutionResult = new Result<ISingleObjectiveSolutionContext<BinaryVector>>("Best Solution" ));68 Results.Add(BestSolutionResult = new Result<ISingleObjectiveSolutionContext<BinaryVector>>("Best Solution", "The best solution found so far.")); 69 69 70 70 Operators.Add(new HammingSimilarityCalculator());
Note: See TracChangeset
for help on using the changeset viewer.