warning deleted
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1372 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
913a21fab3
commit
0ef9dab410
5 changed files with 74 additions and 68 deletions
|
|
@ -129,7 +129,7 @@ public:
|
|||
/**
|
||||
* Ctor with a crossover, a mutation and their corresponding rates.
|
||||
* @param _continuator stopping criteria
|
||||
popEval * @param _eval evaluation function
|
||||
* @param _eval evaluation function
|
||||
* @param _op general operator
|
||||
* @param _archive archive
|
||||
* @param _k the k-ieme distance used to fixe diversity
|
||||
|
|
@ -218,19 +218,21 @@ public:
|
|||
protected:
|
||||
|
||||
/** dummy evaluation */
|
||||
class eoDummyEval : public eoEvalFunc< MOEOT >
|
||||
class eoDummyEval : public eoEvalFunc< MOEOT >
|
||||
{
|
||||
public:
|
||||
void operator()(MOEOT &) {}
|
||||
}
|
||||
dummyEval;
|
||||
|
||||
/** dummy transform */
|
||||
class eoDummyTransform : public eoTransform<MOEOT>
|
||||
class eoDummyTransform : public eoTransform<MOEOT>
|
||||
{
|
||||
public :
|
||||
void operator()(eoPop<MOEOT>&) {}
|
||||
}
|
||||
dummyTransform;
|
||||
|
||||
/** a continuator based on the number of generations (used as default) */
|
||||
eoGenContinue < MOEOT > defaultGenContinuator;
|
||||
/** stopping criteria */
|
||||
|
|
@ -243,31 +245,31 @@ class eoDummyTransform : public eoTransform<MOEOT>
|
|||
eoPopEvalFunc < MOEOT > & popEval;
|
||||
/**archive*/
|
||||
moeoArchive < MOEOT >& archive;
|
||||
/** selectMany */
|
||||
eoSelectMany <MOEOT> selectMany;
|
||||
/** select Transform*/
|
||||
eoSelectTransform <MOEOT> selectTransform;
|
||||
/**SelectOne*/
|
||||
moeoDetTournamentSelect < MOEOT > defaultSelect;
|
||||
/** binary tournament selection */
|
||||
moeoSelectFromPopAndArch < MOEOT > select;
|
||||
/** a default mutation */
|
||||
eoMonCloneOp < MOEOT > defaultMonOp;
|
||||
/** a default crossover */
|
||||
eoQuadCloneOp < MOEOT > defaultQuadOp;
|
||||
/** an object for genetic operators (used as default) */
|
||||
eoSGAGenOp < MOEOT > defaultSGAGenOp;
|
||||
/** fitness assignment used in NSGA-II */
|
||||
moeoDominanceCountRankingFitnessAssignment < MOEOT > fitnessAssignment;
|
||||
/** general breeder */
|
||||
eoGeneralBreeder < MOEOT > genBreed;
|
||||
/** selectMany */
|
||||
eoSelectMany <MOEOT> selectMany;
|
||||
/** select Transform*/
|
||||
eoSelectTransform <MOEOT> selectTransform;
|
||||
/** breeder */
|
||||
eoBreed < MOEOT > & breed;
|
||||
/** diversity assignment used in NSGA-II */
|
||||
moeoNearestNeighborDiversityAssignment < MOEOT > diversityAssignment;
|
||||
/** elitist replacement */
|
||||
moeoGenerationalReplacement < MOEOT > replace;
|
||||
/** a default crossover */
|
||||
eoQuadCloneOp < MOEOT > defaultQuadOp;
|
||||
/** a default mutation */
|
||||
eoMonCloneOp < MOEOT > defaultMonOp;
|
||||
/** an object for genetic operators (used as default) */
|
||||
eoSGAGenOp < MOEOT > defaultSGAGenOp;
|
||||
/** general breeder */
|
||||
eoGeneralBreeder < MOEOT > genBreed;
|
||||
/** breeder */
|
||||
eoBreed < MOEOT > & breed;
|
||||
/**distance*/
|
||||
/**distance*/
|
||||
moeoEuclideanDistance < MOEOT > dist;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ public:
|
|||
*/
|
||||
typedef typename MOEOT::ObjectiveVector ObjectiveVector;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Ctor where you can choose your own moeoComparator, moeoObjectiveVectorComparator, moeoFitnessAssignment, moeoDiversityAssignment and archive size.
|
||||
* @param _indiComparator the functor used to compare MOEOT
|
||||
|
|
@ -82,7 +82,7 @@ public:
|
|||
*/
|
||||
moeoBoundedArchive(moeoComparator < MOEOT > & _indiComparator, moeoObjectiveVectorComparator < ObjectiveVector > & _comparator, moeoFitnessAssignment < MOEOT > & _fitness, moeoDiversityAssignment < MOEOT > & _diversity, unsigned int _maxSize=100) : moeoArchive < MOEOT >(_comparator), maxSize(_maxSize), indiComparator(_indiComparator), fitness(_fitness), diversity(_diversity)
|
||||
{}
|
||||
|
||||
|
||||
/**
|
||||
* Ctor with moeoParetoObjectiveVectorComparator where you can choose your own moeoComparator, moeoFitnessAssignment, moeoDiversityAssignment and archive size.
|
||||
* @param _indiComparator the functor used to compare MOEOT
|
||||
|
|
@ -92,8 +92,8 @@ public:
|
|||
*/
|
||||
moeoBoundedArchive(moeoComparator < MOEOT > & _indiComparator, moeoFitnessAssignment < MOEOT > & _fitness, moeoDiversityAssignment < MOEOT > & _diversity, unsigned int _maxSize=100) : moeoArchive < MOEOT >(), maxSize(_maxSize), indiComparator(_indiComparator), fitness(_fitness), diversity(_diversity)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -103,7 +103,7 @@ public:
|
|||
void operator()(const MOEOT & _moeo)
|
||||
{
|
||||
update(_moeo);
|
||||
|
||||
|
||||
if(size() > maxSize){
|
||||
fitness(*this);
|
||||
diversity(*this);
|
||||
|
|
@ -120,7 +120,7 @@ public:
|
|||
void operator()(const eoPop < MOEOT > & _pop)
|
||||
{
|
||||
update(_pop);
|
||||
|
||||
|
||||
if(size() > maxSize){
|
||||
fitness(*this);
|
||||
diversity(*this);
|
||||
|
|
@ -133,11 +133,6 @@ private:
|
|||
|
||||
/** archive max size */
|
||||
unsigned int maxSize;
|
||||
/** fitness assignment */
|
||||
moeoFitnessAssignment < MOEOT > & fitness;
|
||||
/** diversity assignment */
|
||||
moeoDiversityAssignment < MOEOT > & diversity;
|
||||
|
||||
/**
|
||||
* Wrapper which allow to used an moeoComparator in std::sort
|
||||
* @param _comp the comparator to used
|
||||
|
|
@ -164,7 +159,12 @@ private:
|
|||
moeoComparator < MOEOT > & comp;
|
||||
}
|
||||
indiComparator;
|
||||
|
||||
|
||||
/** fitness assignment */
|
||||
moeoFitnessAssignment < MOEOT > & fitness;
|
||||
/** diversity assignment */
|
||||
moeoDiversityAssignment < MOEOT > & diversity;
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif /*MOEOBOUNDEDARCHIVE_H_*/
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ public:
|
|||
{}
|
||||
|
||||
|
||||
/**
|
||||
/**l
|
||||
* Ctor where you can choose your own moeoDistance
|
||||
* @param _dist the distance used
|
||||
* @param _maxSize the size of archive (must be smaller or egal to the population size)
|
||||
|
|
@ -285,6 +285,32 @@ private:
|
|||
unsigned int maxSize;
|
||||
/** archive size */
|
||||
unsigned int borne;
|
||||
/**
|
||||
* Wrapper which allow to used an moeoComparator in std::sort
|
||||
* @param _comp the comparator to used
|
||||
*/
|
||||
class Wrapper
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Ctor.
|
||||
* @param _comp the comparator
|
||||
*/
|
||||
Wrapper(moeoComparator < MOEOT > & _comp) : comp(_comp) {}
|
||||
/**
|
||||
* Returns true if _moeo1 is greater than _moeo2 according to the comparator
|
||||
* _moeo1 the first individual
|
||||
* _moeo2 the first individual
|
||||
*/
|
||||
bool operator()(const MOEOT & _moeo1, const MOEOT & _moeo2)
|
||||
{
|
||||
return comp(_moeo1,_moeo2);
|
||||
}
|
||||
private:
|
||||
/** the comparator */
|
||||
moeoComparator < MOEOT > & comp;
|
||||
}
|
||||
indiComparator;
|
||||
/** default moeoComparator*/
|
||||
moeoFitnessThenDiversityComparator < MOEOT > defaultComparator;
|
||||
/** distance */
|
||||
|
|
@ -352,33 +378,6 @@ private:
|
|||
};
|
||||
|
||||
|
||||
/**
|
||||
* Wrapper which allow to used an moeoComparator in std::sort
|
||||
* @param _comp the comparator to used
|
||||
*/
|
||||
class Wrapper
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Ctor.
|
||||
* @param _comp the comparator
|
||||
*/
|
||||
Wrapper(moeoComparator < MOEOT > & _comp) : comp(_comp) {}
|
||||
/**
|
||||
* Returns true if _moeo1 is greater than _moeo2 according to the comparator
|
||||
* _moeo1 the first individual
|
||||
* _moeo2 the first individual
|
||||
*/
|
||||
bool operator()(const MOEOT & _moeo1, const MOEOT & _moeo2)
|
||||
{
|
||||
return comp(_moeo1,_moeo2);
|
||||
}
|
||||
private:
|
||||
/** the comparator */
|
||||
moeoComparator < MOEOT > & comp;
|
||||
}
|
||||
indiComparator;
|
||||
|
||||
};
|
||||
|
||||
#endif /*MOEOSPEA2ARCHIVE_H_*/
|
||||
|
|
|
|||
|
|
@ -346,10 +346,12 @@ class moeoHyperVolumeMetric : public moeoVectorUnaryMetric < ObjectiveVector , d
|
|||
|
||||
double rho;
|
||||
|
||||
ObjectiveVector ref_point;
|
||||
|
||||
/*vectors contains bounds for normalization*/
|
||||
std::vector < eoRealInterval > bounds;
|
||||
|
||||
ObjectiveVector ref_point;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -59,18 +59,20 @@ public:
|
|||
/** The type for objective vector */
|
||||
typedef typename MOEOT::ObjectiveVector ObjectiveVector;
|
||||
|
||||
/**
|
||||
* Constructor which allow to choose the comparator
|
||||
* @param _nocopy boolean allow to consider copy and doublons as bad element whose were dominated by all other MOEOT
|
||||
* @param _comparator the comparator you want to use for the comparaison of two MOEOT
|
||||
*/
|
||||
moeoDominanceMatrix(moeoObjectiveVectorComparator < ObjectiveVector > & _comparator, bool _nocopy=true):std::vector < std::vector<bool> >(),comparator(_comparator), nocopy(_nocopy) {}
|
||||
|
||||
/**
|
||||
* Default constructor with paretoComparator
|
||||
* @param _nocopy boolean allow to consider copy and doublons as bad element whose were dominated by all other MOEOT
|
||||
*/
|
||||
moeoDominanceMatrix(bool _nocopy=false):std::vector < std::vector<bool> >(),comparator(paretoComparator), nocopy(_nocopy) {}
|
||||
|
||||
/**
|
||||
* Constructor which allow to choose the comparator
|
||||
* @param _nocopy boolean allow to consider copy and doublons as bad element whose were dominated by all other MOEOT
|
||||
* @param _comparator the comparator you want to use for the comparaison of two MOEOT
|
||||
*/
|
||||
moeoDominanceMatrix(moeoObjectiveVectorComparator < ObjectiveVector > & _comparator, bool _nocopy=true):std::vector < std::vector<bool> >(),comparator(_comparator), nocopy(_nocopy) {}
|
||||
|
||||
|
||||
/**
|
||||
* Filling up the Dominance Matrix on one population
|
||||
|
|
@ -214,6 +216,10 @@ public:
|
|||
}
|
||||
|
||||
private:
|
||||
/** Functor to compare two objective vectors */
|
||||
moeoObjectiveVectorComparator < ObjectiveVector > & comparator;
|
||||
/** Functor to compare two objective vectors according to Pareto dominance relation */
|
||||
moeoParetoObjectiveVectorComparator < ObjectiveVector > paretoComparator;
|
||||
/** boolean allow or not to pull away a copy*/
|
||||
bool nocopy;
|
||||
/** vector contains CountDominanceFitnessAssignment */
|
||||
|
|
@ -222,10 +228,7 @@ private:
|
|||
std::vector<double> rankVector;
|
||||
/** vector contains index of copys */
|
||||
std::set<unsigned int> copySet;
|
||||
/** Functor to compare two objective vectors */
|
||||
moeoObjectiveVectorComparator < ObjectiveVector > & comparator;
|
||||
/** Functor to compare two objective vectors according to Pareto dominance relation */
|
||||
moeoParetoObjectiveVectorComparator < ObjectiveVector > paretoComparator;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue