cleanup
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1720 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
ea81cb7f3d
commit
4d5b8db81e
23 changed files with 44 additions and 62 deletions
|
|
@ -67,20 +67,20 @@ class moeoDetArchiveSelect : public eoSelect<MOEOT>
|
|||
unsigned int archive_size = archive.size();
|
||||
_dest.resize(0);
|
||||
if ((archive_size >= min) && (archive_size <= max)){
|
||||
for (int i=0; i<archive_size; i++)
|
||||
for (unsigned int i=0; i<archive_size; i++)
|
||||
_dest.push_back(archive[i]);
|
||||
}
|
||||
else if (archive_size > max){
|
||||
UF_random_generator<unsigned int> rndGen;
|
||||
std::vector <int> permutation;
|
||||
for(int i=0; i < archive_size; i++)
|
||||
for(unsigned int i=0; i < archive_size; i++)
|
||||
permutation.push_back(i);
|
||||
random_shuffle(permutation.begin(), permutation.end(), rndGen);
|
||||
for (int i=0; i<max; i++)
|
||||
for (unsigned int i=0; i<max; i++)
|
||||
_dest.push_back(archive[permutation[i]]);
|
||||
}
|
||||
else {
|
||||
for (int i=0; i<min; i++){
|
||||
for (unsigned int i=0; i<min; i++){
|
||||
_dest.push_back(archive[i%archive_size]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue