A few minor corrections (and some comments) after Maarten big commit

This commit is contained in:
evomarc 2001-02-15 04:47:18 +00:00
commit bf0e84fc56
5 changed files with 15 additions and 11 deletions

View file

@ -48,6 +48,8 @@ the original population, is an instantiation of the next population and
has often a selection function embedded in it to select new individuals. has often a selection function embedded in it to select new individuals.
Note that the actual work is performed in the apply function. Note that the actual work is performed in the apply function.
AND that the apply function is responsible for invalidating
the object if necessary
*/ */
template <class EOT> template <class EOT>
class eoGenOp : public eoOp<EOT>, public eoUF<eoPopulator<EOT> &, void> class eoGenOp : public eoOp<EOT>, public eoUF<eoPopulator<EOT> &, void>

View file

@ -37,6 +37,9 @@ the return type of the operator and invalidate the fitness of the individual.
This functor is used in algorithms that work with straight eoMonOp, eoBinOp This functor is used in algorithms that work with straight eoMonOp, eoBinOp
or eoQuadOp operators, for instance eoSGA. Note that eoGenOp derived operators or eoQuadOp operators, for instance eoSGA. Note that eoGenOp derived operators
generally do invalidate the fitness of the objects they have changed. generally do invalidate the fitness of the objects they have changed.
Return value means "Has_Changed" and not "Needs_To_Be_Invalidated"
as successive invalidation are not really a problem
*/ */
template <class EOT> template <class EOT>
@ -68,6 +71,9 @@ the return type of the operator and invalidate the fitness of the individual.
This functor is used in algorithms that work with straight eoMonOp, eoBinOp This functor is used in algorithms that work with straight eoMonOp, eoBinOp
or eoQuadOp operators, for instance eoSGA. Note that eoGenOp derived operators or eoQuadOp operators, for instance eoSGA. Note that eoGenOp derived operators
generally do invalidate the fitness of the objects they have changed. generally do invalidate the fitness of the objects they have changed.
Return value means "Has_Changed" and not "Needs_To_Be_Invalidated"
as successive invalidation are not really a problem
*/ */
template <class EOT> template <class EOT>
@ -99,6 +105,9 @@ the return type of the operator and invalidate the fitness of the individual.
This functor is used in algorithms that work with straight eoMonOp, eoBinOp This functor is used in algorithms that work with straight eoMonOp, eoBinOp
or eoQuadOp operators, for instance eoSGA. Note that eoGenOp derived operators or eoQuadOp operators, for instance eoSGA. Note that eoGenOp derived operators
generally do invalidate the fitness of the objects they have changed. generally do invalidate the fitness of the objects they have changed.
Return value means "Has_Changed" and not "Needs_To_Be_Invalidated"
as successive invalidation are not really a problem
*/ */
template <class EOT> template <class EOT>

View file

@ -205,6 +205,6 @@ std::vector<double> rates;
}; };
// for General Ops, it's another story - // for General Ops, it's another story - see eoOpCOntainer
#endif #endif

View file

@ -84,9 +84,9 @@ template<class EOT> class eoSGATransform : public eoTransform<EOT>
}; };
private: private:
eoQuadOp<EOT>& cross; eoInvalidateQuadOp<EOT> cross;
double crossoverProba; double crossoverProba;
eoMonOp<EOT>& mutate; eoInvalidateMonOp<EOT> mutate;
double mutationProba; double mutationProba;
}; };

View file

@ -55,14 +55,7 @@ public :
bool objectChanged = objectXOver(_eo1, _eo2); // as vector<double> bool objectChanged = objectXOver(_eo1, _eo2); // as vector<double>
bool stdDevChanged = stdDevXOver(_eo1.stdevs, _eo2.stdevs); bool stdDevChanged = stdDevXOver(_eo1.stdevs, _eo2.stdevs);
/// Marc, I didn't change it, but if only the stdev has changed, return objectChanged;
/// doesn't that mean that the fitness is stil valid. Maarten
if ( objectChanged || stdDevChanged )
{
return true;
}
return false;
} }
private: private: