Added reinitialization of fitness when fitness is invalidated. Needed this to clear worths in multi-objective case
This commit is contained in:
parent
f93327a041
commit
98f763466a
1 changed files with 2 additions and 2 deletions
|
|
@ -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.
|
||||||
|
|
|
||||||
Reference in a new issue