fixing bugs in replacers and moving some code between files
This commit is contained in:
parent
265c5671bf
commit
bc9638f53c
7 changed files with 89 additions and 103 deletions
|
|
@ -97,44 +97,5 @@ class eoSelect: public eoObject{
|
|||
|
||||
};
|
||||
|
||||
/** eoMerge involves three populations, that can be merged and transformed to
|
||||
give a third
|
||||
*/
|
||||
template<class EOT>
|
||||
class eoMerge: public eoObject{
|
||||
|
||||
public:
|
||||
/// (Default) Constructor.
|
||||
eoMerge(const float& _rate = 1.0): rep_rate(_rate) {}
|
||||
|
||||
/// Dtor
|
||||
virtual ~eoMerge() {}
|
||||
|
||||
/** Pure virtual transformation function. Extracts something from breeders
|
||||
* and transfers it to the pop
|
||||
* @param breeders Tranformed individuals.
|
||||
* @param pop The original population at the begining, the result at the end
|
||||
*/
|
||||
virtual void operator () ( const eoPop<EOT>& breeders, eoPop<EOT>& pop ) = 0;
|
||||
|
||||
/** @name Methods from eoObject */
|
||||
//@{
|
||||
/** readFrom and printOn are not overriden
|
||||
*/
|
||||
/** Inherited from eoObject. Returns the class name.
|
||||
@see eoObject
|
||||
*/
|
||||
string className() const {return "eoMerge";};
|
||||
//@}
|
||||
|
||||
/// Return the rate to be selected from the original population
|
||||
float rate() const { return rep_rate; }
|
||||
|
||||
/// Set the rate to be obtained after replacement.
|
||||
/// @param _rate The rate.
|
||||
void rate(const float& _rate) { rep_rate = _rate; }
|
||||
|
||||
private:
|
||||
float rep_rate;
|
||||
};
|
||||
#endif
|
||||
|
|
|
|||
Reference in a new issue