Rev | Line | |
---|
[13562] | 1 | using System;
|
---|
[13620] | 2 | using System.Collections.Generic;
|
---|
[13562] | 3 | using HeuristicLab.Encodings.RealVectorEncoding;
|
---|
[13620] | 4 | using HeuristicLab.Problems.MultiObjectiveTestFunctions.Comparators;
|
---|
[13562] | 5 |
|
---|
| 6 | namespace 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.