update the use of comparator
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@326 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
303662d978
commit
59395e0352
1 changed files with 2 additions and 5 deletions
|
|
@ -24,14 +24,11 @@ It mo_deterministic_tournament(It _begin, It _end, unsigned _t_size,moeoComparat
|
||||||
for (unsigned i = 0; i < _t_size - 1; ++i)
|
for (unsigned i = 0; i < _t_size - 1; ++i)
|
||||||
{
|
{
|
||||||
It competitor = _begin + _gen.random(_end - _begin);
|
It competitor = _begin + _gen.random(_end - _begin);
|
||||||
|
|
||||||
// compare the two individuals by using the comparator
|
// compare the two individuals by using the comparator
|
||||||
if (_comparator(*best,*competitor))
|
if (_comparator(*best, *competitor))
|
||||||
|
|
||||||
// best "better" than competitor
|
// best "better" than competitor
|
||||||
best=competitor;
|
best=competitor;
|
||||||
}
|
}
|
||||||
|
|
||||||
return best;
|
return best;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -58,7 +55,7 @@ It mo_stochastic_tournament(It _begin, It _end, double _t_rate,moeoComparator<MO
|
||||||
|
|
||||||
bool return_better = _gen.flip(_t_rate);
|
bool return_better = _gen.flip(_t_rate);
|
||||||
|
|
||||||
if (_comparator(*i1 , *i2))
|
if (_comparator(*i1, *i2))
|
||||||
{
|
{
|
||||||
if (return_better) return i2;
|
if (return_better) return i2;
|
||||||
// else
|
// else
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue