renamed "globalBest" parameter in "globalBest" function ...
This commit is contained in:
parent
5cbbe83a0e
commit
e8883486f6
2 changed files with 8 additions and 8 deletions
|
|
@ -169,15 +169,15 @@ public:
|
||||||
virtual POT & globalBest(const eoPop<POT>& _pop)
|
virtual POT & globalBest(const eoPop<POT>& _pop)
|
||||||
{
|
{
|
||||||
unsigned howManyNeighborhood=_pop.size()/ neighborhoodSize;
|
unsigned howManyNeighborhood=_pop.size()/ neighborhoodSize;
|
||||||
POT globalBest,tmp;
|
POT gBest,tmp;
|
||||||
unsigned indGlobalBest=0;
|
unsigned indGlobalBest=0;
|
||||||
globalBest=neighborhoods[0].best();
|
gBest=neighborhoods[0].best();
|
||||||
for(unsigned i=1;i<howManyNeighborhood;i++)
|
for(unsigned i=1;i<howManyNeighborhood;i++)
|
||||||
{
|
{
|
||||||
tmp=neighborhoods[i].best();
|
tmp=neighborhoods[i].best();
|
||||||
if(globalBest.best() < tmp.best())
|
if(gBest.best() < tmp.best())
|
||||||
{
|
{
|
||||||
globalBest=tmp;
|
gBest=tmp;
|
||||||
indGlobalBest=i;
|
indGlobalBest=i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -74,15 +74,15 @@ public:
|
||||||
*/
|
*/
|
||||||
virtual POT & globalBest(const eoPop<POT>& _pop)
|
virtual POT & globalBest(const eoPop<POT>& _pop)
|
||||||
{
|
{
|
||||||
POT globalBest,tmp;
|
POT gBest,tmp;
|
||||||
unsigned indGlobalBest=0;
|
unsigned indGlobalBest=0;
|
||||||
globalBest=best(0);
|
gBest=best(0);
|
||||||
for(unsigned i=1;i<_pop.size();i++)
|
for(unsigned i=1;i<_pop.size();i++)
|
||||||
{
|
{
|
||||||
tmp=best(i);
|
tmp=best(i);
|
||||||
if(globalBest.best() < tmp.best())
|
if(gBest.best() < tmp.best())
|
||||||
{
|
{
|
||||||
globalBest=tmp;
|
gBest=tmp;
|
||||||
indGlobalBest=i;
|
indGlobalBest=i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Reference in a new issue