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.
|
* Ctor with a crossover, a mutation and their corresponding rates.
|
||||||
* @param _continuator stopping criteria
|
* @param _continuator stopping criteria
|
||||||
popEval * @param _eval evaluation function
|
* @param _eval evaluation function
|
||||||
* @param _op general operator
|
* @param _op general operator
|
||||||
* @param _archive archive
|
* @param _archive archive
|
||||||
* @param _k the k-ieme distance used to fixe diversity
|
* @param _k the k-ieme distance used to fixe diversity
|
||||||
|
|
@ -218,19 +218,21 @@ public:
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
/** dummy evaluation */
|
/** dummy evaluation */
|
||||||
class eoDummyEval : public eoEvalFunc< MOEOT >
|
class eoDummyEval : public eoEvalFunc< MOEOT >
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void operator()(MOEOT &) {}
|
void operator()(MOEOT &) {}
|
||||||
}
|
}
|
||||||
dummyEval;
|
dummyEval;
|
||||||
|
|
||||||
/** dummy transform */
|
/** dummy transform */
|
||||||
class eoDummyTransform : public eoTransform<MOEOT>
|
class eoDummyTransform : public eoTransform<MOEOT>
|
||||||
{
|
{
|
||||||
public :
|
public :
|
||||||
void operator()(eoPop<MOEOT>&) {}
|
void operator()(eoPop<MOEOT>&) {}
|
||||||
}
|
}
|
||||||
dummyTransform;
|
dummyTransform;
|
||||||
|
|
||||||
/** a continuator based on the number of generations (used as default) */
|
/** a continuator based on the number of generations (used as default) */
|
||||||
eoGenContinue < MOEOT > defaultGenContinuator;
|
eoGenContinue < MOEOT > defaultGenContinuator;
|
||||||
/** stopping criteria */
|
/** stopping criteria */
|
||||||
|
|
@ -243,31 +245,31 @@ class eoDummyTransform : public eoTransform<MOEOT>
|
||||||
eoPopEvalFunc < MOEOT > & popEval;
|
eoPopEvalFunc < MOEOT > & popEval;
|
||||||
/**archive*/
|
/**archive*/
|
||||||
moeoArchive < MOEOT >& archive;
|
moeoArchive < MOEOT >& archive;
|
||||||
/** selectMany */
|
|
||||||
eoSelectMany <MOEOT> selectMany;
|
|
||||||
/** select Transform*/
|
|
||||||
eoSelectTransform <MOEOT> selectTransform;
|
|
||||||
/**SelectOne*/
|
/**SelectOne*/
|
||||||
moeoDetTournamentSelect < MOEOT > defaultSelect;
|
moeoDetTournamentSelect < MOEOT > defaultSelect;
|
||||||
/** binary tournament selection */
|
/** binary tournament selection */
|
||||||
moeoSelectFromPopAndArch < MOEOT > select;
|
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 */
|
/** fitness assignment used in NSGA-II */
|
||||||
moeoDominanceCountRankingFitnessAssignment < MOEOT > fitnessAssignment;
|
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 */
|
/** diversity assignment used in NSGA-II */
|
||||||
moeoNearestNeighborDiversityAssignment < MOEOT > diversityAssignment;
|
moeoNearestNeighborDiversityAssignment < MOEOT > diversityAssignment;
|
||||||
/** elitist replacement */
|
/** elitist replacement */
|
||||||
moeoGenerationalReplacement < MOEOT > replace;
|
moeoGenerationalReplacement < MOEOT > replace;
|
||||||
/** a default crossover */
|
/**distance*/
|
||||||
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*/
|
|
||||||
moeoEuclideanDistance < MOEOT > dist;
|
moeoEuclideanDistance < MOEOT > dist;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -133,11 +133,6 @@ private:
|
||||||
|
|
||||||
/** archive max size */
|
/** archive max size */
|
||||||
unsigned int maxSize;
|
unsigned int maxSize;
|
||||||
/** fitness assignment */
|
|
||||||
moeoFitnessAssignment < MOEOT > & fitness;
|
|
||||||
/** diversity assignment */
|
|
||||||
moeoDiversityAssignment < MOEOT > & diversity;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Wrapper which allow to used an moeoComparator in std::sort
|
* Wrapper which allow to used an moeoComparator in std::sort
|
||||||
* @param _comp the comparator to used
|
* @param _comp the comparator to used
|
||||||
|
|
@ -165,6 +160,11 @@ private:
|
||||||
}
|
}
|
||||||
indiComparator;
|
indiComparator;
|
||||||
|
|
||||||
|
/** fitness assignment */
|
||||||
|
moeoFitnessAssignment < MOEOT > & fitness;
|
||||||
|
/** diversity assignment */
|
||||||
|
moeoDiversityAssignment < MOEOT > & diversity;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /*MOEOBOUNDEDARCHIVE_H_*/
|
#endif /*MOEOBOUNDEDARCHIVE_H_*/
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,7 @@ public:
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**l
|
||||||
* Ctor where you can choose your own moeoDistance
|
* Ctor where you can choose your own moeoDistance
|
||||||
* @param _dist the distance used
|
* @param _dist the distance used
|
||||||
* @param _maxSize the size of archive (must be smaller or egal to the population size)
|
* @param _maxSize the size of archive (must be smaller or egal to the population size)
|
||||||
|
|
@ -285,6 +285,32 @@ private:
|
||||||
unsigned int maxSize;
|
unsigned int maxSize;
|
||||||
/** archive size */
|
/** archive size */
|
||||||
unsigned int borne;
|
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*/
|
/** default moeoComparator*/
|
||||||
moeoFitnessThenDiversityComparator < MOEOT > defaultComparator;
|
moeoFitnessThenDiversityComparator < MOEOT > defaultComparator;
|
||||||
/** distance */
|
/** 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_*/
|
#endif /*MOEOSPEA2ARCHIVE_H_*/
|
||||||
|
|
|
||||||
|
|
@ -346,10 +346,12 @@ class moeoHyperVolumeMetric : public moeoVectorUnaryMetric < ObjectiveVector , d
|
||||||
|
|
||||||
double rho;
|
double rho;
|
||||||
|
|
||||||
|
ObjectiveVector ref_point;
|
||||||
|
|
||||||
/*vectors contains bounds for normalization*/
|
/*vectors contains bounds for normalization*/
|
||||||
std::vector < eoRealInterval > bounds;
|
std::vector < eoRealInterval > bounds;
|
||||||
|
|
||||||
ObjectiveVector ref_point;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -59,18 +59,20 @@ public:
|
||||||
/** The type for objective vector */
|
/** The type for objective vector */
|
||||||
typedef typename MOEOT::ObjectiveVector ObjectiveVector;
|
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
|
* Default constructor with paretoComparator
|
||||||
* @param _nocopy boolean allow to consider copy and doublons as bad element whose were dominated by all other MOEOT
|
* @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) {}
|
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
|
* Filling up the Dominance Matrix on one population
|
||||||
|
|
@ -214,6 +216,10 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
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*/
|
/** boolean allow or not to pull away a copy*/
|
||||||
bool nocopy;
|
bool nocopy;
|
||||||
/** vector contains CountDominanceFitnessAssignment */
|
/** vector contains CountDominanceFitnessAssignment */
|
||||||
|
|
@ -222,10 +228,7 @@ private:
|
||||||
std::vector<double> rankVector;
|
std::vector<double> rankVector;
|
||||||
/** vector contains index of copys */
|
/** vector contains index of copys */
|
||||||
std::set<unsigned int> copySet;
|
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