Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/24/16 12:30:32 (8 years ago)
Author:
bwerth
Message:

#1087 minor bugfixes, added Parameters to Analyzers, convenience Tooltips for ScatterPlot

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Analyzers/CrowdingAnalyzer.cs

    r13672 r13725  
    2020#endregion
    2121using HeuristicLab.Common;
     22using HeuristicLab.Core;
    2223using HeuristicLab.Data;
    2324using HeuristicLab.Optimization;
     25using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2426
    2527namespace HeuristicLab.Problems.MultiObjectiveTestFunctions {
    26   class CrowdingAnalyzer : MOTFAnalyzer {
    27 
    28     protected CrowdingAnalyzer(CrowdingAnalyzer original, Cloner cloner) : base(original, cloner) {
     28  [StorableClass]
     29  [Item("CrowdingAnalyzer", "The mean crowding distance for each point of the Front (see Multi-Objective Performance Metrics - Shodhganga for more information)")]
     30  public class CrowdingAnalyzer : MOTFAnalyzer {
     31    [StorableHook(HookType.AfterDeserialization)]
     32    private void AfterDeserialization() {
     33    }
     34    [StorableConstructor]
     35    protected CrowdingAnalyzer(bool deserializing) : base(deserializing) { }
     36    public CrowdingAnalyzer(CrowdingAnalyzer original, Cloner cloner) : base(original, cloner) {
    2937    }
    3038    public override IDeepCloneable Clone(Cloner cloner) {
    3139      return new CrowdingAnalyzer(this, cloner);
    3240    }
     41
     42
     43
    3344    public CrowdingAnalyzer() { }
    3445
    35     protected override void Analyze(Individual[] individuals, double[][] qualities, ResultCollection results) {
     46    public override void Analyze(Individual[] individuals, double[][] qualities, ResultCollection results) {
    3647      int objectives = qualities[0].Length;
    3748      if (!results.ContainsKey("Crowding")) results.Add(new Result("Crowding", typeof(DoubleValue)));
    38       results["Crowding"].Value = new DoubleValue(Crowding.Calculate(qualities, TestFunction.Bounds(objectives)));
     49      results["Crowding"].Value = new DoubleValue(Crowding.Calculate(qualities, TestFunctionParameter.ActualValue.Bounds(objectives)));
    3950    }
    4051  }
Note: See TracChangeset for help on using the changeset viewer.