From da4118142f53e7e2cd06a611575eb3f932d13e4a Mon Sep 17 00:00:00 2001 From: nojhan Date: Fri, 9 Oct 2020 13:33:43 +0200 Subject: [PATCH] add some missing className --- eo/src/eoRandomSelect.h | 8 ++++++++ eo/src/ga/eoStandardBitMutation.h | 12 ++++++++++++ 2 files changed, 20 insertions(+) diff --git a/eo/src/eoRandomSelect.h b/eo/src/eoRandomSelect.h index 1b15bbffa..4fd4dbb18 100644 --- a/eo/src/eoRandomSelect.h +++ b/eo/src/eoRandomSelect.h @@ -48,6 +48,9 @@ template class eoRandomSelect: public eoSelectOne { return _pop[eo::rng.random(_pop.size())] ; } + + virtual std::string className() const {return "eoRandomSelect";} + }; /** eoBestSelect: a selection method that always return the best @@ -64,6 +67,8 @@ template class eoBestSelect: public eoSelectOne { return _pop.best_element() ; } + + virtual std::string className() const {return "eoBestSelect";} }; /** eoNoSelect: returns all individual in order WITHOUT USING FITNESS!!! @@ -86,6 +91,9 @@ template class eoNoSelect: public eoSelectOne current++; return _pop[current-1] ; } + + virtual std::string className() const {return "eoNoSelect";} + private: unsigned current; }; diff --git a/eo/src/ga/eoStandardBitMutation.h b/eo/src/ga/eoStandardBitMutation.h index 50ad7873e..a2f7f12aa 100644 --- a/eo/src/ga/eoStandardBitMutation.h +++ b/eo/src/ga/eoStandardBitMutation.h @@ -28,6 +28,8 @@ class eoStandardBitMutation : public eoMonOp return _bitflip(chrom); } + virtual std::string className() const {return "eoStandardBitMutation";} + protected: double _rate; unsigned _nb; @@ -58,6 +60,8 @@ class eoUniformBitMutation : public eoMonOp return _bitflip(chrom); } + virtual std::string className() const {return "eoUniformBitMutation";} + protected: double _rate; unsigned _nb; @@ -93,6 +97,8 @@ class eoConditionalBitMutation : public eoStandardBitMutation // thus one don't need to re-instantiate. return this->_bitflip(chrom); } + + virtual std::string className() const {return "eoConditionalBitMutation";} }; /** Shifted standard bit mutation with mutation rate p: @@ -125,6 +131,8 @@ class eoShiftedBitMutation : public eoStandardBitMutation // thus one don't need to re-instantiate. return this->_bitflip(chrom); } + + virtual std::string className() const {return "eoShiftedBitMutation";} }; /** Mutation which size is sample in a gaussian. @@ -163,6 +171,8 @@ class eoNormalBitMutation : public eoStandardBitMutation return this->_bitflip(chrom); } + virtual std::string className() const {return "eoNormalBitMutation";} + protected: double _variance; }; @@ -196,6 +206,8 @@ class eoFastBitMutation : public eoStandardBitMutation return this->_bitflip(chrom); } + virtual std::string className() const {return "eoFastBitMutation";} + protected: double powerlaw(unsigned n, double beta)