From c0d4e442a8e4b22022571d66d24ba86da9be1ef4 Mon Sep 17 00:00:00 2001 From: liefooga Date: Tue, 17 Apr 2007 13:46:47 +0000 Subject: [PATCH] update from constant to function git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@250 331e1502-861f-0410-8da2-ba01fb791d7f --- ...eoNormalizedSolutionVsSolutionBinaryMetric.h | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/branches/paradiseo-moeo-1.0/src/metric/moeoNormalizedSolutionVsSolutionBinaryMetric.h b/branches/paradiseo-moeo-1.0/src/metric/moeoNormalizedSolutionVsSolutionBinaryMetric.h index 34ca3fb0f..be9e6659c 100644 --- a/branches/paradiseo-moeo-1.0/src/metric/moeoNormalizedSolutionVsSolutionBinaryMetric.h +++ b/branches/paradiseo-moeo-1.0/src/metric/moeoNormalizedSolutionVsSolutionBinaryMetric.h @@ -27,10 +27,6 @@ class moeoNormalizedSolutionVsSolutionBinaryMetric : public moeoSolutionVsSoluti { public: - /** very small value to avoid the extreme case where the min bound == the max bound */ - const static double tiny = 1e-6; - - /** * Default ctr for any moeoNormalizedSolutionVsSolutionBinaryMetric object */ @@ -50,8 +46,8 @@ public: { if (_min == _max) { - _min -= tiny; - _max += tiny; + _min -= tiny(); + _max += tiny(); } bounds[_obj] = eoRealInterval(_min, _max); } @@ -67,6 +63,15 @@ public: } + /** + * Returns a very small value that can be used to avoid extreme cases (where the min bound == the max bound) + */ + static double tiny() + { + return 1e-6; + } + + protected: /** the bounds for every objective (bounds[i] = bounds for the objective i) */