diff --git a/branches/paradiseo-moeo-1.0/src/metric/moeoAdditiveEpsilonBinaryMetric.h b/branches/paradiseo-moeo-1.0/src/metric/moeoAdditiveEpsilonBinaryMetric.h new file mode 100644 index 000000000..95304becb --- /dev/null +++ b/branches/paradiseo-moeo-1.0/src/metric/moeoAdditiveEpsilonBinaryMetric.h @@ -0,0 +1,84 @@ +// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*- + +//----------------------------------------------------------------------------- +// moeoAdditiveEpsilonBinaryMetric.h +// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007 +/* + This library... + + Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr + */ +//----------------------------------------------------------------------------- + +#ifndef MOEOADDITIVEEPSILONBINARYMETRIC_H_ +#define MOEOADDITIVEEPSILONBINARYMETRIC_H_ + +#include + +/** + * Additive epsilon binary metric allowing to compare two objective vectors as proposed in + * Zitzler E., Thiele L., Laumanns M., Fonseca C. M., Grunert da Fonseca V.: + * Performance Assessment of Multiobjective Optimizers: An Analysis and Review. IEEE Transactions on Evolutionary Computation 7(2), pp.117–132 (2003). + */ +template < class ObjectiveVector > +class moeoAdditiveEpsilonBinaryMetric : public moeoNormalizedSolutionVsSolutionBinaryMetric < ObjectiveVector, double > +{ +public: + + /** + * Returns the minimal distance by which the objective vector _o1 must be translated in all objectives + * so that it weakly dominates the objective vector _o2 + * @warning don't forget to set the bounds for every objective before the call of this function + * @param _o1 the first objective vector + * @param _o2 the second objective vector + */ + double operator()(const ObjectiveVector & _o1, const ObjectiveVector & _o2) + { + // computation of the epsilon value for the first objective + double result = epsilon(_o1, _o2, 0); + // computation of the epsilon value for the other objectives + double tmp; + for (unsigned int i=1; i :: bounds; + + + /** + * Returns the epsilon value by which the objective vector _o1 must be translated in the objective _obj + * so that it dominates the objective vector _o2 + * @param _o1 the first objective vector + * @param _o2 the second objective vector + * @param _obj the index of the objective + */ + double epsilon(const ObjectiveVector & _o1, const ObjectiveVector & _o2, const unsigned int _obj) + { + double result; + // if the objective _obj have to be minimized + if (ObjectiveVector::Traits::minimizing(_obj)) + { + // _o1[_obj] - _o2[_obj] + result = ( (_o1[_obj] - bounds[_obj].minimum()) / bounds[_obj].range() ) - ( (_o2[_obj] - bounds[_obj].minimum()) / bounds[_obj].range() ); + } + // if the objective _obj have to be maximized + else + { + // _o2[_obj] - _o1[_obj] + result = ( (_o2[_obj] - bounds[_obj].minimum()) / bounds[_obj].range() ) - ( (_o1[_obj] - bounds[_obj].minimum()) / bounds[_obj].range() ); + } + return result; + } + +}; + +#endif /*MOEOADDITIVEEPSILONBINARYMETRIC_H_*/ diff --git a/branches/paradiseo-moeo-1.0/src/metric/moeoBinaryMetricSavingUpdater.h b/branches/paradiseo-moeo-1.0/src/metric/moeoBinaryMetricSavingUpdater.h deleted file mode 100644 index b2fb8aa3a..000000000 --- a/branches/paradiseo-moeo-1.0/src/metric/moeoBinaryMetricSavingUpdater.h +++ /dev/null @@ -1,88 +0,0 @@ -// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*- - -//----------------------------------------------------------------------------- -// moeoBinaryMetricSavingUpdater.h -// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007 -/* - This library... - - Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr - */ -//----------------------------------------------------------------------------- - -#ifndef MOEOBINARYMETRICSAVINGUPDATER_H_ -#define MOEOBINARYMETRICSAVINGUPDATER_H_ - -#include -#include -#include -#include -#include - -/** - * This class allows to save the progression of a binary metric comparing the objective vectors of the current population (or archive) - * with the objective vectors of the population (or archive) of the generation (n-1) into a file - */ -template < class MOEOT > -class moeoBinaryMetricSavingUpdater : public eoUpdater -{ -public: - - /** - * The objective vector type of a solution - */ - typedef typename MOEOT::ObjectiveVector ObjectiveVector; - - /** - * Ctor - * @param _metric the binary metric comparing two Pareto sets - * @param _pop the main population - * @param _filename the target filename - */ - moeoBinaryMetricSavingUpdater (moeoVectorVsVectorBinaryMetric < ObjectiveVector, double > & _metric, const eoPop < MOEOT > & _pop, std::string _filename) : - metric(_metric), pop(_pop), filename(_filename), counter(1) - {} - - /** - * Saves the metric's value for the current generation - */ - void operator()() { - if (pop.size()) { - if (firstGen) { - firstGen = false; - } - else { - // creation of the two Pareto sets - std::vector < ObjectiveVector > from; - std::vector < ObjectiveVector > to; - for (unsigned i=0; i & metric; - /** main population */ - const eoPop < MOEOT > & pop; - /** (n-1) population */ - eoPop< MOEOT > oldPop; - /** target filename */ - std::string filename; - /** is it the first generation ? */ - bool firstGen; - /** counter */ - unsigned counter; - -}; - -#endif /*MOEOBINARYMETRICSAVINGUPDATER_H_*/ diff --git a/branches/paradiseo-moeo-1.0/src/metric/moeoContributionMetric.h b/branches/paradiseo-moeo-1.0/src/metric/moeoContributionMetric.h index 7e495ed4f..28736427c 100644 --- a/branches/paradiseo-moeo-1.0/src/metric/moeoContributionMetric.h +++ b/branches/paradiseo-moeo-1.0/src/metric/moeoContributionMetric.h @@ -13,7 +13,7 @@ #ifndef MOEOCONTRIBUTIONMETRIC_H_ #define MOEOCONTRIBUTIONMETRIC_H_ -#include +#include #include /** @@ -31,11 +31,11 @@ public: * @param _set2 the second Pareto set */ double operator()(const std::vector < ObjectiveVector > & _set1, const std::vector < ObjectiveVector > & _set2) { - unsigned c = card_C(_set1, _set2); - unsigned w1 = card_W(_set1, _set2); - unsigned n1 = card_N(_set1, _set2); - unsigned w2 = card_W(_set2, _set1); - unsigned n2 = card_N(_set2, _set1); + unsigned int c = card_C(_set1, _set2); + unsigned int w1 = card_W(_set1, _set2); + unsigned int n1 = card_N(_set1, _set2); + unsigned int w2 = card_W(_set2, _set1); + unsigned int n2 = card_N(_set2, _set1); return (double) (c / 2.0 + w1 + n1) / (c + w1 + n1 + w2 + n2); } @@ -51,10 +51,10 @@ private: * @param _set1 the first Pareto set * @param _set2 the second Pareto set */ - unsigned card_C (const std::vector < ObjectiveVector > & _set1, const std::vector < ObjectiveVector > & _set2) { - unsigned c=0; - for (unsigned i=0; i<_set1.size(); i++) - for (unsigned j=0; j<_set2.size(); j++) + unsigned int card_C (const std::vector < ObjectiveVector > & _set1, const std::vector < ObjectiveVector > & _set2) { + unsigned int c=0; + for (unsigned int i=0; i<_set1.size(); i++) + for (unsigned int j=0; j<_set2.size(); j++) if (_set1[i] == _set2[j]) { c++; break; @@ -62,15 +62,16 @@ private: return c; } + /** * Returns the number of solutions in '_set1' dominating at least one solution of '_set2' * @param _set1 the first Pareto set * @param _set2 the second Pareto set */ - unsigned card_W (const std::vector < ObjectiveVector > & _set1, const std::vector < ObjectiveVector > & _set2) { - unsigned w=0; - for (unsigned i=0; i<_set1.size(); i++) - for (unsigned j=0; j<_set2.size(); j++) + unsigned int card_W (const std::vector < ObjectiveVector > & _set1, const std::vector < ObjectiveVector > & _set2) { + unsigned int w=0; + for (unsigned int i=0; i<_set1.size(); i++) + for (unsigned int j=0; j<_set2.size(); j++) if (paretoComparator(_set2[j], _set1[i])) { w++; @@ -79,16 +80,17 @@ private: return w; } + /** * Returns the number of solutions in '_set1' having no relation of dominance with those from '_set2' * @param _set1 the first Pareto set * @param _set2 the second Pareto set */ - unsigned card_N (const std::vector < ObjectiveVector > & _set1, const std::vector < ObjectiveVector > & _set2) { - unsigned n=0; - for (unsigned i=0; i<_set1.size(); i++) { + unsigned int card_N (const std::vector < ObjectiveVector > & _set1, const std::vector < ObjectiveVector > & _set2) { + unsigned int n=0; + for (unsigned int i=0; i<_set1.size(); i++) { bool domin_rel = false; - for (unsigned j=0; j<_set2.size(); j++) + for (unsigned int j=0; j<_set2.size(); j++) if ( (paretoComparator(_set2[j], _set1[i])) || (paretoComparator(_set1[i], _set2[j])) ) { domin_rel = true; diff --git a/branches/paradiseo-moeo-1.0/src/metric/moeoEntropyMetric.h b/branches/paradiseo-moeo-1.0/src/metric/moeoEntropyMetric.h index 6c55a0518..a19e029f8 100644 --- a/branches/paradiseo-moeo-1.0/src/metric/moeoEntropyMetric.h +++ b/branches/paradiseo-moeo-1.0/src/metric/moeoEntropyMetric.h @@ -13,6 +13,8 @@ #ifndef MOEOENTROPYMETRIC_H_ #define MOEOENTROPYMETRIC_H_ +#include +#include #include /** @@ -48,13 +50,13 @@ public: std::vector< ObjectiveVector > union_set1_star; // rotf again ... computeUnion (set1, star, union_set1_star); - unsigned C = union_set1_star.size(); + unsigned int C = union_set1_star.size(); float omega=0; float entropy=0; - for (unsigned i=0 ; i 0) { omega += 1.0 / N_i; entropy += (float) n_i / (N_i * C) * log (((float) n_i / C) / log (2.0)); @@ -81,9 +83,9 @@ private: * @param _f a Pareto set */ void removeDominated(std::vector < ObjectiveVector > & _f) { - for (unsigned i=0 ; i<_f.size(); i++) { + for (unsigned int i=0 ; i<_f.size(); i++) { bool dom = false; - for (unsigned j=0; j<_f.size(); j++) + for (unsigned int j=0; j<_f.size(); j++) if (i != j && paretoComparator(_f[i],_f[j])) { dom = true; @@ -106,9 +108,9 @@ private: vect_min_val.clear(); vect_max_val.clear(); - for (unsigned char i=0 ; imax_val) @@ -125,8 +127,8 @@ private: * @param _f a Pareto set */ void normalize (std::vector< ObjectiveVector > & _f) { - for (unsigned i=0 ; i & _f1, const std::vector< ObjectiveVector > & _f2, std::vector< ObjectiveVector > & _f) { _f = _f1 ; - for (unsigned i=0; i<_f2.size(); i++) { + for (unsigned int i=0; i<_f2.size(); i++) { bool b = false; - for (unsigned j=0; j<_f1.size(); j ++) + for (unsigned int j=0; j<_f1.size(); j ++) if (_f1[j] == _f2[i]) { b = true; break; @@ -155,9 +157,9 @@ private: /** * How many in niche */ - unsigned howManyInNicheOf (const std::vector< ObjectiveVector > & _f, const ObjectiveVector & _s, unsigned _size) { - unsigned n=0; - for (unsigned i=0 ; i<_f.size(); i++) { + unsigned int howManyInNicheOf (const std::vector< ObjectiveVector > & _f, const ObjectiveVector & _s, unsigned int _size) { + unsigned int n=0; + for (unsigned int i=0 ; i<_f.size(); i++) { if (euclidianDistance(_f[i], _s) < (_s.size() / (double) _size)) n++; } @@ -168,9 +170,9 @@ private: /** * Euclidian distance */ - double euclidianDistance (const ObjectiveVector & _set1, const ObjectiveVector & _to, unsigned _deg = 2) { + double euclidianDistance (const ObjectiveVector & _set1, const ObjectiveVector & _to, unsigned int _deg = 2) { double dist=0; - for (unsigned i=0; i<_set1.size(); i++) + for (unsigned int i=0; i<_set1.size(); i++) dist += pow(fabs(_set1[i] - _to[i]), (int)_deg); return pow(dist, 1.0 / _deg); } diff --git a/branches/paradiseo-moeo-1.0/src/metric/moeoHypervolumeBinaryMetric.h b/branches/paradiseo-moeo-1.0/src/metric/moeoHypervolumeBinaryMetric.h new file mode 100644 index 000000000..39c51ec63 --- /dev/null +++ b/branches/paradiseo-moeo-1.0/src/metric/moeoHypervolumeBinaryMetric.h @@ -0,0 +1,141 @@ +// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*- + +//----------------------------------------------------------------------------- +// moeoHypervolumeBinaryMetric.h +// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007 +/* + This library... + + Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr + */ +//----------------------------------------------------------------------------- + +#ifndef MOEOHYPERVOLUMEBINARYMETRIC_H_ +#define MOEOHYPERVOLUMEBINARYMETRIC_H_ + +#include +#include +#include + +/** + * Hypervolume binary metric allowing to compare two objective vectors as proposed in + * Zitzler E., Künzli S.: Indicator-Based Selection in Multiobjective Search. In Parallel Problem Solving from Nature (PPSN VIII). + * Lecture Notes in Computer Science 3242, Springer, Birmingham, UK pp.832–842 (2004). + * This indicator is based on the hypervolume concept introduced in + * Zitzler, E., Thiele, L.: Multiobjective Optimization Using Evolutionary Algorithms - A Comparative Case Study. + * Parallel Problem Solving from Nature (PPSN-V), pp.292-301 (1998). + */ +template < class ObjectiveVector > +class moeoHypervolumeBinaryMetric : public moeoNormalizedSolutionVsSolutionBinaryMetric < ObjectiveVector, double > +{ +public: + + /** + * Ctor + * @param _rho value used to compute the reference point from the worst values for each objective (default : 1.1) + */ + moeoHypervolumeBinaryMetric(double _rho = 1.1) : rho(_rho) + { + // not-a-maximization problem check + for (unsigned int i=0; i :: bounds; + /** Functor to compare two objective vectors according to Pareto dominance relation */ + moeoParetoObjectiveVectorComparator < ObjectiveVector > paretoComparator; + + + /** + * Returns the volume of the space that is dominated by _o2 but not by _o1 with respect to a reference point computed using rho for the objective _obj. + * @param _o1 the first objective vector + * @param _o2 the second objective vector + * @param _obj the objective index + * @param _flag used for iteration, if _flag=true _o2 is not talen into account (default : false) + */ + double hypervolume(const ObjectiveVector & _o1, const ObjectiveVector & _o2, const unsigned int _obj, const bool _flag = false) + { + double result; + double range = rho * bounds[_obj].range(); + double max = bounds[_obj].minimum() + range; + // value of _1 for the objective _obj + double v1 = _o1[_obj]; + // value of _2 for the objective _obj (if _flag=true, v2=max) + double v2; + if (_flag) + { + v2 = max; + } + else + { + v2 = _o2[_obj]; + } + // computation of the volume + if (_obj == 0) + { + if (v1 < v2) + { + result = (v2 - v1) / range; + } + else + { + result = 0; + } + } + else + { + if (v1 < v2) + { + result = ( hypervolume(_o1, _o2, _obj-1, true) * (v2 - v1) / range ) + ( hypervolume(_o1, _o2, _obj-1) * (max - v2) / range ); + } + else + { + result = hypervolume(_o1, _o2, _obj-1) * (max - v2) / range; + } + } + return result; + } + +}; + +#endif /*MOEOHYPERVOLUMEBINARYMETRIC_H_*/ diff --git a/branches/paradiseo-moeo-1.0/src/metric/moeoMetric.h b/branches/paradiseo-moeo-1.0/src/metric/moeoMetric.h index 93917daef..6678e9a1d 100644 --- a/branches/paradiseo-moeo-1.0/src/metric/moeoMetric.h +++ b/branches/paradiseo-moeo-1.0/src/metric/moeoMetric.h @@ -13,61 +13,55 @@ #ifndef MOEOMETRIC_H_ #define MOEOMETRIC_H_ +#include #include /** * Base class for performance metrics (also known as quality indicators). */ -class moeoMetric : public eoFunctorBase - {}; +class moeoMetric : public eoFunctorBase {}; /** * Base class for unary metrics. */ template < class A, class R > -class moeoUnaryMetric : public eoUF < A, R >, public moeoMetric - {}; +class moeoUnaryMetric : public eoUF < A, R >, public moeoMetric {}; /** * Base class for binary metrics. */ template < class A1, class A2, class R > -class moeoBinaryMetric : public eoBF < A1, A2, R >, public moeoMetric - {}; +class moeoBinaryMetric : public eoBF < A1, A2, R >, public moeoMetric {}; /** * Base class for unary metrics dedicated to the performance evaluation of a single solution's objective vector. */ template < class ObjectiveVector, class R > -class moeoSolutionUnaryMetric : public moeoUnaryMetric < const ObjectiveVector &, R > - {}; +class moeoSolutionUnaryMetric : public moeoUnaryMetric < const ObjectiveVector &, R > {}; /** * Base class for unary metrics dedicated to the performance evaluation of a Pareto set (a vector of objective vectors) */ template < class ObjectiveVector, class R > -class moeoVectorUnaryMetric : public moeoUnaryMetric < const std::vector < ObjectiveVector > &, R > - {}; +class moeoVectorUnaryMetric : public moeoUnaryMetric < const std::vector < ObjectiveVector > &, R > {}; /** * Base class for binary metrics dedicated to the performance comparison between two solutions's objective vectors. */ template < class ObjectiveVector, class R > -class moeoSolutionVsSolutionBinaryMetric : public moeoBinaryMetric < const ObjectiveVector &, const ObjectiveVector &, R > - {}; +class moeoSolutionVsSolutionBinaryMetric : public moeoBinaryMetric < const ObjectiveVector &, const ObjectiveVector &, R > {}; /** * Base class for binary metrics dedicated to the performance comparison between two Pareto sets (two vectors of objective vectors) */ template < class ObjectiveVector, class R > -class moeoVectorVsVectorBinaryMetric : public moeoBinaryMetric < const std::vector < ObjectiveVector > &, const std::vector < ObjectiveVector > &, R > - {}; +class moeoVectorVsVectorBinaryMetric : public moeoBinaryMetric < const std::vector < ObjectiveVector > &, const std::vector < ObjectiveVector > &, R > {}; #endif /*MOEOMETRIC_H_*/ diff --git a/branches/paradiseo-moeo-1.0/src/metric/moeoNormalizedSolutionVsSolutionBinaryMetric.h b/branches/paradiseo-moeo-1.0/src/metric/moeoNormalizedSolutionVsSolutionBinaryMetric.h index 9fb4aef21..e3e390a7e 100644 --- a/branches/paradiseo-moeo-1.0/src/metric/moeoNormalizedSolutionVsSolutionBinaryMetric.h +++ b/branches/paradiseo-moeo-1.0/src/metric/moeoNormalizedSolutionVsSolutionBinaryMetric.h @@ -13,11 +13,10 @@ #ifndef MOEONORMALIZEDSOLUTIONVSSOLUTIONBINARYMETRIC_H_ #define MOEONORMALIZEDSOLUTIONVSSOLUTIONBINARYMETRIC_H_ -#include +#include #include #include - /** * Base class for binary metrics dedicated to the performance comparison between two solutions's objective vectors using normalized values. * Then, indicator values lie in the interval [-1,1]. @@ -35,7 +34,7 @@ public: { bounds.resize(ObjectiveVector::Traits::nObjectives()); // initialize bounds in case someone does not want to use them - for (unsigned i=0; i -class moeoAdditiveEpsilonBinaryMetric : public moeoNormalizedSolutionVsSolutionBinaryMetric < ObjectiveVector, double > -{ -public: - - /** - * Returns the minimal distance by which the objective vector _o1 must be translated in all objectives - * so that it weakly dominates the objective vector _o2 - * @warning don't forget to set the bounds for every objective before the call of this function - * @param _o1 the first objective vector - * @param _o2 the second objective vector - */ - double operator()(const ObjectiveVector & _o1, const ObjectiveVector & _o2) - { - // computation of the epsilon value for the first objective - double result = epsilon(_o1, _o2, 0); - // computation of the epsilon value for the other objectives - double tmp; - for (unsigned i=1; i :: bounds; - - - /** - * Returns the epsilon value by which the objective vector _o1 must be translated in the objective _obj - * so that it dominates the objective vector _o2 - * @param _o1 the first objective vector - * @param _o2 the second objective vector - * @param _obj the index of the objective - */ - double epsilon(const ObjectiveVector & _o1, const ObjectiveVector & _o2, const unsigned _obj) - { - double result; - // if the objective _obj have to be minimized - if (ObjectiveVector::Traits::minimizing(_obj)) - { - // _o1[_obj] - _o2[_obj] - result = ( (_o1[_obj] - bounds[_obj].minimum()) / bounds[_obj].range() ) - ( (_o2[_obj] - bounds[_obj].minimum()) / bounds[_obj].range() ); - } - // if the objective _obj have to be maximized - else - { - // _o2[_obj] - _o1[_obj] - result = ( (_o2[_obj] - bounds[_obj].minimum()) / bounds[_obj].range() ) - ( (_o1[_obj] - bounds[_obj].minimum()) / bounds[_obj].range() ); - } - return result; - } - -}; - - -/** - * Hypervolume binary metric allowing to compare two objective vectors as proposed in - * Zitzler E., Künzli S.: Indicator-Based Selection in Multiobjective Search. In Parallel Problem Solving from Nature (PPSN VIII). - * Lecture Notes in Computer Science 3242, Springer, Birmingham, UK pp.832–842 (2004). - * This indicator is based on the hypervolume concept introduced in - * Zitzler, E., Thiele, L.: Multiobjective Optimization Using Evolutionary Algorithms - A Comparative Case Study. - * Parallel Problem Solving from Nature (PPSN-V), pp.292-301 (1998). - */ -template < class ObjectiveVector > -class moeoHypervolumeBinaryMetric : public moeoNormalizedSolutionVsSolutionBinaryMetric < ObjectiveVector, double > -{ -public: - - /** - * Ctor - * @param _rho value used to compute the reference point from the worst values for each objective (default : 1.1) - */ - moeoHypervolumeBinaryMetric(double _rho = 1.1) : rho(_rho) - { - // not-a-maximization problem check - for (unsigned i=0; i :: bounds; - /** Functor to compare two objective vectors according to Pareto dominance relation */ - moeoParetoObjectiveVectorComparator < ObjectiveVector > paretoComparator; - - /** - * Returns the volume of the space that is dominated by _o2 but not by _o1 with respect to a reference point computed using rho for the objective _obj. - * @param _o1 the first objective vector - * @param _o2 the second objective vector - * @param _obj the objective index - * @param _flag used for iteration, if _flag=true _o2 is not talen into account (default : false) - */ - double hypervolume(const ObjectiveVector & _o1, const ObjectiveVector & _o2, const unsigned _obj, const bool _flag = false) - { - double result; - double range = rho * bounds[_obj].range(); - double max = bounds[_obj].minimum() + range; - // value of _1 for the objective _obj - double v1 = _o1[_obj]; - // value of _2 for the objective _obj (if _flag=true, v2=max) - double v2; - if (_flag) - { - v2 = max; - } - else - { - v2 = _o2[_obj]; - } - // computation of the volume - if (_obj == 0) - { - if (v1 < v2) - { - result = (v2 - v1) / range; - } - else - { - result = 0; - } - } - else - { - if (v1 < v2) - { - result = ( hypervolume(_o1, _o2, _obj-1, true) * (v2 - v1) / range ) + ( hypervolume(_o1, _o2, _obj-1) * (max - v2) / range ); - } - else - { - result = hypervolume(_o1, _o2, _obj-1) * (max - v2) / range; - } - } - return result; - } - -}; - - #endif /*MOEONORMALIZEDSOLUTIONVSSOLUTIONBINARYMETRIC_H_*/