AUTHORS modification
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@152 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
cde1586361
commit
4c21c72510
137 changed files with 2356 additions and 2369 deletions
|
|
@ -28,7 +28,8 @@
|
|||
|
||||
/**
|
||||
*/
|
||||
template<class EOT> class moeoNSGA_II: public eoAlgo<EOT> {
|
||||
template < class EOT > class moeoNSGA_II:public eoAlgo < EOT >
|
||||
{
|
||||
public:
|
||||
|
||||
/**
|
||||
|
|
@ -42,89 +43,64 @@ public:
|
|||
@param _op variation operator
|
||||
*/
|
||||
|
||||
moeoNSGA_II(
|
||||
unsigned _max_gen,
|
||||
eoEvalFunc<EOT>& _eval,
|
||||
eoGenOp<EOT>& _op
|
||||
): continuator(*(new eoGenContinue<EOT>(_max_gen))),
|
||||
eval(_eval),
|
||||
loopEval(_eval),
|
||||
popEval(loopEval),
|
||||
selectOne(sorting, 2), // binary tournament selection
|
||||
replace(sorting),
|
||||
genBreed(selectOne, _op),
|
||||
breed(genBreed)
|
||||
{}
|
||||
moeoNSGA_II (unsigned _max_gen, eoEvalFunc < EOT > &_eval, eoGenOp < EOT > &_op):continuator (*(new eoGenContinue < EOT > (_max_gen))), eval (_eval), loopEval (_eval), popEval (loopEval), selectOne (sorting, 2), // binary tournament selection
|
||||
replace (sorting), genBreed (selectOne, _op), breed (genBreed)
|
||||
{
|
||||
}
|
||||
|
||||
/// Ctor taking _max_gen, crossover and mutation
|
||||
moeoNSGA_II(
|
||||
unsigned _max_gen,
|
||||
eoEvalFunc<EOT>& _eval,
|
||||
eoQuadOp<EOT>& crossover,
|
||||
double pCross,
|
||||
eoMonOp<EOT>& mutation,
|
||||
double pMut
|
||||
): continuator(*(new eoGenContinue<EOT>(_max_gen))),
|
||||
eval(_eval),
|
||||
loopEval(_eval),
|
||||
popEval(loopEval),
|
||||
selectOne(sorting, 2), // binary tournament selection
|
||||
replace(sorting),
|
||||
genBreed(selectOne, *new eoSGAGenOp<EOT>(crossover, pCross, mutation, pMut)),
|
||||
breed(genBreed)
|
||||
{}
|
||||
/// Ctor taking _max_gen, crossover and mutation
|
||||
moeoNSGA_II (unsigned _max_gen, eoEvalFunc < EOT > &_eval, eoQuadOp < EOT > &crossover, double pCross, eoMonOp < EOT > &mutation, double pMut):continuator (*(new eoGenContinue < EOT > (_max_gen))), eval (_eval), loopEval (_eval), popEval (loopEval), selectOne (sorting, 2), // binary tournament selection
|
||||
|
||||
replace (sorting),
|
||||
genBreed (selectOne,
|
||||
*new eoSGAGenOp < EOT > (crossover, pCross, mutation, pMut)),
|
||||
breed (genBreed)
|
||||
{
|
||||
}
|
||||
|
||||
/// Ctor taking a continuator instead of _gen_max
|
||||
moeoNSGA_II(
|
||||
eoContinue<EOT>& _continuator,
|
||||
eoEvalFunc<EOT>& _eval,
|
||||
eoGenOp<EOT>& _op
|
||||
):
|
||||
continuator(_continuator),
|
||||
eval (_eval),
|
||||
loopEval(_eval),
|
||||
popEval(loopEval),
|
||||
selectOne(sorting, 2), // binary tournament selection
|
||||
replace(sorting),
|
||||
genBreed(selectOne, _op),
|
||||
breed(genBreed)
|
||||
{}
|
||||
/// Ctor taking a continuator instead of _gen_max
|
||||
moeoNSGA_II (eoContinue < EOT > &_continuator, eoEvalFunc < EOT > &_eval, eoGenOp < EOT > &_op):
|
||||
continuator (_continuator), eval (_eval), loopEval (_eval), popEval (loopEval), selectOne (sorting, 2), // binary tournament selection
|
||||
replace (sorting), genBreed (selectOne, _op), breed (genBreed)
|
||||
{
|
||||
}
|
||||
|
||||
///Apply a few generation of evolution to the population.
|
||||
virtual void operator()(eoPop<EOT>& _pop)
|
||||
{
|
||||
eoPop<EOT> offspring, empty_pop;
|
||||
popEval(empty_pop, _pop); // a first eval of _pop
|
||||
do
|
||||
{
|
||||
// generate offspring, worths are recalculated if necessary
|
||||
breed(_pop, offspring);
|
||||
|
||||
// eval of offspring
|
||||
popEval(_pop, offspring);
|
||||
///Apply a few generation of evolution to the population.
|
||||
virtual void operator () (eoPop < EOT > &_pop)
|
||||
{
|
||||
eoPop < EOT > offspring, empty_pop;
|
||||
popEval (empty_pop, _pop); // a first eval of _pop
|
||||
do
|
||||
{
|
||||
// generate offspring, worths are recalculated if necessary
|
||||
breed (_pop, offspring);
|
||||
|
||||
// after replace, the new pop is in _pop. Worths are recalculated if necessary
|
||||
replace(_pop, offspring);
|
||||
|
||||
} while (continuator(_pop));
|
||||
}
|
||||
// eval of offspring
|
||||
popEval (_pop, offspring);
|
||||
|
||||
// after replace, the new pop is in _pop. Worths are recalculated if necessary
|
||||
replace (_pop, offspring);
|
||||
|
||||
}
|
||||
while (continuator (_pop));
|
||||
}
|
||||
|
||||
protected:
|
||||
eoContinue<EOT>& continuator;
|
||||
|
||||
eoEvalFunc<EOT>& eval;
|
||||
eoPopLoopEval<EOT> loopEval;
|
||||
eoContinue < EOT > &continuator;
|
||||
|
||||
eoPopEvalFunc<EOT>& popEval;
|
||||
|
||||
/// NSGAII sorting
|
||||
moeoNDSorting_II<EOT> sorting;
|
||||
/// Binary tournament selection
|
||||
eoDetTournamentWorthSelect<EOT> selectOne;
|
||||
/// Elitist replacement
|
||||
moeoElitistReplacement<EOT> replace;
|
||||
eoGeneralBreeder<EOT> genBreed;
|
||||
eoBreed<EOT>& breed;
|
||||
eoEvalFunc < EOT > &eval;
|
||||
eoPopLoopEval < EOT > loopEval;
|
||||
|
||||
eoPopEvalFunc < EOT > &popEval;
|
||||
|
||||
/// NSGAII sorting
|
||||
moeoNDSorting_II < EOT > sorting;
|
||||
/// Binary tournament selection
|
||||
eoDetTournamentWorthSelect < EOT > selectOne;
|
||||
/// Elitist replacement
|
||||
moeoElitistReplacement < EOT > replace;
|
||||
eoGeneralBreeder < EOT > genBreed;
|
||||
eoBreed < EOT > &breed;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue