From c7d060efc04d9dd7889f2f08f4869c3ffd7f7d67 Mon Sep 17 00:00:00 2001 From: nojhan Date: Thu, 15 Sep 2011 17:23:23 +0200 Subject: [PATCH] constructors parameters in the correct order, a constructor without an edoContinue --- edo/src/edoEDA.h | 75 +++++++++++++++++++++++++++++++++--------------- 1 file changed, 52 insertions(+), 23 deletions(-) diff --git a/edo/src/edoEDA.h b/edo/src/edoEDA.h index d70cd27f..f2f21294 100644 --- a/edo/src/edoEDA.h +++ b/edo/src/edoEDA.h @@ -60,32 +60,61 @@ public: /*! Takes algo operators, all are mandatory + \param evaluation Evaluate a population \param selector Selection of the best candidate solutions in the population \param estimator Estimation of the distribution parameters \param sampler Generate feasible solutions using the distribution + \param replacor Replace old solutions by new ones \param pop_continuator Stopping criterion based on the population features \param distribution_continuator Stopping criterion based on the distribution features - \param evaluation Evaluate a population - \param replacor Replace old solutions by new ones */ edoEDA ( - eoSelect< EOT > & selector, - edoEstimator< D > & estimator, - edoSampler< D > & sampler, - eoContinue< EOT > & pop_continuator, - edoContinue< D > & distribution_continuator, - eoPopEvalFunc < EOT > & evaluator, - eoReplacement< EOT > & replacor - ) - : _selector(selector), - _estimator(estimator), - _sampler(sampler), - _pop_continuator(pop_continuator), - _distribution_continuator(distribution_continuator), - _evaluator(evaluator), - _replacor(replacor) + eoPopEvalFunc < EOT > & evaluator, + eoSelect< EOT > & selector, + edoEstimator< D > & estimator, + edoSampler< D > & sampler, + eoReplacement< EOT > & replacor, + eoContinue< EOT > & pop_continuator, + edoContinue< D > & distribution_continuator + ) : + _evaluator(evaluator), + _selector(selector), + _estimator(estimator), + _sampler(sampler), + _replacor(replacor), + _pop_continuator(pop_continuator), + _distribution_continuator(distribution_continuator) {} + //! edoEDA constructor without an edoContinue + /*! + Takes algo operators, all are mandatory + + \param evaluation Evaluate a population + \param selector Selection of the best candidate solutions in the population + \param estimator Estimation of the distribution parameters + \param sampler Generate feasible solutions using the distribution + \param replacor Replace old solutions by new ones + \param pop_continuator Stopping criterion based on the population features + */ + edoEDA ( + eoPopEvalFunc < EOT > & evaluator, + eoSelect< EOT > & selector, + edoEstimator< D > & estimator, + edoSampler< D > & sampler, + eoReplacement< EOT > & replacor, + eoContinue< EOT > & pop_continuator + ) : + _evaluator(evaluator), + _selector(selector), + _estimator(estimator), + _sampler(sampler), + _replacor(replacor), + _pop_continuator(pop_continuator), + _distribution_continuator( edoDummyContinue() ) + {} + + /** A basic EDA algorithm that iterates over: * selection, estimation, sampling, bounding, evaluation, replacement * @@ -135,6 +164,9 @@ public: private: + //! A full evaluation function. + eoPopEvalFunc < EOT > & _evaluator; + //! A EOT selector eoSelect < EOT > & _selector; @@ -144,17 +176,14 @@ private: //! A D sampler edoSampler< D > & _sampler; + //! A EOT replacor + eoReplacement < EOT > & _replacor; + //! A EOT population continuator eoContinue < EOT > & _pop_continuator; //! A D continuator edoContinue < D > & _distribution_continuator; - - //! A full evaluation function. - eoPopEvalFunc < EOT > & _evaluator; - - //! A EOT replacor - eoReplacement < EOT > & _replacor; }; #endif // !_edoEDA_h