Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Comparators/InvertedGenerationalDistance.cs @ 13620

Last change on this file since 13620 was 13620, checked in by bwerth, 8 years ago

#1087 regorganized testfunctions, added view for qualities

File size: 1.3 KB
RevLine 
[13562]1using System;
[13620]2using System.Collections.Generic;
[13562]3using HeuristicLab.Encodings.RealVectorEncoding;
[13620]4using HeuristicLab.Problems.MultiObjectiveTestFunctions.Comparators;
[13562]5
6namespace HeuristicLab.Problems.MultiObjectiveTestFunctions {
7  /// <summary>
8  /// The inverted generational Distance is defined as the mean of a all d[i]^(1/p),
9  ///  where d[i] is the minimal distance the ith point of the optimal pareto front has to any point in the evaluated front.   
10  /// </summary>
11  public class InvertedGenerationalDistance : IMultiObjectiveDistance {
12    private double p;
13
14    public InvertedGenerationalDistance(double p) {
[13620]15      if (p <= 0) throw new ArgumentOutOfRangeException("weighting factor p has to be greater than 0");
[13562]16      this.p = 1 / p;
17    }
18
19    /// <summary>
20    ///
21    /// </summary>
22    /// <param name="front"></param>
23    /// <param name="optimalFront"></param>
24    /// <param name="p"></param>
25    /// <returns></returns>
[13620]26    public static double GetDistance(IEnumerable<double[]> front, IEnumerable<double[]> optimalFront, double p) {
[13562]27      return new InvertedGenerationalDistance(p).Compare(front, optimalFront);
28    }
29
[13620]30    public double Compare(IEnumerable<double[]> front, IEnumerable<double[]> optimalFront) {
31      return new GenerationalDistance(p).Compare(optimalFront, front);
[13562]32    }
33  }
34}
Note: See TracBrowser for help on using the repository browser.