From 6489e6f4e2d46272cfe38cbd298e4f503a4f12cd Mon Sep 17 00:00:00 2001 From: nojhan Date: Wed, 14 Sep 2011 10:59:28 +0200 Subject: [PATCH 01/15] there is no MO library, only headers --- edo/CMakeLists.txt | 1 - edo/application/eda/CMakeLists.txt | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/edo/CMakeLists.txt b/edo/CMakeLists.txt index 91dc5f27..ab4333ef 100644 --- a/edo/CMakeLists.txt +++ b/edo/CMakeLists.txt @@ -42,7 +42,6 @@ INCLUDE_DIRECTORIES( LINK_DIRECTORIES( ${EO_LIBRARY_DIRS} - ${MO_LIBRARY_DIRS} ) ###################################################################################### diff --git a/edo/application/eda/CMakeLists.txt b/edo/application/eda/CMakeLists.txt index 2f1a52a5..2dfe5774 100644 --- a/edo/application/eda/CMakeLists.txt +++ b/edo/application/eda/CMakeLists.txt @@ -24,4 +24,4 @@ FILE(GLOB SOURCES *.cpp) SET(EXECUTABLE_OUTPUT_PATH ${EDO_BINARY_DIR}) ADD_EXECUTABLE(${PROJECT_NAME} ${SOURCES}) -TARGET_LINK_LIBRARIES(${PROJECT_NAME} edo edoutils ${EO_LIBRARIES} ${MO_LIBRARIES} ${Boost_LIBRARIES}) +TARGET_LINK_LIBRARIES(${PROJECT_NAME} edo edoutils ${EO_LIBRARIES} ${Boost_LIBRARIES}) From d6ccadd18e2cc93a6c1f92489c321f29ff7d852d Mon Sep 17 00:00:00 2001 From: nojhan Date: Wed, 14 Sep 2011 16:28:39 +0200 Subject: [PATCH 02/15] doc update --- edo/src/edoBounder.h | 6 +++--- edo/src/edoBounderBound.h | 2 +- edo/src/edoBounderNo.h | 2 +- edo/src/edoBounderRng.h | 2 +- edo/src/edoBounderUniform.h | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/edo/src/edoBounder.h b/edo/src/edoBounder.h index 8291cffc..471e47f9 100644 --- a/edo/src/edoBounder.h +++ b/edo/src/edoBounder.h @@ -28,15 +28,15 @@ Authors: #ifndef _edoBounder_h #define _edoBounder_h -#include +#include /** The interface of a set of classes that modifies a solution so as to respect * a given set of bounds (typically an hypercube). * - * @ingroup Bounders + * @ingroup Repairers */ template < typename EOT > -class edoBounder : public eoUF< EOT&, void > +class edoBounder : public edoRepairer< EOT > { public: edoBounder( EOT min = EOT(1, 0), EOT max = EOT(1, 0) ) diff --git a/edo/src/edoBounderBound.h b/edo/src/edoBounderBound.h index 3c664624..36ad5314 100644 --- a/edo/src/edoBounderBound.h +++ b/edo/src/edoBounderBound.h @@ -32,7 +32,7 @@ Authors: /** A bounder that correct an incorrect variable by setting it to the min/max * - * @ingroup Bounders + * @ingroup Repairers */ template < typename EOT > class edoBounderBound : public edoBounder< EOT > diff --git a/edo/src/edoBounderNo.h b/edo/src/edoBounderNo.h index 31b4b499..33416d56 100644 --- a/edo/src/edoBounderNo.h +++ b/edo/src/edoBounderNo.h @@ -32,7 +32,7 @@ Authors: /** A bounder that does nothing. * - * @ingroup Bounders + * @ingroup Repairers */ template < typename EOT > class edoBounderNo : public edoBounder< EOT > diff --git a/edo/src/edoBounderRng.h b/edo/src/edoBounderRng.h index 7b909cca..bfe6cb71 100644 --- a/edo/src/edoBounderRng.h +++ b/edo/src/edoBounderRng.h @@ -33,7 +33,7 @@ Authors: /** A bounder that randomly draw new values for variables going out bounds, * using an eoRng to do so. * - * @ingroup Bounders + * @ingroup Repairers */ template < typename EOT > class edoBounderRng : public edoBounder< EOT > diff --git a/edo/src/edoBounderUniform.h b/edo/src/edoBounderUniform.h index a285c8bc..7637d833 100644 --- a/edo/src/edoBounderUniform.h +++ b/edo/src/edoBounderUniform.h @@ -32,7 +32,7 @@ Authors: /** A bounder that randomly draw new values for variables going out bounds, * in a given uniform distribution. * - * @ingroup Bounders + * @ingroup Repairers */ template < typename EOT > class edoBounderUniform : public edoBounder< EOT > From e4399683ddf67bcef11a2aba1c04a306e505a242 Mon Sep 17 00:00:00 2001 From: nojhan Date: Wed, 14 Sep 2011 16:30:45 +0200 Subject: [PATCH 03/15] Repairer operator more generic than Bounder, example with a Repairer that rounds values, a Dispatcher to call several Repairer on partial solutions --- edo/src/edo | 3 + edo/src/edoRepairer.h | 47 ++++++++++++++ edo/src/edoRepairerDispatcher.h | 110 ++++++++++++++++++++++++++++++++ edo/src/edoRepairerRound.h | 68 ++++++++++++++++++++ edo/test/CMakeLists.txt | 1 + edo/test/t-dispatcher-round.cpp | 62 ++++++++++++++++++ 6 files changed, 291 insertions(+) create mode 100644 edo/src/edoRepairer.h create mode 100644 edo/src/edoRepairerDispatcher.h create mode 100644 edo/src/edoRepairerRound.h create mode 100644 edo/test/t-dispatcher-round.cpp diff --git a/edo/src/edo b/edo/src/edo index 1a6a2c68..b19d19d9 100644 --- a/edo/src/edo +++ b/edo/src/edo @@ -56,6 +56,9 @@ Authors: #include "edoVectorBounds.h" +#include "edoRepairer.h" +#include "edoRepairerDispatcher.h" +#include "edoRepairerRound.h" #include "edoBounder.h" #include "edoBounderNo.h" #include "edoBounderBound.h" diff --git a/edo/src/edoRepairer.h b/edo/src/edoRepairer.h new file mode 100644 index 00000000..8ea2366a --- /dev/null +++ b/edo/src/edoRepairer.h @@ -0,0 +1,47 @@ +/* +The Evolving Distribution Objects framework (EDO) is a template-based, +ANSI-C++ evolutionary computation library which helps you to write your +own estimation of distribution algorithms. + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Copyright (C) 2011 Thales group +*/ +/* +Authors: + Johann Dréo + Pierre Savéant +*/ + +#ifndef _edoRepairer_h +#define _edoRepairer_h + +#include + +/** The interface of a set of classes that modifies an unfeasible candidate + * solution so as to respect a given set of constraints and thus make a feasible + * solution. + * + * @ingroup Repairers + */ +template < typename EOT > +class edoRepairer : public eoUF< EOT&, void > +{ +public: + // virtual void operator()( EOT& ) = 0 (provided by eoUF< A1, R >) + virtual void operator()( EOT& ) {} +}; + +#endif // !_edoRepairer_h diff --git a/edo/src/edoRepairerDispatcher.h b/edo/src/edoRepairerDispatcher.h new file mode 100644 index 00000000..6824d115 --- /dev/null +++ b/edo/src/edoRepairerDispatcher.h @@ -0,0 +1,110 @@ +/* +The Evolving Distribution Objects framework (EDO) is a template-based, +ANSI-C++ evolutionary computation library which helps you to write your +own estimation of distribution algorithms. + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Copyright (C) 2011 Thales group +*/ +/* +Authors: + Johann Dréo + Pierre Savéant +*/ + +#ifndef _edoRepairerDispatcher_h +#define _edoRepairerDispatcher_h + +#include +#include +#include + +#include "edoRepairer.h" + +/** Repair a candidate solution by sequentially applying several repairers on + * subparts of the solution (subparts being defined by the corresponding set + * of indexes). + * + * Only work on EOT that implements the "push_back( EOT::AtomType )" and + * "operator[](uint)" and "at(uint)" methods. + * + * Expects _addresses_ of the repairer operators. + * + * @example t-dispatcher-round.cpp + * + * @ingroup Repairers + */ + +template < typename EOT > +class edoRepairerDispatcher + : public eoUF< EOT&, void >, + std::vector< + std::pair< std::set< unsigned int >, edoRepairer< EOT >* > + > +{ +public: + //! Empty constructor + edoRepairerDispatcher() : + std::vector< + std::pair< std::set< unsigned int >, edoRepairer< EOT >* > + >() + {} + + //! Constructor with a single index set and repairer operator + edoRepairerDispatcher( std::set idx, edoRepairer* op ) : + std::vector< + std::pair< std::set< unsigned int >, edoRepairer< EOT >* > + >() + { + this->add( idx, op ); + } + + //! Add more indexes set and their corresponding repairer operator address to the list + void add( std::set idx, edoRepairer* op ) + { + this->push_back( std::make_pair(idx, op) ); + } + + //! Repair a solution by calling several repair operator on subset of indexes + virtual void operator()( EOT& sol ) + { + // i is an iterator that points on a pair + for( typename edoRepairerDispatcher::iterator i = this->begin(); i != this->end(); ++i ) { + // a partial copy of the sol + EOT partsol; + + // j is an iterator that points on an uint + for( std::set< unsigned int >::iterator j = i->first.begin(); j != i->first.end(); ++j ) { + partsol.push_back( sol.at(*j) ); + } // for j + + // apply the repairer on the partial copy + // the repairer is a functor, thus second is callable + (*(i->second))( partsol ); + + { // copy back the repaired partial solution to sol + // browse partsol with uint k, and the idx set with an iterator (std::set is an associative tab) + unsigned int k=0; + for( std::set< unsigned int >::iterator j = i->first.begin(); j != i->first.end(); ++j ) { + sol[ *j ] = partsol[ k ]; + k++; + } // for j + } // context for k + } // for i + } +}; + +#endif // !_edoRepairerDispatcher_h diff --git a/edo/src/edoRepairerRound.h b/edo/src/edoRepairerRound.h new file mode 100644 index 00000000..03216942 --- /dev/null +++ b/edo/src/edoRepairerRound.h @@ -0,0 +1,68 @@ +/* +The Evolving Distribution Objects framework (EDO) is a template-based, +ANSI-C++ evolutionary computation library which helps you to write your +own estimation of distribution algorithms. + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Copyright (C) 2011 Thales group +*/ +/* +Authors: + Johann Dréo + Pierre Savéant +*/ + +#ifndef _edoRepairerRound_h +#define _edoRepairerRound_h + +#include + +#include "edoRepairer.h" + +/** + * + * @ingroup Repairers + */ +template < typename EOT > +class edoRepairerFloor : public edoRepairer +{ +public: + virtual void operator()( EOT& sol ) + { + for( unsigned int i=0; i < sol.size(); ++i ) { + sol[i] = floor( sol[i] ); + } + } +}; + +/** + * + * @ingroup Repairers + */ +template < typename EOT > +class edoRepairerCeil : public edoRepairer +{ +public: + virtual void operator()( EOT& sol ) + { + for( unsigned int i=0; i < sol.size(); ++i ) { + sol[i] = ceil( sol[i] ); + } + } +}; + + +#endif // !_edoRepairerRound_h diff --git a/edo/test/CMakeLists.txt b/edo/test/CMakeLists.txt index aea8eaee..acdabc7b 100644 --- a/edo/test/CMakeLists.txt +++ b/edo/test/CMakeLists.txt @@ -38,6 +38,7 @@ SET(SOURCES t-bounderno t-uniform t-continue + t-dispatcher-round ) FOREACH(current ${SOURCES}) diff --git a/edo/test/t-dispatcher-round.cpp b/edo/test/t-dispatcher-round.cpp new file mode 100644 index 00000000..245a2e2c --- /dev/null +++ b/edo/test/t-dispatcher-round.cpp @@ -0,0 +1,62 @@ +/* +The Evolving Distribution Objects framework (EDO) is a template-based, +ANSI-C++ evolutionary computation library which helps you to write your +own estimation of distribution algorithms. + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Copyright (C) 2010 Thales group +*/ +/* +Authors: + Johann Dréo + Pierre Savéant +*/ + +#include +#include +#include + +typedef eoReal< eoMinimizingFitness > EOT; + +int main(void) +{ + EOT sol; + sol.push_back(1.1); + sol.push_back(1.1); + sol.push_back(3.9); + sol.push_back(3.9); + // we expect {1,2,3,4} + + edoRepairer* rep1 = new edoRepairerFloor(); + edoRepairer* rep2 = new edoRepairerCeil(); + + std::set indexes1; + indexes1.insert(0); + indexes1.insert(2); + + std::set indexes2; + indexes2.insert(1); + indexes2.insert(3); + + edoRepairerDispatcher repare( indexes1, rep1 ); + repare.add( indexes2, rep2 ); + + repare(sol); + + std::cout << sol << std::endl; + + return 0; +} From c7d060efc04d9dd7889f2f08f4869c3ffd7f7d67 Mon Sep 17 00:00:00 2001 From: nojhan Date: Thu, 15 Sep 2011 17:23:23 +0200 Subject: [PATCH 04/15] 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 From 37a2c68b690ed1a609c2728bab3af5f6cc07bea0 Mon Sep 17 00:00:00 2001 From: nojhan Date: Thu, 15 Sep 2011 17:27:46 +0200 Subject: [PATCH 05/15] code formating --- edo/src/edoSampler.h | 53 ++++------- edo/src/edoSamplerNormalMono.h | 51 ++++------ edo/src/edoSamplerNormalMulti.h | 160 ++++++++++++++++---------------- edo/src/edoSamplerUniform.h | 56 ++++------- 4 files changed, 135 insertions(+), 185 deletions(-) diff --git a/edo/src/edoSampler.h b/edo/src/edoSampler.h index 3e4dd0bd..bb0f8b6d 100644 --- a/edo/src/edoSampler.h +++ b/edo/src/edoSampler.h @@ -30,7 +30,7 @@ Authors: #include -#include "edoBounder.h" +#include "edoRepairer.h" #include "edoBounderNo.h" //! edoSampler< D > @@ -41,47 +41,34 @@ class edoSampler : public eoUF< D&, typename D::EOType > public: typedef typename D::EOType EOType; - edoSampler(edoBounder< EOType > & bounder) - : /*_dummy_bounder(),*/ _bounder(bounder) + edoSampler(edoRepairer< EOType > & repairer) + : _dummy_repairer(), _repairer(repairer) {} - /* + edoSampler() - : _dummy_bounder(), _bounder( _dummy_bounder ) + : _dummy_repairer(), _repairer( _dummy_repairer ) {} - */ + // virtual EOType operator()( D& ) = 0 (provided by eoUF< A1, R >) EOType operator()( D& distrib ) { - unsigned int size = distrib.size(); - assert(size > 0); + unsigned int size = distrib.size(); + assert(size > 0); + // Point we want to sample to get higher a set of points + // (coordinates in n dimension) + // x = {x1, x2, ..., xn} + // the sample method is implemented in the derivated class + EOType solution(sample(distrib)); - //------------------------------------------------------------- - // Point we want to sample to get higher a set of points - // (coordinates in n dimension) - // x = {x1, x2, ..., xn} - // the sample method is implemented in the derivated class - //------------------------------------------------------------- + // Now we are bounding the distribution thanks to min and max + // parameters. + _repairer(solution); - EOType solution(sample(distrib)); - - //------------------------------------------------------------- - - - //------------------------------------------------------------- - // Now we are bounding the distribution thanks to min and max - // parameters. - //------------------------------------------------------------- - - _bounder(solution); - - //------------------------------------------------------------- - - - return solution; + return solution; } protected: @@ -89,10 +76,10 @@ protected: virtual EOType sample( D& ) = 0; private: - //edoBounderNo _dummy_bounder; + edoBounderNo _dummy_repairer; - //! Bounder functor - edoBounder< EOType > & _bounder; + //! repairer functor + edoRepairer< EOType > & _repairer; }; diff --git a/edo/src/edoSamplerNormalMono.h b/edo/src/edoSamplerNormalMono.h index b52ad283..5233e9c8 100644 --- a/edo/src/edoSamplerNormalMono.h +++ b/edo/src/edoSamplerNormalMono.h @@ -45,46 +45,31 @@ class edoSamplerNormalMono : public edoSampler< edoNormalMono< EOT > > public: typedef typename EOT::AtomType AtomType; - edoSamplerNormalMono( edoBounder< EOT > & bounder ) - : edoSampler< edoNormalMono< EOT > >( bounder ) - {} + edoSamplerNormalMono( edoRepairer & repairer ) : edoSampler( repairer) {} EOT sample( edoNormalMono< EOT >& distrib ) { - unsigned int size = distrib.size(); - assert(size > 0); + unsigned int size = distrib.size(); + assert(size > 0); + // Point we want to sample to get higher a set of points + // (coordinates in n dimension) + // x = {x1, x2, ..., xn} + EOT solution; + + // Sampling all dimensions + for (unsigned int i = 0; i < size; ++i) + { + AtomType mean = distrib.mean()[i]; + AtomType variance = distrib.variance()[i]; + AtomType random = rng.normal(mean, variance); - //------------------------------------------------------------- - // Point we want to sample to get higher a set of points - // (coordinates in n dimension) - // x = {x1, x2, ..., xn} - //------------------------------------------------------------- + assert(variance >= 0); - EOT solution; + solution.push_back(random); + } - //------------------------------------------------------------- - - - //------------------------------------------------------------- - // Sampling all dimensions - //------------------------------------------------------------- - - for (unsigned int i = 0; i < size; ++i) - { - AtomType mean = distrib.mean()[i]; - AtomType variance = distrib.variance()[i]; - AtomType random = rng.normal(mean, variance); - - assert(variance >= 0); - - solution.push_back(random); - } - - //------------------------------------------------------------- - - - return solution; + return solution; } }; diff --git a/edo/src/edoSamplerNormalMulti.h b/edo/src/edoSamplerNormalMulti.h index 2601ea77..a73a266d 100644 --- a/edo/src/edoSamplerNormalMulti.h +++ b/edo/src/edoSamplerNormalMulti.h @@ -40,136 +40,138 @@ class edoSamplerNormalMulti : public edoSampler< edoNormalMulti< EOT > > public: typedef typename EOT::AtomType AtomType; + edoSamplerNormalMulti( edoRepairer & repairer ) : edoSampler( repairer) {} + class Cholesky { public: - Cholesky( const ublas::symmetric_matrix< AtomType, ublas::lower >& V) - { - unsigned int Vl = V.size1(); + Cholesky( const ublas::symmetric_matrix< AtomType, ublas::lower >& V) + { + unsigned int Vl = V.size1(); - assert(Vl > 0); + assert(Vl > 0); - unsigned int Vc = V.size2(); + unsigned int Vc = V.size2(); - assert(Vc > 0); + assert(Vc > 0); - assert( Vl == Vc ); + assert( Vl == Vc ); - _L.resize(Vl); + _L.resize(Vl); - unsigned int i,j,k; + unsigned int i,j,k; - // first column - i=0; + // first column + i=0; - // diagonal - j=0; - _L(0, 0) = sqrt( V(0, 0) ); + // diagonal + j=0; + _L(0, 0) = sqrt( V(0, 0) ); - // end of the column - for ( j = 1; j < Vc; ++j ) - { - _L(j, 0) = V(0, j) / _L(0, 0); - } + // end of the column + for ( j = 1; j < Vc; ++j ) + { + _L(j, 0) = V(0, j) / _L(0, 0); + } - // end of the matrix - for ( i = 1; i < Vl; ++i ) // each column - { + // end of the matrix + for ( i = 1; i < Vl; ++i ) // each column + { - // diagonal - double sum = 0.0; + // diagonal + double sum = 0.0; - for ( k = 0; k < i; ++k) - { - sum += _L(i, k) * _L(i, k); - } + for ( k = 0; k < i; ++k) + { + sum += _L(i, k) * _L(i, k); + } - _L(i,i) = sqrt( fabs( V(i,i) - sum) ); + _L(i,i) = sqrt( fabs( V(i,i) - sum) ); - for ( j = i + 1; j < Vl; ++j ) // rows - { - // one element - sum = 0.0; + for ( j = i + 1; j < Vl; ++j ) // rows + { + // one element + sum = 0.0; - for ( k = 0; k < i; ++k ) - { - sum += _L(j, k) * _L(i, k); - } + for ( k = 0; k < i; ++k ) + { + sum += _L(j, k) * _L(i, k); + } - _L(j, i) = (V(j, i) - sum) / _L(i, i); - } - } - } + _L(j, i) = (V(j, i) - sum) / _L(i, i); + } + } + } - const ublas::symmetric_matrix< AtomType, ublas::lower >& get_L() const {return _L;} + const ublas::symmetric_matrix< AtomType, ublas::lower >& get_L() const {return _L;} private: - ublas::symmetric_matrix< AtomType, ublas::lower > _L; + ublas::symmetric_matrix< AtomType, ublas::lower > _L; }; edoSamplerNormalMulti( edoBounder< EOT > & bounder ) - : edoSampler< edoNormalMulti< EOT > >( bounder ) + : edoSampler< edoNormalMulti< EOT > >( bounder ) {} EOT sample( edoNormalMulti< EOT >& distrib ) { - unsigned int size = distrib.size(); + unsigned int size = distrib.size(); - assert(size > 0); + assert(size > 0); - //------------------------------------------------------------- - // Cholesky factorisation gererating matrix L from covariance - // matrix V. - // We must use cholesky.get_L() to get the resulting matrix. - // - // L = cholesky decomposition of varcovar - //------------------------------------------------------------- + //------------------------------------------------------------- + // Cholesky factorisation gererating matrix L from covariance + // matrix V. + // We must use cholesky.get_L() to get the resulting matrix. + // + // L = cholesky decomposition of varcovar + //------------------------------------------------------------- - Cholesky cholesky( distrib.varcovar() ); - ublas::symmetric_matrix< AtomType, ublas::lower > L = cholesky.get_L(); + Cholesky cholesky( distrib.varcovar() ); + ublas::symmetric_matrix< AtomType, ublas::lower > L = cholesky.get_L(); - //------------------------------------------------------------- + //------------------------------------------------------------- - //------------------------------------------------------------- - // T = vector of size elements drawn in N(0,1) rng.normal(1.0) - //------------------------------------------------------------- + //------------------------------------------------------------- + // T = vector of size elements drawn in N(0,1) rng.normal(1.0) + //------------------------------------------------------------- - ublas::vector< AtomType > T( size ); + ublas::vector< AtomType > T( size ); - for ( unsigned int i = 0; i < size; ++i ) - { - T( i ) = rng.normal( 1.0 ); - } + for ( unsigned int i = 0; i < size; ++i ) + { + T( i ) = rng.normal( 1.0 ); + } - //------------------------------------------------------------- + //------------------------------------------------------------- - //------------------------------------------------------------- - // LT = prod( L, T ) - //------------------------------------------------------------- + //------------------------------------------------------------- + // LT = prod( L, T ) + //------------------------------------------------------------- - ublas::vector< AtomType > LT = ublas::prod( L, T ); + ublas::vector< AtomType > LT = ublas::prod( L, T ); - //------------------------------------------------------------- + //------------------------------------------------------------- - //------------------------------------------------------------- - // solution = means + LT - //------------------------------------------------------------- + //------------------------------------------------------------- + // solution = means + LT + //------------------------------------------------------------- - ublas::vector< AtomType > mean = distrib.mean(); + ublas::vector< AtomType > mean = distrib.mean(); - ublas::vector< AtomType > ublas_solution = mean + LT; + ublas::vector< AtomType > ublas_solution = mean + LT; - EOT solution( size ); + EOT solution( size ); - std::copy( ublas_solution.begin(), ublas_solution.end(), solution.begin() ); + std::copy( ublas_solution.begin(), ublas_solution.end(), solution.begin() ); - //------------------------------------------------------------- + //------------------------------------------------------------- - return solution; + return solution; } }; diff --git a/edo/src/edoSamplerUniform.h b/edo/src/edoSamplerUniform.h index dbb8f412..8506ee54 100644 --- a/edo/src/edoSamplerUniform.h +++ b/edo/src/edoSamplerUniform.h @@ -44,52 +44,28 @@ class edoSamplerUniform : public edoSampler< edoUniform< EOT > > public: typedef D Distrib; - edoSamplerUniform(edoBounder< EOT > & bounder) - : edoSampler< edoUniform >(bounder) // FIXME: Why D is not used here ? - {} - - /* - edoSamplerUniform() - : edoSampler< edoUniform >() - {} - */ + edoSamplerUniform( edoRepairer & repairer ) : edoSampler( repairer) {} EOT sample( edoUniform< EOT >& distrib ) { - unsigned int size = distrib.size(); - assert(size > 0); + unsigned int size = distrib.size(); + assert(size > 0); + // Point we want to sample to get higher a set of points + // (coordinates in n dimension) + // x = {x1, x2, ..., xn} + EOT solution; - //------------------------------------------------------------- - // Point we want to sample to get higher a set of points - // (coordinates in n dimension) - // x = {x1, x2, ..., xn} - //------------------------------------------------------------- + // Sampling all dimensions + for (unsigned int i = 0; i < size; ++i) + { + double min = distrib.min()[i]; + double max = distrib.max()[i]; + double random = rng.uniform(min, max); + solution.push_back(random); + } - EOT solution; - - //------------------------------------------------------------- - - - //------------------------------------------------------------- - // Sampling all dimensions - //------------------------------------------------------------- - - for (unsigned int i = 0; i < size; ++i) - { - double min = distrib.min()[i]; - double max = distrib.max()[i]; - double random = rng.uniform(min, max); - - assert(min <= random && random <= max); - - solution.push_back(random); - } - - //------------------------------------------------------------- - - - return solution; + return solution; } }; From 2bc68f94a6f0123c014643b28f0f25661666442a Mon Sep 17 00:00:00 2001 From: nojhan Date: Thu, 15 Sep 2011 17:34:57 +0200 Subject: [PATCH 06/15] add edoBounderUniform.h --- edo/src/edo | 1 + 1 file changed, 1 insertion(+) diff --git a/edo/src/edo b/edo/src/edo index b19d19d9..69f13f11 100644 --- a/edo/src/edo +++ b/edo/src/edo @@ -63,6 +63,7 @@ Authors: #include "edoBounderNo.h" #include "edoBounderBound.h" #include "edoBounderRng.h" +#include "edoBounderUniform.h" #include "edoContinue.h" #include "utils/edoCheckPoint.h" From c1d49d7bd20298d40abf679e6f53f01b039511d2 Mon Sep 17 00:00:00 2001 From: nojhan Date: Thu, 15 Sep 2011 17:44:55 +0200 Subject: [PATCH 07/15] use default typename for distrib, correct constructor superclass init --- edo/src/edoSamplerNormalMono.h | 6 +++--- edo/src/edoSamplerNormalMulti.h | 6 +++--- edo/src/edoSamplerUniform.h | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/edo/src/edoSamplerNormalMono.h b/edo/src/edoSamplerNormalMono.h index 5233e9c8..b3162f92 100644 --- a/edo/src/edoSamplerNormalMono.h +++ b/edo/src/edoSamplerNormalMono.h @@ -39,13 +39,13 @@ Authors: * This class uses the NormalMono distribution parameters (bounds) to return * a random position used for population sampling. */ -template < typename EOT > -class edoSamplerNormalMono : public edoSampler< edoNormalMono< EOT > > +template < typename EOT, typename D = edoNormalMono< EOT > > +class edoSamplerNormalMono : public edoSampler< D > { public: typedef typename EOT::AtomType AtomType; - edoSamplerNormalMono( edoRepairer & repairer ) : edoSampler( repairer) {} + edoSamplerNormalMono( edoRepairer & repairer ) : edoSampler< D >( repairer) {} EOT sample( edoNormalMono< EOT >& distrib ) { diff --git a/edo/src/edoSamplerNormalMulti.h b/edo/src/edoSamplerNormalMulti.h index a73a266d..7c08d22b 100644 --- a/edo/src/edoSamplerNormalMulti.h +++ b/edo/src/edoSamplerNormalMulti.h @@ -34,13 +34,13 @@ Authors: //! edoSamplerNormalMulti< EOT > -template< class EOT > -class edoSamplerNormalMulti : public edoSampler< edoNormalMulti< EOT > > +template< class EOT, typename D = edoNormalMulti< EOT > > +class edoSamplerNormalMulti : public edoSampler< D > { public: typedef typename EOT::AtomType AtomType; - edoSamplerNormalMulti( edoRepairer & repairer ) : edoSampler( repairer) {} + edoSamplerNormalMulti( edoRepairer & repairer ) : edoSampler< D >( repairer) {} class Cholesky { diff --git a/edo/src/edoSamplerUniform.h b/edo/src/edoSamplerUniform.h index 8506ee54..44a59ea8 100644 --- a/edo/src/edoSamplerUniform.h +++ b/edo/src/edoSamplerUniform.h @@ -38,13 +38,13 @@ Authors: * This class uses the Uniform distribution parameters (bounds) to return * a random position used for population sampling. */ -template < typename EOT, class D=edoUniform > // FIXME: D template name is there really used ?!? -class edoSamplerUniform : public edoSampler< edoUniform< EOT > > +template < typename EOT, class D = edoUniform > +class edoSamplerUniform : public edoSampler< D > { public: typedef D Distrib; - edoSamplerUniform( edoRepairer & repairer ) : edoSampler( repairer) {} + edoSamplerUniform( edoRepairer & repairer ) : edoSampler< D >( repairer) {} EOT sample( edoUniform< EOT >& distrib ) { From 6fb123f2be6f7cc45d1e1c432bbf4caf0a36017d Mon Sep 17 00:00:00 2001 From: nojhan Date: Thu, 15 Sep 2011 17:47:24 +0200 Subject: [PATCH 08/15] dispatcher inherits from repairer and not from UF --- edo/src/edoRepairerDispatcher.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/edo/src/edoRepairerDispatcher.h b/edo/src/edoRepairerDispatcher.h index 6824d115..3f873ec7 100644 --- a/edo/src/edoRepairerDispatcher.h +++ b/edo/src/edoRepairerDispatcher.h @@ -50,7 +50,7 @@ Authors: template < typename EOT > class edoRepairerDispatcher - : public eoUF< EOT&, void >, + : public edoRepairer, std::vector< std::pair< std::set< unsigned int >, edoRepairer< EOT >* > > From 54224807f57645a5c739f0750253c3061214bde7 Mon Sep 17 00:00:00 2001 From: nojhan Date: Thu, 22 Sep 2011 11:53:59 +0200 Subject: [PATCH 09/15] constructor for EDA without a needed edoContinue --- edo/src/edoEDA.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/edo/src/edoEDA.h b/edo/src/edoEDA.h index f2f21294..f94e828f 100644 --- a/edo/src/edoEDA.h +++ b/edo/src/edoEDA.h @@ -83,6 +83,7 @@ public: _sampler(sampler), _replacor(replacor), _pop_continuator(pop_continuator), + _dummy_continue(), _distribution_continuator(distribution_continuator) {} @@ -111,7 +112,8 @@ public: _sampler(sampler), _replacor(replacor), _pop_continuator(pop_continuator), - _distribution_continuator( edoDummyContinue() ) + _dummy_continue(), + _distribution_continuator( _dummy_continue ) {} @@ -182,8 +184,12 @@ private: //! A EOT population continuator eoContinue < EOT > & _pop_continuator; + //! A D continuator that always return true + edoDummyContinue _dummy_continue; + //! A D continuator edoContinue < D > & _distribution_continuator; + }; #endif // !_edoEDA_h From 90e67e46d2fbb4adfac37ed18d2773c0b8cae32a Mon Sep 17 00:00:00 2001 From: nojhan Date: Thu, 22 Sep 2011 11:55:10 +0200 Subject: [PATCH 10/15] indent --- edo/src/edoEstimatorNormalMono.h | 68 ++++++++++++++++---------------- edo/src/edoUniform.h | 2 +- edo/src/edoVectorBounds.h | 10 ++--- 3 files changed, 40 insertions(+), 40 deletions(-) diff --git a/edo/src/edoEstimatorNormalMono.h b/edo/src/edoEstimatorNormalMono.h index 6a42114b..c5ddade4 100644 --- a/edo/src/edoEstimatorNormalMono.h +++ b/edo/src/edoEstimatorNormalMono.h @@ -42,57 +42,57 @@ public: class Variance { public: - Variance() : _sumvar(0){} + Variance() : _sumvar(0){} - void update(AtomType v) - { - _n++; + void update(AtomType v) + { + _n++; - AtomType d = v - _mean; + AtomType d = v - _mean; - _mean += 1 / _n * d; - _sumvar += (_n - 1) / _n * d * d; - } + _mean += 1 / _n * d; + _sumvar += (_n - 1) / _n * d * d; + } - AtomType get_mean() const {return _mean;} - AtomType get_var() const {return _sumvar / (_n - 1);} - AtomType get_std() const {return sqrt( get_var() );} + AtomType get_mean() const {return _mean;} + AtomType get_var() const {return _sumvar / (_n - 1);} + AtomType get_std() const {return sqrt( get_var() );} private: - AtomType _n; - AtomType _mean; - AtomType _sumvar; + AtomType _n; + AtomType _mean; + AtomType _sumvar; }; public: edoNormalMono< EOT > operator()(eoPop& pop) { - unsigned int popsize = pop.size(); - assert(popsize > 0); + unsigned int popsize = pop.size(); + assert(popsize > 0); - unsigned int dimsize = pop[0].size(); - assert(dimsize > 0); + unsigned int dimsize = pop[0].size(); + assert(dimsize > 0); - std::vector< Variance > var( dimsize ); + std::vector< Variance > var( dimsize ); - for (unsigned int i = 0; i < popsize; ++i) - { - for (unsigned int d = 0; d < dimsize; ++d) - { - var[d].update( pop[i][d] ); - } - } + for (unsigned int i = 0; i < popsize; ++i) + { + for (unsigned int d = 0; d < dimsize; ++d) + { + var[d].update( pop[i][d] ); + } + } - EOT mean( dimsize ); - EOT variance( dimsize ); + EOT mean( dimsize ); + EOT variance( dimsize ); - for (unsigned int d = 0; d < dimsize; ++d) - { - mean[d] = var[d].get_mean(); - variance[d] = var[d].get_var(); - } + for (unsigned int d = 0; d < dimsize; ++d) + { + mean[d] = var[d].get_mean(); + variance[d] = var[d].get_var(); + } - return edoNormalMono< EOT >( mean, variance ); + return edoNormalMono< EOT >( mean, variance ); } }; diff --git a/edo/src/edoUniform.h b/edo/src/edoUniform.h index 37bf065b..3317e1af 100644 --- a/edo/src/edoUniform.h +++ b/edo/src/edoUniform.h @@ -38,7 +38,7 @@ class edoUniform : public edoDistrib< EOT >, public edoVectorBounds< EOT > { public: edoUniform(EOT min, EOT max) - : edoVectorBounds< EOT >(min, max) + : edoVectorBounds< EOT >(min, max) {} }; diff --git a/edo/src/edoVectorBounds.h b/edo/src/edoVectorBounds.h index 635132cd..4fc64aa6 100644 --- a/edo/src/edoVectorBounds.h +++ b/edo/src/edoVectorBounds.h @@ -35,10 +35,10 @@ class edoVectorBounds { public: edoVectorBounds(EOT min, EOT max) - : _min(min), _max(max) + : _min(min), _max(max) { - assert(_min.size() > 0); - assert(_min.size() == _max.size()); + assert(_min.size() > 0); + assert(_min.size() == _max.size()); } EOT min(){return _min;} @@ -46,8 +46,8 @@ public: unsigned int size() { - assert(_min.size() == _max.size()); - return _min.size(); + assert(_min.size() == _max.size()); + return _min.size(); } private: From e7791bb4dfc1539263bddf6258b4fb6c19e164f8 Mon Sep 17 00:00:00 2001 From: nojhan Date: Thu, 22 Sep 2011 11:56:26 +0200 Subject: [PATCH 11/15] separate empty/parametrized constructors in Bounder --- edo/src/edoBounder.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/edo/src/edoBounder.h b/edo/src/edoBounder.h index 471e47f9..8f418aa8 100644 --- a/edo/src/edoBounder.h +++ b/edo/src/edoBounder.h @@ -39,7 +39,11 @@ template < typename EOT > class edoBounder : public edoRepairer< EOT > { public: - edoBounder( EOT min = EOT(1, 0), EOT max = EOT(1, 0) ) + edoBounder() + {} + + + edoBounder( EOT min/* = EOT(1, 0)*/, EOT max/* = EOT(1, 1)*/ ) : _min(min), _max(max) { assert(_min.size() > 0); From 712098a5cd7448812b9b243563ab10101642cb27 Mon Sep 17 00:00:00 2001 From: nojhan Date: Thu, 22 Sep 2011 11:57:31 +0200 Subject: [PATCH 12/15] more asserts in RepairerDispatcher and BounderUniform --- edo/src/edoBounderUniform.h | 10 +++++++--- edo/src/edoRepairerDispatcher.h | 17 +++++++++++------ 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/edo/src/edoBounderUniform.h b/edo/src/edoBounderUniform.h index 7637d833..c90317c7 100644 --- a/edo/src/edoBounderUniform.h +++ b/edo/src/edoBounderUniform.h @@ -40,13 +40,17 @@ class edoBounderUniform : public edoBounder< EOT > public: edoBounderUniform( EOT min, EOT max ) : edoBounder< EOT >( min, max ) - {} + { + } void operator()( EOT& sol ) { - unsigned int size = sol.size(); - assert(size > 0); + assert( this->min().size() > 0 ); + assert( this->max().size() > 0 ); + assert( sol.size() > 0); + + unsigned int size = sol.size(); for (unsigned int d = 0; d < size; ++d) { if ( sol[d] < this->min()[d] || sol[d] > this->max()[d]) { diff --git a/edo/src/edoRepairerDispatcher.h b/edo/src/edoRepairerDispatcher.h index 3f873ec7..96c07da5 100644 --- a/edo/src/edoRepairerDispatcher.h +++ b/edo/src/edoRepairerDispatcher.h @@ -75,35 +75,40 @@ public: //! Add more indexes set and their corresponding repairer operator address to the list void add( std::set idx, edoRepairer* op ) { + assert( idx.size() > 0 ); + assert( op != NULL ); + this->push_back( std::make_pair(idx, op) ); } //! Repair a solution by calling several repair operator on subset of indexes virtual void operator()( EOT& sol ) { - // i is an iterator that points on a pair - for( typename edoRepairerDispatcher::iterator i = this->begin(); i != this->end(); ++i ) { + // ipair is an iterator that points on a pair + for( typename edoRepairerDispatcher::iterator ipair = this->begin(); ipair != this->end(); ++ipair ) { // a partial copy of the sol EOT partsol; // j is an iterator that points on an uint - for( std::set< unsigned int >::iterator j = i->first.begin(); j != i->first.end(); ++j ) { + for( std::set< unsigned int >::iterator j = ipair->first.begin(); j != ipair->first.end(); ++j ) { partsol.push_back( sol.at(*j) ); } // for j + assert( partsol.size() > 0 ); + // apply the repairer on the partial copy // the repairer is a functor, thus second is callable - (*(i->second))( partsol ); + (*(ipair->second))( partsol ); { // copy back the repaired partial solution to sol // browse partsol with uint k, and the idx set with an iterator (std::set is an associative tab) unsigned int k=0; - for( std::set< unsigned int >::iterator j = i->first.begin(); j != i->first.end(); ++j ) { + for( std::set< unsigned int >::iterator j = ipair->first.begin(); j != ipair->first.end(); ++j ) { sol[ *j ] = partsol[ k ]; k++; } // for j } // context for k - } // for i + } // for ipair } }; From 1c4cdae6636fcd193e6e6d809236d3ef218a70ad Mon Sep 17 00:00:00 2001 From: nojhan Date: Sun, 2 Oct 2011 15:44:51 +0200 Subject: [PATCH 13/15] use the logger to print warnings --- eo/src/utils/eoParser.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/eo/src/utils/eoParser.cpp b/eo/src/utils/eoParser.cpp index 97c4b3d5..13540292 100644 --- a/eo/src/utils/eoParser.cpp +++ b/eo/src/utils/eoParser.cpp @@ -35,16 +35,11 @@ #include #include - #include +#include using namespace std; -void eoWarning(std::string str) -{ - cout << str << '\n'; -} - std::ostream& printSectionHeader(std::ostream& os, std::string section) { if (section == "") @@ -117,7 +112,6 @@ eoParser::eoParser ( unsigned _argc, char **_argv , string _programDescription, } - eoParam * eoParser::getParamWithLongName(const std::string& _name) const { typedef std::multimap MultiMapType; @@ -130,7 +124,6 @@ eoParam * eoParser::getParamWithLongName(const std::string& _name) const } - void eoParser::processParam(eoParam& param, std::string section) { // this param enters the parser: add the prefix to the long name @@ -214,7 +207,7 @@ void eoParser::readFrom(istream& is) { if (str.size() < 2) { - eoWarning("Missing parameter"); + eo::log << eo::warnings << "Missing parameter" << std::endl; needHelp.value() = true; return; } From ae919bc7123dae7c421f978df2813c5594834843 Mon Sep 17 00:00:00 2001 From: nojhan Date: Sun, 2 Oct 2011 22:22:18 +0200 Subject: [PATCH 14/15] shortcut to get a param value --- eo/src/utils/eoParser.cpp | 6 ++++++ eo/src/utils/eoParser.h | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/eo/src/utils/eoParser.cpp b/eo/src/utils/eoParser.cpp index 13540292..e97a2a2e 100644 --- a/eo/src/utils/eoParser.cpp +++ b/eo/src/utils/eoParser.cpp @@ -112,6 +112,12 @@ eoParser::eoParser ( unsigned _argc, char **_argv , string _programDescription, } +std::string eoParser::get( const std::string & name) const +{ + return getParamWithLongName( name )->getValue(); +} + + eoParam * eoParser::getParamWithLongName(const std::string& _name) const { typedef std::multimap MultiMapType; diff --git a/eo/src/utils/eoParser.h b/eo/src/utils/eoParser.h index 0088ff4f..48b18e91 100644 --- a/eo/src/utils/eoParser.h +++ b/eo/src/utils/eoParser.h @@ -156,6 +156,10 @@ public: virtual bool isItThere(eoParam& _param) const { return getValue(_param).first; } + + std::string get( const std::string & name) const; + + /** * get a handle on a param from its longName * From 59448b9635a1cb4e0dcc659c69935a0193cb7d7e Mon Sep 17 00:00:00 2001 From: nojhan Date: Tue, 4 Oct 2011 21:43:53 +0200 Subject: [PATCH 15/15] more doc on the parser format --- eo/src/utils/eoParser.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/eo/src/utils/eoParser.h b/eo/src/utils/eoParser.h index 48b18e91..e65f7566 100644 --- a/eo/src/utils/eoParser.h +++ b/eo/src/utils/eoParser.h @@ -97,6 +97,11 @@ private : This class is persistent, so it can be stored and reloaded to restore parameter settings. + Parameters can be read from argv, strings or streams, and must be specified + using the following convention: --name=value or -n=value + + You should not use space as a separator between the parameter and its value. + @ingroup Parameters */ class eoParser : public eoParameterLoader, public eoObject, public eoPersistent