Added reinitialization of fitness when fitness is invalidated. Needed this to clear worths in multi-objective case

This commit is contained in:
maartenkeijzer 2007-09-04 07:47:46 +00:00
commit 98f763466a

View file

@ -41,7 +41,7 @@
be minimized with a proper definition of the < operator. The fitness be minimized with a proper definition of the < operator. The fitness
object must have, besides an void ctor, a copy ctor. object must have, besides an void ctor, a copy ctor.
*/ */
template<class F> class EO: public eoObject, public eoPersistent template<class F = double> class EO: public eoObject, public eoPersistent
{ {
public: public:
typedef F Fitness; typedef F Fitness;
@ -64,7 +64,7 @@ public:
} }
// Set fitness as invalid. // Set fitness as invalid.
void invalidate() { invalidFitness = true; } void invalidate() { invalidFitness = true; repFitness = Fitness(); }
/** Set fitness. At the same time, validates it. /** Set fitness. At the same time, validates it.
* @param _fitness New fitness value. * @param _fitness New fitness value.