I have turned into comments the Pop constructor that used Type as the type of the gene, given that an EO can have NO genes

This commit is contained in:
victor 1999-12-15 13:57:09 +00:00
commit 29ea368191

View file

@ -49,12 +49,16 @@ to the population.
template<class EOT> template<class EOT>
class eoPop: public vector<EOT>, public eoObject, public eoPersistent { class eoPop: public vector<EOT>, public eoObject, public eoPersistent {
/*
Victor Rivas (vrivas@ujaen.es): 15-Dec-1999
An EO can have NO genes.
/// Type is the type of each gene in the chromosome /// Type is the type of each gene in the chromosome
#ifdef _MSC_VER #ifdef _MSC_VER
typedef EOT::Type Type; typedef EOT::Type Type;
#else #else
typedef typename EOT::Type Type; typedef typename EOT::Type Type;
#endif #endif
*/
public: public:
/** Protected ctor. This is intended to avoid creation of void populations, except /** Protected ctor. This is intended to avoid creation of void populations, except
@ -68,6 +72,9 @@ class eoPop: public vector<EOT>, public eoObject, public eoPersistent {
@param _eoSize chromosome size. EOT should accept a fixed-size ctor @param _eoSize chromosome size. EOT should accept a fixed-size ctor
@param _geneRdn random number generator for each of the genes @param _geneRdn random number generator for each of the genes
*/ */
/*
Victor Rivas (vrivas@ujaen.es): 15-Dec-1999
This constructor must be substitued by one using factories.
eoPop( unsigned _popSize, unsigned _eoSize, eoRnd<Type> & _geneRnd ) eoPop( unsigned _popSize, unsigned _eoSize, eoRnd<Type> & _geneRnd )
:vector<EOT>() { :vector<EOT>() {
for ( unsigned i = 0; i < _popSize; i ++ ){ for ( unsigned i = 0; i < _popSize; i ++ ){
@ -75,12 +82,16 @@ class eoPop: public vector<EOT>, public eoObject, public eoPersistent {
push_back( tmpEOT ); push_back( tmpEOT );
} }
}; };
*/
/** Ctor for variable-size chromosomes, with variable content /** Ctor for variable-size chromosomes, with variable content
@param _popSize total population size @param _popSize total population size
@param _sizeRnd RNG for the chromosome size. This will be added 1, just in case. @param _sizeRnd RNG for the chromosome size. This will be added 1, just in case.
@param _geneRdn random number generator for each of the genes @param _geneRdn random number generator for each of the genes
*/ */
/*
Victor Rivas (vrivas@ujaen.es): 15-Dec-1999
This constructor must be substitued by one using factories.
eoPop( unsigned _popSize, eoRnd<unsigned> & _sizeRnd, eoRnd<Type> & _geneRnd ) eoPop( unsigned _popSize, eoRnd<unsigned> & _sizeRnd, eoRnd<Type> & _geneRnd )
:vector<EOT>() { :vector<EOT>() {
for ( unsigned i = 0; i < _popSize; i ++ ){ for ( unsigned i = 0; i < _popSize; i ++ ){
@ -89,7 +100,7 @@ class eoPop: public vector<EOT>, public eoObject, public eoPersistent {
push_back( tmpEOT ); push_back( tmpEOT );
} }
}; };
*/
/** Ctor from an istream; reads the population from a stream, /** Ctor from an istream; reads the population from a stream,
each element should be in different lines each element should be in different lines
@param _is the stream @param _is the stream