diff --git a/eo/src/eoPop.h b/eo/src/eoPop.h index 79aa01e0..42f087aa 100644 --- a/eo/src/eoPop.h +++ b/eo/src/eoPop.h @@ -132,6 +132,16 @@ class eoPop: public vector, public eoObject, public eoPersistent std::sort(begin(), end(), greater()); } + /** + shuffle the population. Use this member to put the population + in random order + */ + void shuffle(void) + { + UF_random_generator gen; + std::random_shuffle(begin(), end(), gen); + } + // creates a vector pointing to the individuals in descending order void sort(vector& result) const {