Skip to content

Commit

Permalink
revert 399b222 (virtual fitness interface temptative)
Browse files Browse the repository at this point in the history
Incompatible with MOEO's change of interface.
  • Loading branch information
nojhan authored and jdreo committed Apr 8, 2024
1 parent f30240c commit e643468
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions eo/src/EO.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ template<class F = double> class EO: public eoObject, public eoPersistent
virtual ~EO() {};

/// Return fitness value.
virtual const Fitness& fitness() const {
// virtual const Fitness& fitness() const { // This would be impossible with MOEO.
// virtual Fitness fitness() const { // Cannot do that either, MOEO changes the interface.
Fitness fitness() const {
if (invalid())
throw eoInvalidFitnessError("Cannot retrieve unevaluated fitness");
return repFitness;
Expand All @@ -91,7 +93,7 @@ template<class F = double> class EO: public eoObject, public eoPersistent
/** Set fitness. At the same time, validates it.
* @param _fitness New fitness value.
*/
virtual void fitness(const Fitness& _fitness)
void fitness(const Fitness& _fitness)
{
repFitness = _fitness;
invalidFitness = false;
Expand Down

0 comments on commit e643468

Please sign in to comment.