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:
parent
91f5ddbdaa
commit
29ea368191
1 changed files with 82 additions and 71 deletions
|
|
@ -49,18 +49,22 @@ to the population.
|
|||
template<class EOT>
|
||||
class eoPop: public vector<EOT>, public eoObject, public eoPersistent {
|
||||
|
||||
/// Type is the type of each gene in the chromosome
|
||||
#ifdef _MSC_VER
|
||||
/*
|
||||
Victor Rivas (vrivas@ujaen.es): 15-Dec-1999
|
||||
An EO can have NO genes.
|
||||
/// Type is the type of each gene in the chromosome
|
||||
#ifdef _MSC_VER
|
||||
typedef EOT::Type Type;
|
||||
#else
|
||||
#else
|
||||
typedef typename EOT::Type Type;
|
||||
#endif
|
||||
#endif
|
||||
*/
|
||||
|
||||
public:
|
||||
public:
|
||||
/** Protected ctor. This is intended to avoid creation of void populations, except
|
||||
from sibling classes
|
||||
*/
|
||||
eoPop() :vector<EOT>() {};
|
||||
eoPop():vector<EOT>() {};
|
||||
|
||||
|
||||
/** Ctor for fixed-size chromosomes, with variable content
|
||||
|
|
@ -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 _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 )
|
||||
:vector<EOT>() {
|
||||
for ( unsigned i = 0; i < _popSize; i ++ ){
|
||||
|
|
@ -75,12 +82,16 @@ class eoPop: public vector<EOT>, public eoObject, public eoPersistent {
|
|||
push_back( tmpEOT );
|
||||
}
|
||||
};
|
||||
*/
|
||||
|
||||
/** Ctor for variable-size chromosomes, with variable content
|
||||
@param _popSize total population size
|
||||
@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
|
||||
*/
|
||||
/*
|
||||
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 )
|
||||
:vector<EOT>() {
|
||||
for ( unsigned i = 0; i < _popSize; i ++ ){
|
||||
|
|
@ -89,7 +100,7 @@ class eoPop: public vector<EOT>, public eoObject, public eoPersistent {
|
|||
push_back( tmpEOT );
|
||||
}
|
||||
};
|
||||
|
||||
*/
|
||||
/** Ctor from an istream; reads the population from a stream,
|
||||
each element should be in different lines
|
||||
@param _is the stream
|
||||
|
|
@ -138,7 +149,7 @@ class eoPop: public vector<EOT>, public eoObject, public eoPersistent {
|
|||
virtual string className() const {return "eoPop";};
|
||||
//@}
|
||||
|
||||
protected:
|
||||
protected:
|
||||
|
||||
};
|
||||
#endif
|
||||
|
|
|
|||
Reference in a new issue