Free cookie consent management tool by TermsFeed Policy Generator

Changeset 14081


Ignore:
Timestamp:
07/15/16 10:31:06 (8 years ago)
Author:
mkommend
Message:

#1087: Refactored utility class NonDominatedSelect.

Location:
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions
Files:
7 edited

Legend:

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

    r14044 r14081  
    9191
    9292
    93       IEnumerable<double[]> front = NonDominatedSelect.selectNonDominatedVectors(qualities.Select(q => q.ToArray()), testFunction.Maximization(objectives), true);
     93      IEnumerable<double[]> front = NonDominatedSelect.SelectNonDominatedVectors(qualities.Select(q => q.ToArray()), testFunction.Maximization(objectives), true);
    9494
    9595      double hv = front.Any() ? Hypervolume.Calculate(front, testFunction.ReferencePoint(objectives), testFunction.Maximization(objectives)) : 0;
  • branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Analyzers/NormalizedHypervolumeAnalyzer.cs

    r14044 r14081  
    8282      }
    8383
    84       IEnumerable<double[]> front = NonDominatedSelect.selectNonDominatedVectors(qualities.Select(q => q.ToArray()), testFunction.Maximization(objectives), true);
     84      IEnumerable<double[]> front = NonDominatedSelect.SelectNonDominatedVectors(qualities.Select(q => q.ToArray()), testFunction.Maximization(objectives), true);
    8585
    8686      if (!results.ContainsKey(resultsHV)) results.Add(new Result(resultsHV, typeof(DoubleValue)));
  • branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Calculators/HyperVolume.cs

    r14030 r14081  
    5353    ///
    5454    public static double Calculate(IEnumerable<double[]> front, double[] referencePoint, bool[] maximization) {
    55       front = NonDominatedSelect.removeNonReferenceDominatingVectors(front, referencePoint, maximization, false);
     55      front = NonDominatedSelect.GetDominatingVectors(front, referencePoint, maximization, false);
    5656      if (maximization.Length == 2)
    5757        return Calculate2D(front, referencePoint, maximization);
  • branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/NonDominatedSelect.cs

    r14030 r14081  
    2121
    2222using System.Collections.Generic;
    23 using System.Linq;
    2423
    2524namespace HeuristicLab.Problems.MultiObjectiveTestFunctions {
     
    2827    public enum DominationResult { Dominates, IsDominated, IsNonDominated };
    2928
    30     public static IEnumerable<double[]> selectNonDominatedVectors(IEnumerable<double[]> qualities, bool[] maximization, bool dominateOnEqualQualities) {
    31       int populationSize = qualities.Count();
     29    public static IEnumerable<double[]> SelectNonDominatedVectors(IEnumerable<double[]> qualities, bool[] maximization, bool dominateOnEqualQualities) {
    3230
    3331      List<double[]> front = new List<double[]>();
     
    3836          if (res == DominationResult.Dominates) { insert = false; break; }           //Vector domiates Row
    3937          else if (res == DominationResult.IsDominated) {   //Row dominates Vector
    40             front.RemoveRange(i, 1);
     38            front.RemoveAt(i);
    4139          }
    4240        }
     
    4947    }
    5048
    51     public static IEnumerable<double[]> removeNonReferenceDominatingVectors(IEnumerable<double[]> qualities, double[] reference, bool[] maximization, bool dominateOnEqualQualities) {
     49    public static IEnumerable<double[]> GetDominatingVectors(IEnumerable<double[]> qualities, double[] reference, bool[] maximization, bool dominateOnEqualQualities) {
    5250      List<double[]> front = new List<double[]>();
    5351      foreach (double[] vec in qualities) {
  • branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/MultiObjectiveTestfunctionTests/CrowdingTest.cs

    r14030 r14081  
    103103      point3[1] = 2;
    104104      double[][] front = { point, point1, point2, point3 };
    105       double dist = Crowding.Calculate(front, new double[,] { { 0, 2 }, { 0, 1 } }); ;
     105      double dist = Crowding.Calculate(front, new double[,] { { 0, 2 }, { 0, 1 } });
    106106      Assert.AreEqual(4.5, dist);
    107107    }
  • branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/MultiObjectiveTestfunctionTests/FastHyperVolumeTests.cs

    r14030 r14081  
    125125        points.Add(p);
    126126      }
    127       var front = NonDominatedSelect.selectNonDominatedVectors(points, maximization, true);
     127      var front = NonDominatedSelect.SelectNonDominatedVectors(points, maximization, true);
    128128
    129129      double dim3hv = Hypervolume.Calculate(front, referencePoint, new bool[3]);
  • branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/MultiObjectiveTestfunctionTests/HyperVolumeTests.cs

    r13988 r14081  
    179179      referencePoint[0] = 0;
    180180      referencePoint[1] = 1;
    181       double nw = Hypervolume.Calculate(NonDominatedSelect.selectNonDominatedVectors(front, maximization, true), referencePoint, maximization);
     181      double nw = Hypervolume.Calculate(NonDominatedSelect.SelectNonDominatedVectors(front, maximization, true), referencePoint, maximization);
    182182      Assert.AreEqual(1, nw);
    183183
     
    193193      referencePoint[0] = 1;
    194194      referencePoint[1] = 0;
    195       double se = Hypervolume.Calculate(NonDominatedSelect.selectNonDominatedVectors(front, maximization, true), referencePoint, maximization);
     195      double se = Hypervolume.Calculate(NonDominatedSelect.SelectNonDominatedVectors(front, maximization, true), referencePoint, maximization);
    196196      Assert.AreEqual(1, se);
    197197
Note: See TracChangeset for help on using the changeset viewer.