Beispiel #1
0
        private static double IGD(List <double[]> solution, List <double[]> trueFront)
        {
            double sum = 0.0;

            foreach (double[] v in trueFront)
            {
                int    pos  = -1;
                double dist = Double.MaxValue;
                for (int i = 0; i < solution.Count; i++)
                {
                    double d = QulityIndicatorToolFunction.GetDist(v, solution[i]);
                    if (d < dist)
                    {
                        dist = d;
                        pos  = i;
                    }
                }
                sum += dist;
            }
            return(sum / trueFront.Count);
        }
Beispiel #2
0
        private static double HV(List <double[]> solution, double[] refPoint, double[] miniPoint)
        {
            int numberOfObjectives = refPoint.Length;

            /**
             * Stores the maximum values of true pareto front.
             */
            double[] maximumValues = refPoint;

            /**
             * Stores the minimum values of the true pareto front.
             */
            double[] minimumValues = miniPoint;

            /**
             * Stores the normalized front.
             */
            List <double[]> normalizedFront;

            /**
             * Stores the inverted front. Needed for minimization problems
             */
            List <double[]> invertedFront;

            // STEP 1. Obtain the maximum and minimum values of the Pareto front
            //maximumValues = QulityIndicatorToolFunction.getMaximumValues(trueFront, numberOfObjectives);
            //minimumValues = QulityIndicatorToolFunction.getMinimumValues(trueFront, numberOfObjectives);

            // STEP 2. Get the normalized front
            normalizedFront = QulityIndicatorToolFunction.GetNormalizedFront(solution,
                                                                             maximumValues,
                                                                             minimumValues);

            // STEP 3. Inverse the pareto front. This is needed because of the original
            //metric by Zitzler is for maximization problems
            invertedFront = QulityIndicatorToolFunction.InvertedFront(normalizedFront);

            // STEP4. The hypervolumen (control is passed to java version of Zitzler code)
            return(QulityIndicatorToolFunction.CalculateHypervolume(invertedFront, invertedFront.Count, numberOfObjectives));
        }