Correction of the invalid fitness in moPopSol* (not in the 1.3beat version)
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@2042 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
a2c451dd3d
commit
ae73cb71ff
2 changed files with 14 additions and 3 deletions
|
|
@ -41,11 +41,20 @@ public:
|
||||||
typedef typename EO<double>::Fitness Fitness;
|
typedef typename EO<double>::Fitness Fitness;
|
||||||
using EO<double>::invalidate;
|
using EO<double>::invalidate;
|
||||||
|
|
||||||
|
moPopSol(): EO<double>() {
|
||||||
|
}
|
||||||
|
|
||||||
virtual void printOn(std::ostream& _os) const
|
virtual void printOn(std::ostream& _os) const
|
||||||
{
|
{
|
||||||
_os << (*this).size() << " " << (*this).fitness() << '\n';
|
if (this->invalid()) {
|
||||||
for(unsigned int i=0; i<(*this).size(); i++)
|
_os << (*this).size() << " " << "INVALID" << '\n';
|
||||||
_os << (*this).operator[](i) << std::endl;
|
for(unsigned int i=0; i<(*this).size(); i++)
|
||||||
|
_os << (*this).operator[](i) << std::endl;
|
||||||
|
} else {
|
||||||
|
_os << (*this).size() << " " << (*this).fitness() << '\n';
|
||||||
|
for(unsigned int i=0; i<(*this).size(); i++)
|
||||||
|
_os << (*this).operator[](i) << std::endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -55,6 +55,8 @@ public:
|
||||||
rnd(tmp);
|
rnd(tmp);
|
||||||
_sol.push_back(tmp);
|
_sol.push_back(tmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_sol.invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue