From 2629e21d155f0be8b2a4b786973263525ecf22e7 Mon Sep 17 00:00:00 2001 From: jhumeau Date: Thu, 12 Feb 2009 12:35:25 +0000 Subject: [PATCH] include added git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1427 331e1502-861f-0410-8da2-ba01fb791d7f --- .../metric/moeoHyperVolumeDifferenceMetric.h | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/trunk/paradiseo-moeo/src/metric/moeoHyperVolumeDifferenceMetric.h b/trunk/paradiseo-moeo/src/metric/moeoHyperVolumeDifferenceMetric.h index 8ca9fce1a..5d1754235 100644 --- a/trunk/paradiseo-moeo/src/metric/moeoHyperVolumeDifferenceMetric.h +++ b/trunk/paradiseo-moeo/src/metric/moeoHyperVolumeDifferenceMetric.h @@ -40,6 +40,7 @@ #define MOEOHYPERVOLUMEDIFFERENCEMETRIC_H_ #include +#include /** * The contribution metric evaluates the proportion of non-dominated solutions given by a Pareto set relatively to another Pareto set @@ -49,7 +50,7 @@ template < class ObjectiveVector > class moeoHyperVolumeDifferenceMetric : public moeoVectorVsVectorBinaryMetric < ObjectiveVector, double > { public: - + /** * Constructor with a coefficient (rho) * @param _normalize allow to normalize data (default true) @@ -63,7 +64,7 @@ class moeoHyperVolumeDifferenceMetric : public moeoVectorVsVectorBinaryMetric < bounds[i] = eoRealInterval(0,1); } } - + /** * Constructor with a reference point * @param _normalize allow to normalize data (default true) @@ -76,17 +77,17 @@ class moeoHyperVolumeDifferenceMetric : public moeoVectorVsVectorBinaryMetric < { bounds[i] = eoRealInterval(0,1); } - } - + } + /** * calculates and returns the HyperVolume value of a pareto front - * @param _set the vector contains all objective Vector of pareto front + * @param _set the vector contains all objective Vector of pareto front */ double operator()(const std::vector < ObjectiveVector > & _set1, const std::vector < ObjectiveVector > & _set2) { double hypervolume_set1; double hypervolume_set2; - + if(rho >= 1.0){ //determine bounds setup(_set1, _set2); @@ -105,7 +106,7 @@ class moeoHyperVolumeDifferenceMetric : public moeoVectorVsVectorBinaryMetric < ref_point[i]= bounds[i].maximum() * (1-rho); } } - //if no normalization, reinit bounds to O..1 for + //if no normalization, reinit bounds to O..1 for if(!normalize) for (unsigned int i=0; i unaryMetric(ref_point, bounds); hypervolume_set1 = unaryMetric(_set1); hypervolume_set2 = unaryMetric(_set2); - + return hypervolume_set1 - hypervolume_set2; } - + /** * getter on bounds * @return bounds @@ -128,7 +129,7 @@ class moeoHyperVolumeDifferenceMetric : public moeoVectorVsVectorBinaryMetric < std::vector < eoRealInterval > getBounds(){ return bounds; } - + /** * method caclulate bounds for the normalization * @param _set the vector of objective vectors @@ -160,12 +161,12 @@ class moeoHyperVolumeDifferenceMetric : public moeoVectorVsVectorBinaryMetric < /*boolean indicates if data must be normalized or not*/ bool normalize; - + double rho; - + /*vectors contains bounds for normalization*/ std::vector < eoRealInterval > bounds; - + ObjectiveVector ref_point; };