diff --git a/trunk/paradiseo-mo/src/problems/bitString/moPopSol.h b/trunk/paradiseo-mo/src/problems/bitString/moPopSol.h index 4fa346980..4ffc7bceb 100644 --- a/trunk/paradiseo-mo/src/problems/bitString/moPopSol.h +++ b/trunk/paradiseo-mo/src/problems/bitString/moPopSol.h @@ -41,11 +41,20 @@ public: typedef typename EO::Fitness Fitness; using EO::invalidate; + moPopSol(): EO() { + } + virtual void printOn(std::ostream& _os) const { - _os << (*this).size() << " " << (*this).fitness() << '\n'; - for(unsigned int i=0; i<(*this).size(); i++) - _os << (*this).operator[](i) << std::endl; + if (this->invalid()) { + _os << (*this).size() << " " << "INVALID" << '\n'; + 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; + } } }; diff --git a/trunk/paradiseo-mo/src/problems/bitString/moPopSolInit.h b/trunk/paradiseo-mo/src/problems/bitString/moPopSolInit.h index 4b6cdddb6..6e246cba1 100644 --- a/trunk/paradiseo-mo/src/problems/bitString/moPopSolInit.h +++ b/trunk/paradiseo-mo/src/problems/bitString/moPopSolInit.h @@ -55,6 +55,8 @@ public: rnd(tmp); _sol.push_back(tmp); } + + _sol.invalidate(); } private: