Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/20/18 14:53:51 (5 years ago)
Author:
bwerth
Message:

#2943 worked on MOBasicProblem and MOAnalyzers

Location:
branches/2943_MOBasicProblem_MOCMAES/HeuristicLab.Analysis
Files:
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/2943_MOBasicProblem_MOCMAES/HeuristicLab.Analysis

  • branches/2943_MOBasicProblem_MOCMAES/HeuristicLab.Analysis/3.3/MultiObjective/CrowdingAnalyzer.cs

    r16303 r16310  
    2020#endregion
    2121
    22 using System.Linq;
    2322using HeuristicLab.Common;
    2423using HeuristicLab.Core;
    2524using HeuristicLab.Data;
    2625using HeuristicLab.Optimization;
    27 using HeuristicLab.Parameters;
    2826using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2927
    30 namespace HeuristicLab.Problems.TestFunctions.MultiObjective {
     28namespace HeuristicLab.Analysis {
    3129  [StorableClass]
    3230  [Item("CrowdingAnalyzer", "The mean crowding distance for each point of the Front (see Multi-Objective Performance Metrics - Shodhganga for more information)")]
    33   public class CrowdingAnalyzer : MOTFAnalyzer {
    34 
    35     public IResultParameter<DoubleValue> CrowdingResultParameter {
    36       get { return (IResultParameter<DoubleValue>)Parameters["Crowding"]; }
    37     }
     31  public class CrowdingAnalyzer : MultiObjectiveSuccessAnalyzer {
     32    public override string ResultName => "Crowding";
    3833
    3934    [StorableConstructor]
     
    4742
    4843    public CrowdingAnalyzer() {
    49       Parameters.Add(new ResultParameter<DoubleValue>("Crowding", "The average corwding distance of all points (excluding infinities)"));
    50       CrowdingResultParameter.DefaultValue = new DoubleValue(double.NaN);
     44      Parameters.Add(new ResultParameter<DoubleValue>("Crowding", "The average corwding distance of all points (excluding infinities)", "Results", new DoubleValue(double.NaN)));
    5145    }
    5246
     
    5448      var qualities = QualitiesParameter.ActualValue;
    5549      var crowdingDistance = CrowdingCalculator.CalculateCrowding(qualities);
    56       CrowdingResultParameter.ActualValue.Value = crowdingDistance;
     50      ResultParameter.ActualValue.Value = crowdingDistance;
    5751      return base.Apply();
    5852    }
Note: See TracChangeset for help on using the changeset viewer.