New style for MOEO

git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@788 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
canape 2007-11-16 11:29:25 +00:00
commit 39709d3d12
103 changed files with 2607 additions and 2521 deletions

View file

@ -3,11 +3,11 @@
@section Introduction
ParadisEO-MOEO is a white-box object-oriented generic framework dedicated to the flexible design of evolutionary multi-objective algorithms.
This paradigm-free software embeds some features and techniques for Pareto-based resolution and
This paradigm-free software embeds some features and techniques for Pareto-based resolution and
aims to provide a set of classes allowing to ease and speed up the development of computationally efficient programs.
It is based on a clear conceptual distinction between the solution methods and the multi-objective problems they are intended to solve.
It is based on a clear conceptual distinction between the solution methods and the multi-objective problems they are intended to solve.
This separation confers a maximum design and code reuse.
ParadisEO-MOEO provides a broad range of archive-related features (such as elitism or performance metrics)
ParadisEO-MOEO provides a broad range of archive-related features (such as elitism or performance metrics)
and the most common Pareto-based fitness assignment strategies (MOGA, NSGA, SPEA, IBEA and more).
Furthermore, parallel and distributed models as well as hybridization mechanisms can be applied to an algorithm designed within ParadisEO-MOEO
using the whole version of ParadisEO.
@ -29,7 +29,7 @@ href="../../README">README</a> file in the top-directory of the source-tree.
@section Design
For an introduction to the design of ParadisEO-MOEO,
For an introduction to the design of ParadisEO-MOEO,
you can look at the <a href="http://paradiseo.gforge.inria.fr">ParadisEO website</a>.

View file

@ -1,4 +1,4 @@
/*
/*
* <moeoAlgo.h>
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007
* (C) OPAC Team, LIFL, 2002-2007
@ -41,6 +41,7 @@
/**
* Abstract class for multi-objective algorithms.
*/
class moeoAlgo {};
class moeoAlgo
{};
#endif /*MOEOALGO_H_*/

View file

@ -1,4 +1,4 @@
/*
/*
* <moeoCombinedLS.h>
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007
* (C) OPAC Team, LIFL, 2002-2007
@ -48,8 +48,8 @@
*/
template < class MOEOT, class Type >
class moeoCombinedLS : public moeoLS < MOEOT, Type >
{
public:
{
public:
/**
* Ctor
@ -57,7 +57,7 @@ public:
*/
moeoCombinedLS(moeoLS < MOEOT, Type > & _first_mols)
{
combinedLS.push_back (& _first_mols);
combinedLS.push_back (& _first_mols);
}
/**
@ -65,9 +65,9 @@ public:
* @param _mols the multi-objective local search to add
*/
void add(moeoLS < MOEOT, Type > & _mols)
{
{
combinedLS.push_back(& _mols);
}
}
/**
* Gives a new solution in order to explore the neigborhood.
@ -77,16 +77,16 @@ public:
*/
void operator () (Type _type, moeoArchive < MOEOT > & _arch)
{
for (unsigned int i=0; i<combinedLS.size(); i++)
combinedLS[i] -> operator()(_type, _arch);
for (unsigned int i=0; i<combinedLS.size(); i++)
combinedLS[i] -> operator()(_type, _arch);
}
private:
private:
/** the vector that contains the combined LS */
std::vector< moeoLS < MOEOT, Type > * > combinedLS;
};
};
#endif /*MOEOCOMBINEDLS_H_*/

View file

@ -1,4 +1,4 @@
/*
/*
* <moeoEA.h>
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007
* (C) OPAC Team, LIFL, 2002-2007
@ -45,6 +45,7 @@
* Abstract class for multi-objective evolutionary algorithms.
*/
template < class MOEOT >
class moeoEA : public moeoAlgo, public eoAlgo < MOEOT > {};
class moeoEA : public moeoAlgo, public eoAlgo < MOEOT >
{};
#endif /*MOEOEA_H_*/

View file

@ -1,4 +1,4 @@
/*
/*
* <moeoEasyEA.h>
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007
* (C) OPAC Team, LIFL, 2002-2007
@ -56,8 +56,8 @@
*/
template < class MOEOT >
class moeoEasyEA: public moeoEA < MOEOT >
{
public:
{
public:
/**
* Ctor taking a breed and merge.
@ -71,9 +71,9 @@ public:
*/
moeoEasyEA(eoContinue < MOEOT > & _continuator, eoEvalFunc < MOEOT > & _eval, eoBreed < MOEOT > & _breed, moeoReplacement < MOEOT > & _replace,
moeoFitnessAssignment < MOEOT > & _fitnessEval, moeoDiversityAssignment < MOEOT > & _diversityEval, bool _evalFitAndDivBeforeSelection = false)
:
continuator(_continuator), eval (_eval), loopEval(_eval), popEval(loopEval), selectTransform(dummySelect, dummyTransform), breed(_breed), mergeReduce(dummyMerge, dummyReduce), replace(_replace),
fitnessEval(_fitnessEval), diversityEval(_diversityEval), evalFitAndDivBeforeSelection(_evalFitAndDivBeforeSelection)
:
continuator(_continuator), eval (_eval), loopEval(_eval), popEval(loopEval), selectTransform(dummySelect, dummyTransform), breed(_breed), mergeReduce(dummyMerge, dummyReduce), replace(_replace),
fitnessEval(_fitnessEval), diversityEval(_diversityEval), evalFitAndDivBeforeSelection(_evalFitAndDivBeforeSelection)
{}
@ -89,9 +89,9 @@ public:
*/
moeoEasyEA(eoContinue < MOEOT > & _continuator, eoPopEvalFunc < MOEOT > & _popEval, eoBreed < MOEOT > & _breed, moeoReplacement < MOEOT > & _replace,
moeoFitnessAssignment < MOEOT > & _fitnessEval, moeoDiversityAssignment < MOEOT > & _diversityEval, bool _evalFitAndDivBeforeSelection = false)
:
continuator(_continuator), eval (dummyEval), loopEval(dummyEval), popEval(_popEval), selectTransform(dummySelect, dummyTransform), breed(_breed), mergeReduce(dummyMerge, dummyReduce), replace(_replace),
fitnessEval(_fitnessEval), diversityEval(_diversityEval), evalFitAndDivBeforeSelection(_evalFitAndDivBeforeSelection)
:
continuator(_continuator), eval (dummyEval), loopEval(dummyEval), popEval(_popEval), selectTransform(dummySelect, dummyTransform), breed(_breed), mergeReduce(dummyMerge, dummyReduce), replace(_replace),
fitnessEval(_fitnessEval), diversityEval(_diversityEval), evalFitAndDivBeforeSelection(_evalFitAndDivBeforeSelection)
{}
@ -108,9 +108,9 @@ public:
*/
moeoEasyEA(eoContinue < MOEOT > & _continuator, eoEvalFunc < MOEOT > & _eval, eoBreed < MOEOT > & _breed, eoMerge < MOEOT > & _merge, eoReduce< MOEOT > & _reduce,
moeoFitnessAssignment < MOEOT > & _fitnessEval, moeoDiversityAssignment < MOEOT > & _diversityEval, bool _evalFitAndDivBeforeSelection = false)
:
continuator(_continuator), eval(_eval), loopEval(_eval), popEval(loopEval), selectTransform(dummySelect, dummyTransform), breed(_breed), mergeReduce(_merge,_reduce), replace(mergeReduce),
fitnessEval(_fitnessEval), diversityEval(_diversityEval), evalFitAndDivBeforeSelection(_evalFitAndDivBeforeSelection)
:
continuator(_continuator), eval(_eval), loopEval(_eval), popEval(loopEval), selectTransform(dummySelect, dummyTransform), breed(_breed), mergeReduce(_merge,_reduce), replace(mergeReduce),
fitnessEval(_fitnessEval), diversityEval(_diversityEval), evalFitAndDivBeforeSelection(_evalFitAndDivBeforeSelection)
{}
@ -127,9 +127,9 @@ public:
*/
moeoEasyEA(eoContinue < MOEOT > & _continuator, eoEvalFunc < MOEOT > & _eval, eoSelect < MOEOT > & _select, eoTransform < MOEOT > & _transform, moeoReplacement < MOEOT > & _replace,
moeoFitnessAssignment < MOEOT > & _fitnessEval, moeoDiversityAssignment < MOEOT > & _diversityEval, bool _evalFitAndDivBeforeSelection = false)
:
continuator(_continuator), eval(_eval), loopEval(_eval), popEval(loopEval), selectTransform(_select, _transform), breed(selectTransform), mergeReduce(dummyMerge, dummyReduce), replace(_replace),
fitnessEval(_fitnessEval), diversityEval(_diversityEval), evalFitAndDivBeforeSelection(_evalFitAndDivBeforeSelection)
:
continuator(_continuator), eval(_eval), loopEval(_eval), popEval(loopEval), selectTransform(_select, _transform), breed(selectTransform), mergeReduce(dummyMerge, dummyReduce), replace(_replace),
fitnessEval(_fitnessEval), diversityEval(_diversityEval), evalFitAndDivBeforeSelection(_evalFitAndDivBeforeSelection)
{}
@ -147,9 +147,9 @@ public:
*/
moeoEasyEA(eoContinue < MOEOT > & _continuator, eoEvalFunc < MOEOT > & _eval, eoSelect < MOEOT > & _select, eoTransform < MOEOT > & _transform, eoMerge < MOEOT > & _merge, eoReduce< MOEOT > & _reduce,
moeoFitnessAssignment < MOEOT > & _fitnessEval, moeoDiversityAssignment < MOEOT > & _diversityEval, bool _evalFitAndDivBeforeSelection = false)
:
continuator(_continuator), eval(_eval), loopEval(_eval), popEval(loopEval), selectTransform(_select, _transform), breed(selectTransform), mergeReduce(_merge,_reduce), replace(mergeReduce),
fitnessEval(_fitnessEval), diversityEval(_diversityEval), evalFitAndDivBeforeSelection(_evalFitAndDivBeforeSelection)
:
continuator(_continuator), eval(_eval), loopEval(_eval), popEval(loopEval), selectTransform(_select, _transform), breed(selectTransform), mergeReduce(_merge,_reduce), replace(mergeReduce),
fitnessEval(_fitnessEval), diversityEval(_diversityEval), evalFitAndDivBeforeSelection(_evalFitAndDivBeforeSelection)
{}
@ -159,45 +159,46 @@ public:
*/
virtual void operator()(eoPop < MOEOT > & _pop)
{
eoPop < MOEOT > offspring, empty_pop;
popEval(empty_pop, _pop); // A first eval of pop.
bool firstTime = true;
do
eoPop < MOEOT > offspring, empty_pop;
popEval(empty_pop, _pop); // A first eval of pop.
bool firstTime = true;
do
{
try
try
{
unsigned int pSize = _pop.size();
offspring.clear(); // new offspring
// fitness and diversity assignment (if you want to or if it is the first generation)
if (evalFitAndDivBeforeSelection || firstTime)
unsigned int pSize = _pop.size();
offspring.clear(); // new offspring
// fitness and diversity assignment (if you want to or if it is the first generation)
if (evalFitAndDivBeforeSelection || firstTime)
{
firstTime = false;
fitnessEval(_pop);
diversityEval(_pop);
firstTime = false;
fitnessEval(_pop);
diversityEval(_pop);
}
breed(_pop, offspring);
popEval(_pop, offspring); // eval of parents + offspring if necessary
replace(_pop, offspring); // after replace, the new pop. is in _pop
if (pSize > _pop.size())
breed(_pop, offspring);
popEval(_pop, offspring); // eval of parents + offspring if necessary
replace(_pop, offspring); // after replace, the new pop. is in _pop
if (pSize > _pop.size())
{
throw std::runtime_error("Population shrinking!");
throw std::runtime_error("Population shrinking!");
}
else if (pSize < _pop.size())
else if (pSize < _pop.size())
{
throw std::runtime_error("Population growing!");
throw std::runtime_error("Population growing!");
}
}
catch (std::exception& e)
catch (std::exception& e)
{
std::string s = e.what();
s.append( " in moeoEasyEA");
throw std::runtime_error( s );
std::string s = e.what();
s.append( " in moeoEasyEA");
throw std::runtime_error( s );
}
} while (continuator(_pop));
}
while (continuator(_pop));
}
protected:
protected:
/** the stopping criteria */
eoContinue < MOEOT > & continuator;
@ -222,22 +223,34 @@ protected:
/** if this parameter is set to 'true', the fitness and the diversity of the whole population will be re-evaluated before the selection process */
bool evalFitAndDivBeforeSelection;
/** a dummy eval */
class eoDummyEval : public eoEvalFunc < MOEOT >
{ public: /** the dummy functor */
void operator()(MOEOT &) {}} dummyEval;
class eoDummyEval : public eoEvalFunc < MOEOT >
{
public: /** the dummy functor */
void operator()(MOEOT &)
{}
}
dummyEval;
/** a dummy select */
class eoDummySelect : public eoSelect < MOEOT >
{ public: /** the dummy functor */
void operator()(const eoPop < MOEOT > &, eoPop < MOEOT > &) {} } dummySelect;
class eoDummySelect : public eoSelect < MOEOT >
{
public: /** the dummy functor */
void operator()(const eoPop < MOEOT > &, eoPop < MOEOT > &)
{}
}
dummySelect;
/** a dummy transform */
class eoDummyTransform : public eoTransform < MOEOT >
{ public: /** the dummy functor */
void operator()(eoPop < MOEOT > &) {} } dummyTransform;
class eoDummyTransform : public eoTransform < MOEOT >
{
public: /** the dummy functor */
void operator()(eoPop < MOEOT > &)
{}
}
dummyTransform;
/** a dummy merge */
eoNoElitism < MOEOT > dummyMerge;
/** a dummy reduce */
eoTruncate < MOEOT > dummyReduce;
};
};
#endif /*MOEOEASYEA_H_*/

View file

@ -1,4 +1,4 @@
/*
/*
* <moeoHybridLS.h>
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007
* (C) OPAC Team, LIFL, 2002-2007
@ -51,8 +51,8 @@
*/
template < class MOEOT >
class moeoHybridLS : public eoUpdater
{
public:
{
public:
/**
* Ctor
@ -62,7 +62,7 @@ public:
* @param _arch the archive
*/
moeoHybridLS (eoContinue < MOEOT > & _term, eoSelect < MOEOT > & _select, moeoLS < MOEOT, MOEOT > & _mols, moeoArchive < MOEOT > & _arch) :
term(_term), select(_select), mols(_mols), arch(_arch)
term(_term), select(_select), mols(_mols), arch(_arch)
{}
@ -71,21 +71,21 @@ public:
*/
void operator () ()
{
if (! term (arch))
if (! term (arch))
{
// selection of solutions
eoPop < MOEOT > selectedSolutions;
select(arch, selectedSolutions);
// apply the local search to every selected solution
for (unsigned int i=0; i<selectedSolutions.size(); i++)
// selection of solutions
eoPop < MOEOT > selectedSolutions;
select(arch, selectedSolutions);
// apply the local search to every selected solution
for (unsigned int i=0; i<selectedSolutions.size(); i++)
{
mols(selectedSolutions[i], arch);
mols(selectedSolutions[i], arch);
}
}
}
private:
private:
/** stopping criteria */
eoContinue < MOEOT > & term;
@ -96,6 +96,6 @@ private:
/** archive */
moeoArchive < MOEOT > & arch;
};
};
#endif /*MOEOHYBRIDLS_H_*/

View file

@ -1,4 +1,4 @@
/*
/*
* <moeoIBEA.h>
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007
* (C) OPAC Team, LIFL, 2002-2007
@ -61,8 +61,8 @@
*/
template < class MOEOT >
class moeoIBEA : public moeoEA < MOEOT >
{
public:
{
public:
/** The type of objective vector */
typedef typename MOEOT::ObjectiveVector ObjectiveVector;
@ -77,8 +77,8 @@ public:
* @param _kappa scaling factor kappa
*/
moeoIBEA (unsigned int _maxGen, eoEvalFunc < MOEOT > & _eval, eoGenOp < MOEOT > & _op, moeoNormalizedSolutionVsSolutionBinaryMetric < ObjectiveVector, double > & _metric, const double _kappa=0.05) :
defaultGenContinuator(_maxGen), continuator(defaultGenContinuator), popEval(_eval), select(2),
fitnessAssignment(_metric, _kappa), replace(fitnessAssignment, dummyDiversityAssignment), genBreed(select, _op), breed(genBreed)
defaultGenContinuator(_maxGen), continuator(defaultGenContinuator), popEval(_eval), select(2),
fitnessAssignment(_metric, _kappa), replace(fitnessAssignment, dummyDiversityAssignment), genBreed(select, _op), breed(genBreed)
{}
@ -91,8 +91,8 @@ public:
* @param _kappa scaling factor kappa
*/
moeoIBEA (unsigned int _maxGen, eoEvalFunc < MOEOT > & _eval, eoTransform < MOEOT > & _op, moeoNormalizedSolutionVsSolutionBinaryMetric < ObjectiveVector, double > & _metric, const double _kappa=0.05) :
defaultGenContinuator(_maxGen), continuator(defaultGenContinuator), popEval(_eval), select(2),
fitnessAssignment(_metric, _kappa), replace(fitnessAssignment, dummyDiversityAssignment), genBreed(select, _op), breed(genBreed)
defaultGenContinuator(_maxGen), continuator(defaultGenContinuator), popEval(_eval), select(2),
fitnessAssignment(_metric, _kappa), replace(fitnessAssignment, dummyDiversityAssignment), genBreed(select, _op), breed(genBreed)
{}
@ -108,9 +108,9 @@ public:
* @param _kappa scaling factor kappa
*/
moeoIBEA (unsigned int _maxGen, eoEvalFunc < MOEOT > & _eval, eoQuadOp < MOEOT > & _crossover, double _pCross, eoMonOp < MOEOT > & _mutation, double _pMut, moeoNormalizedSolutionVsSolutionBinaryMetric < ObjectiveVector, double > & _metric, const double _kappa=0.05) :
defaultGenContinuator(_maxGen), continuator(defaultGenContinuator), popEval(_eval), select (2),
fitnessAssignment(_metric, _kappa), replace (fitnessAssignment, dummyDiversityAssignment), defaultSGAGenOp(_crossover, _pCross, _mutation, _pMut),
genBreed (select, defaultSGAGenOp), breed (genBreed)
defaultGenContinuator(_maxGen), continuator(defaultGenContinuator), popEval(_eval), select (2),
fitnessAssignment(_metric, _kappa), replace (fitnessAssignment, dummyDiversityAssignment), defaultSGAGenOp(_crossover, _pCross, _mutation, _pMut),
genBreed (select, defaultSGAGenOp), breed (genBreed)
{}
@ -123,8 +123,8 @@ public:
* @param _kappa scaling factor kappa
*/
moeoIBEA (eoContinue < MOEOT > & _continuator, eoEvalFunc < MOEOT > & _eval, eoGenOp < MOEOT > & _op, moeoNormalizedSolutionVsSolutionBinaryMetric < ObjectiveVector, double > & _metric, const double _kappa=0.05) :
continuator(_continuator), popEval(_eval), select(2),
fitnessAssignment(_metric, _kappa), replace(fitnessAssignment, dummyDiversityAssignment), genBreed(select, _op), breed(genBreed)
continuator(_continuator), popEval(_eval), select(2),
fitnessAssignment(_metric, _kappa), replace(fitnessAssignment, dummyDiversityAssignment), genBreed(select, _op), breed(genBreed)
{}
@ -137,8 +137,8 @@ public:
* @param _kappa scaling factor kappa
*/
moeoIBEA (eoContinue < MOEOT > & _continuator, eoEvalFunc < MOEOT > & _eval, eoTransform < MOEOT > & _op, moeoNormalizedSolutionVsSolutionBinaryMetric < ObjectiveVector, double > & _metric, const double _kappa=0.05) :
continuator(_continuator), popEval(_eval), select(2),
fitnessAssignment(_metric, _kappa), replace(fitnessAssignment, dummyDiversityAssignment), genBreed(select, _op), breed(genBreed)
continuator(_continuator), popEval(_eval), select(2),
fitnessAssignment(_metric, _kappa), replace(fitnessAssignment, dummyDiversityAssignment), genBreed(select, _op), breed(genBreed)
{}
@ -148,24 +148,25 @@ public:
*/
virtual void operator () (eoPop < MOEOT > &_pop)
{
eoPop < MOEOT > offspring, empty_pop;
popEval (empty_pop, _pop); // a first eval of _pop
// evaluate fitness and diversity
fitnessAssignment(_pop);
dummyDiversityAssignment(_pop);
do
eoPop < MOEOT > offspring, empty_pop;
popEval (empty_pop, _pop); // a first eval of _pop
// evaluate fitness and diversity
fitnessAssignment(_pop);
dummyDiversityAssignment(_pop);
do
{
// generate offspring, worths are recalculated if necessary
breed (_pop, offspring);
// 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));
// generate offspring, worths are recalculated if necessary
breed (_pop, offspring);
// 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:
protected:
/** a continuator based on the number of generations (used as default) */
eoGenContinue < MOEOT > defaultGenContinuator;
@ -188,6 +189,6 @@ protected:
/** breeder */
eoBreed < MOEOT > & breed;
};
};
#endif /*MOEOIBEA_H_*/

View file

@ -1,4 +1,4 @@
/*
/*
* <moeoIBMOLS.h>
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007
* (C) OPAC Team, LIFL, 2002-2007
@ -56,8 +56,8 @@
*/
template < class MOEOT, class Move >
class moeoIBMOLS : public moeoLS < MOEOT, eoPop < MOEOT > & >
{
public:
{
public:
/** The type of objective vector */
typedef typename MOEOT::ObjectiveVector ObjectiveVector;
@ -73,19 +73,19 @@ public:
* @param _continuator the stopping criteria
*/
moeoIBMOLS(
moMoveInit < Move > & _moveInit,
moNextMove < Move > & _nextMove,
eoEvalFunc < MOEOT > & _eval,
moeoMoveIncrEval < Move > & _moveIncrEval,
moeoBinaryIndicatorBasedFitnessAssignment < MOEOT > & _fitnessAssignment,
eoContinue < MOEOT > & _continuator
moMoveInit < Move > & _moveInit,
moNextMove < Move > & _nextMove,
eoEvalFunc < MOEOT > & _eval,
moeoMoveIncrEval < Move > & _moveIncrEval,
moeoBinaryIndicatorBasedFitnessAssignment < MOEOT > & _fitnessAssignment,
eoContinue < MOEOT > & _continuator
) :
moveInit(_moveInit),
nextMove(_nextMove),
eval(_eval),
moveIncrEval(_moveIncrEval),
fitnessAssignment (_fitnessAssignment),
continuator (_continuator)
moveInit(_moveInit),
nextMove(_nextMove),
eval(_eval),
moveIncrEval(_moveIncrEval),
fitnessAssignment (_fitnessAssignment),
continuator (_continuator)
{}
@ -97,32 +97,33 @@ public:
*/
void operator() (eoPop < MOEOT > & _pop, moeoArchive < MOEOT > & _arch)
{
// evaluation of the objective values
/*
for (unsigned int i=0; i<_pop.size(); i++)
{
eval(_pop[i]);
}
*/
// fitness assignment for the whole population
fitnessAssignment(_pop);
// creation of a local archive
moeoArchive < MOEOT > archive;
// creation of another local archive (for the stopping criteria)
moeoArchive < MOEOT > previousArchive;
// update the archive with the initial population
archive.update(_pop);
do
// evaluation of the objective values
/*
for (unsigned int i=0; i<_pop.size(); i++)
{
eval(_pop[i]);
}
*/
// fitness assignment for the whole population
fitnessAssignment(_pop);
// creation of a local archive
moeoArchive < MOEOT > archive;
// creation of another local archive (for the stopping criteria)
moeoArchive < MOEOT > previousArchive;
// update the archive with the initial population
archive.update(_pop);
do
{
previousArchive.update(archive);
oneStep(_pop);
archive.update(_pop);
} while ( (! archive.equals(previousArchive)) && (continuator(_arch)) );
_arch.update(archive);
previousArchive.update(archive);
oneStep(_pop);
archive.update(_pop);
}
while ( (! archive.equals(previousArchive)) && (continuator(_arch)) );
_arch.update(archive);
}
private:
private:
/** the move initializer */
moMoveInit < Move > & moveInit;
@ -144,162 +145,162 @@ private:
*/
void oneStep (eoPop < MOEOT > & _pop)
{
// the move
Move move;
// the objective vector and the fitness of the current solution
ObjectiveVector x_objVec;
double x_fitness;
// the index, the objective vector and the fitness of the worst solution in the population (-1 implies that the worst is the newly created one)
int worst_idx;
ObjectiveVector worst_objVec;
double worst_fitness;
////////////////////////////////////////////
// the indexes and the objective vectors of the extreme non-dominated points
int ext_0_idx, ext_1_idx;
ObjectiveVector ext_0_objVec, ext_1_objVec;
unsigned int ind;
// the move
Move move;
// the objective vector and the fitness of the current solution
ObjectiveVector x_objVec;
double x_fitness;
// the index, the objective vector and the fitness of the worst solution in the population (-1 implies that the worst is the newly created one)
int worst_idx;
ObjectiveVector worst_objVec;
double worst_fitness;
////////////////////////////////////////////
// the index of the current solution to be explored
unsigned int i=0;
// initilization of the move for the first individual
moveInit(move, _pop[i]);
while (i<_pop.size() && continuator(_pop))
// the indexes and the objective vectors of the extreme non-dominated points
int ext_0_idx, ext_1_idx;
ObjectiveVector ext_0_objVec, ext_1_objVec;
unsigned int ind;
////////////////////////////////////////////
// the index of the current solution to be explored
unsigned int i=0;
// initilization of the move for the first individual
moveInit(move, _pop[i]);
while (i<_pop.size() && continuator(_pop))
{
// x = one neigbour of pop[i]
// evaluate x in the objective space
x_objVec = moveIncrEval(move, _pop[i]);
// update every fitness values to take x into account and compute the fitness of x
x_fitness = fitnessAssignment.updateByAdding(_pop, x_objVec);
// x = one neigbour of pop[i]
// evaluate x in the objective space
x_objVec = moveIncrEval(move, _pop[i]);
// update every fitness values to take x into account and compute the fitness of x
x_fitness = fitnessAssignment.updateByAdding(_pop, x_objVec);
////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////
// extreme solutions (min only!)
ext_0_idx = -1;
ext_0_objVec = x_objVec;
ext_1_idx = -1;
ext_1_objVec = x_objVec;
for (unsigned int k=0; k<_pop.size(); k++)
// extreme solutions (min only!)
ext_0_idx = -1;
ext_0_objVec = x_objVec;
ext_1_idx = -1;
ext_1_objVec = x_objVec;
for (unsigned int k=0; k<_pop.size(); k++)
{
// ext_0
if (_pop[k].objectiveVector()[0] < ext_0_objVec[0])
// ext_0
if (_pop[k].objectiveVector()[0] < ext_0_objVec[0])
{
ext_0_idx = k;
ext_0_objVec = _pop[k].objectiveVector();
ext_0_idx = k;
ext_0_objVec = _pop[k].objectiveVector();
}
else if ( (_pop[k].objectiveVector()[0] == ext_0_objVec[0]) && (_pop[k].objectiveVector()[1] < ext_0_objVec[1]) )
else if ( (_pop[k].objectiveVector()[0] == ext_0_objVec[0]) && (_pop[k].objectiveVector()[1] < ext_0_objVec[1]) )
{
ext_0_idx = k;
ext_0_objVec = _pop[k].objectiveVector();
ext_0_idx = k;
ext_0_objVec = _pop[k].objectiveVector();
}
// ext_1
else if (_pop[k].objectiveVector()[1] < ext_1_objVec[1])
// ext_1
else if (_pop[k].objectiveVector()[1] < ext_1_objVec[1])
{
ext_1_idx = k;
ext_1_objVec = _pop[k].objectiveVector();
ext_1_idx = k;
ext_1_objVec = _pop[k].objectiveVector();
}
else if ( (_pop[k].objectiveVector()[1] == ext_1_objVec[1]) && (_pop[k].objectiveVector()[0] < ext_1_objVec[0]) )
else if ( (_pop[k].objectiveVector()[1] == ext_1_objVec[1]) && (_pop[k].objectiveVector()[0] < ext_1_objVec[0]) )
{
ext_1_idx = k;
ext_1_objVec = _pop[k].objectiveVector();
ext_1_idx = k;
ext_1_objVec = _pop[k].objectiveVector();
}
}
// worst init
if (ext_0_idx == -1)
// worst init
if (ext_0_idx == -1)
{
ind = 0;
while (ind == ext_1_idx)
ind = 0;
while (ind == ext_1_idx)
{
ind++;
ind++;
}
worst_idx = ind;
worst_objVec = _pop[ind].objectiveVector();
worst_fitness = _pop[ind].fitness();
worst_idx = ind;
worst_objVec = _pop[ind].objectiveVector();
worst_fitness = _pop[ind].fitness();
}
else if (ext_1_idx == -1)
else if (ext_1_idx == -1)
{
ind = 0;
while (ind == ext_0_idx)
ind = 0;
while (ind == ext_0_idx)
{
ind++;
ind++;
}
worst_idx = ind;
worst_objVec = _pop[ind].objectiveVector();
worst_fitness = _pop[ind].fitness();
worst_idx = ind;
worst_objVec = _pop[ind].objectiveVector();
worst_fitness = _pop[ind].fitness();
}
else
else
{
worst_idx = -1;
worst_objVec = x_objVec;
worst_fitness = x_fitness;
worst_idx = -1;
worst_objVec = x_objVec;
worst_fitness = x_fitness;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////
// who is the worst ?
for (unsigned int j=0; j<_pop.size(); j++)
// who is the worst ?
for (unsigned int j=0; j<_pop.size(); j++)
{
if ( (j!=ext_0_idx) && (j!=ext_1_idx) )
if ( (j!=ext_0_idx) && (j!=ext_1_idx) )
{
if (_pop[j].fitness() < worst_fitness)
if (_pop[j].fitness() < worst_fitness)
{
worst_idx = j;
worst_objVec = _pop[j].objectiveVector();
worst_fitness = _pop[j].fitness();
worst_idx = j;
worst_objVec = _pop[j].objectiveVector();
worst_fitness = _pop[j].fitness();
}
}
}
// if the worst solution is the new one
if (worst_idx == -1)
// if the worst solution is the new one
if (worst_idx == -1)
{
// if all its neighbours have been explored,
// let's explore the neighborhoud of the next individual
if (! nextMove(move, _pop[i]))
// if all its neighbours have been explored,
// let's explore the neighborhoud of the next individual
if (! nextMove(move, _pop[i]))
{
i++;
if (i<_pop.size())
i++;
if (i<_pop.size())
{
// initilization of the move for the next individual
moveInit(move, _pop[i]);
// initilization of the move for the next individual
moveInit(move, _pop[i]);
}
}
}
// if the worst solution is located before _pop[i]
else if (worst_idx <= i)
// if the worst solution is located before _pop[i]
else if (worst_idx <= i)
{
// the new solution takes place insteed of _pop[worst_idx]
_pop[worst_idx] = _pop[i];
move(_pop[worst_idx]);
_pop[worst_idx].objectiveVector(x_objVec);
_pop[worst_idx].fitness(x_fitness);
// let's explore the neighborhoud of the next individual
i++;
if (i<_pop.size())
// the new solution takes place insteed of _pop[worst_idx]
_pop[worst_idx] = _pop[i];
move(_pop[worst_idx]);
_pop[worst_idx].objectiveVector(x_objVec);
_pop[worst_idx].fitness(x_fitness);
// let's explore the neighborhoud of the next individual
i++;
if (i<_pop.size())
{
// initilization of the move for the next individual
moveInit(move, _pop[i]);
// initilization of the move for the next individual
moveInit(move, _pop[i]);
}
}
// if the worst solution is located after _pop[i]
else if (worst_idx > i)
// if the worst solution is located after _pop[i]
else if (worst_idx > i)
{
// the new solution takes place insteed of _pop[i+1] and _pop[worst_idx] is deleted
_pop[worst_idx] = _pop[i+1];
_pop[i+1] = _pop[i];
move(_pop[i+1]);
_pop[i+1].objectiveVector(x_objVec);
_pop[i+1].fitness(x_fitness);
// let's explore the neighborhoud of the individual _pop[i+2]
i += 2;
if (i<_pop.size())
// the new solution takes place insteed of _pop[i+1] and _pop[worst_idx] is deleted
_pop[worst_idx] = _pop[i+1];
_pop[i+1] = _pop[i];
move(_pop[i+1]);
_pop[i+1].objectiveVector(x_objVec);
_pop[i+1].fitness(x_fitness);
// let's explore the neighborhoud of the individual _pop[i+2]
i += 2;
if (i<_pop.size())
{
// initilization of the move for the next individual
moveInit(move, _pop[i]);
// initilization of the move for the next individual
moveInit(move, _pop[i]);
}
}
// update fitness values
fitnessAssignment.updateByDeleting(_pop, worst_objVec);
// update fitness values
fitnessAssignment.updateByDeleting(_pop, worst_objVec);
}
}
@ -328,153 +329,153 @@ private:
*/
void new_oneStep (eoPop < MOEOT > & _pop)
{
// the move
Move move;
// the objective vector and the fitness of the current solution
ObjectiveVector x_objVec;
double x_fitness;
// the index, the objective vector and the fitness of the worst solution in the population (-1 implies that the worst is the newly created one)
int worst_idx;
ObjectiveVector worst_objVec;
double worst_fitness;
////////////////////////////////////////////
// the index of the extreme non-dominated points
int ext_0_idx, ext_1_idx;
unsigned int ind;
// the move
Move move;
// the objective vector and the fitness of the current solution
ObjectiveVector x_objVec;
double x_fitness;
// the index, the objective vector and the fitness of the worst solution in the population (-1 implies that the worst is the newly created one)
int worst_idx;
ObjectiveVector worst_objVec;
double worst_fitness;
////////////////////////////////////////////
// the index current of the current solution to be explored
unsigned int i=0;
// initilization of the move for the first individual
moveInit(move, _pop[i]);
while (i<_pop.size() && continuator(_pop))
// the index of the extreme non-dominated points
int ext_0_idx, ext_1_idx;
unsigned int ind;
////////////////////////////////////////////
// the index current of the current solution to be explored
unsigned int i=0;
// initilization of the move for the first individual
moveInit(move, _pop[i]);
while (i<_pop.size() && continuator(_pop))
{
// x = one neigbour of pop[i]
// evaluate x in the objective space
x_objVec = moveIncrEval(move, _pop[i]);
// update every fitness values to take x into account and compute the fitness of x
x_fitness = fitnessAssignment.updateByAdding(_pop, x_objVec);
// x = one neigbour of pop[i]
// evaluate x in the objective space
x_objVec = moveIncrEval(move, _pop[i]);
// update every fitness values to take x into account and compute the fitness of x
x_fitness = fitnessAssignment.updateByAdding(_pop, x_objVec);
////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////
// extremes solutions
OneObjectiveComparator comp0(0);
ext_0_idx = std::min_element(_pop.begin(), _pop.end(), comp0) - _pop.begin();
OneObjectiveComparator comp1(1);
ext_1_idx = std::min_element(_pop.begin(), _pop.end(), comp1) - _pop.begin();
// new = extreme ?
if (x_objVec[0] < _pop[ext_0_idx].objectiveVector()[0])
// extremes solutions
OneObjectiveComparator comp0(0);
ext_0_idx = std::min_element(_pop.begin(), _pop.end(), comp0) - _pop.begin();
OneObjectiveComparator comp1(1);
ext_1_idx = std::min_element(_pop.begin(), _pop.end(), comp1) - _pop.begin();
// new = extreme ?
if (x_objVec[0] < _pop[ext_0_idx].objectiveVector()[0])
{
ext_0_idx = -1;
ext_0_idx = -1;
}
else if ( (x_objVec[0] == _pop[ext_0_idx].objectiveVector()[0]) && (x_objVec[1] < _pop[ext_0_idx].objectiveVector()[1]) )
else if ( (x_objVec[0] == _pop[ext_0_idx].objectiveVector()[0]) && (x_objVec[1] < _pop[ext_0_idx].objectiveVector()[1]) )
{
ext_0_idx = -1;
ext_0_idx = -1;
}
else if (x_objVec[1] < _pop[ext_1_idx].objectiveVector()[1])
else if (x_objVec[1] < _pop[ext_1_idx].objectiveVector()[1])
{
ext_1_idx = -1;
ext_1_idx = -1;
}
else if ( (x_objVec[1] == _pop[ext_1_idx].objectiveVector()[1]) && (x_objVec[0] < _pop[ext_1_idx].objectiveVector()[0]) )
else if ( (x_objVec[1] == _pop[ext_1_idx].objectiveVector()[1]) && (x_objVec[0] < _pop[ext_1_idx].objectiveVector()[0]) )
{
ext_1_idx = -1;
ext_1_idx = -1;
}
// worst init
if (ext_0_idx == -1)
// worst init
if (ext_0_idx == -1)
{
ind = 0;
while (ind == ext_1_idx)
ind = 0;
while (ind == ext_1_idx)
{
ind++;
ind++;
}
worst_idx = ind;
worst_objVec = _pop[ind].objectiveVector();
worst_fitness = _pop[ind].fitness();
worst_idx = ind;
worst_objVec = _pop[ind].objectiveVector();
worst_fitness = _pop[ind].fitness();
}
else if (ext_1_idx == -1)
else if (ext_1_idx == -1)
{
ind = 0;
while (ind == ext_0_idx)
ind = 0;
while (ind == ext_0_idx)
{
ind++;
ind++;
}
worst_idx = ind;
worst_objVec = _pop[ind].objectiveVector();
worst_fitness = _pop[ind].fitness();
worst_idx = ind;
worst_objVec = _pop[ind].objectiveVector();
worst_fitness = _pop[ind].fitness();
}
else
else
{
worst_idx = -1;
worst_objVec = x_objVec;
worst_fitness = x_fitness;
worst_idx = -1;
worst_objVec = x_objVec;
worst_fitness = x_fitness;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////
// who is the worst ?
for (unsigned int j=0; j<_pop.size(); j++)
// who is the worst ?
for (unsigned int j=0; j<_pop.size(); j++)
{
if ( (j!=ext_0_idx) && (j!=ext_1_idx) )
if ( (j!=ext_0_idx) && (j!=ext_1_idx) )
{
if (_pop[j].fitness() < worst_fitness)
if (_pop[j].fitness() < worst_fitness)
{
worst_idx = j;
worst_objVec = _pop[j].objectiveVector();
worst_fitness = _pop[j].fitness();
worst_idx = j;
worst_objVec = _pop[j].objectiveVector();
worst_fitness = _pop[j].fitness();
}
}
}
// if the worst solution is the new one
if (worst_idx == -1)
// if the worst solution is the new one
if (worst_idx == -1)
{
// if all its neighbours have been explored,
// let's explore the neighborhoud of the next individual
if (! nextMove(move, _pop[i]))
// if all its neighbours have been explored,
// let's explore the neighborhoud of the next individual
if (! nextMove(move, _pop[i]))
{
i++;
if (i<_pop.size())
i++;
if (i<_pop.size())
{
// initilization of the move for the next individual
moveInit(move, _pop[i]);
// initilization of the move for the next individual
moveInit(move, _pop[i]);
}
}
}
// if the worst solution is located before _pop[i]
else if (worst_idx <= i)
// if the worst solution is located before _pop[i]
else if (worst_idx <= i)
{
// the new solution takes place insteed of _pop[worst_idx]
_pop[worst_idx] = _pop[i];
move(_pop[worst_idx]);
_pop[worst_idx].objectiveVector(x_objVec);
_pop[worst_idx].fitness(x_fitness);
// let's explore the neighborhoud of the next individual
i++;
if (i<_pop.size())
// the new solution takes place insteed of _pop[worst_idx]
_pop[worst_idx] = _pop[i];
move(_pop[worst_idx]);
_pop[worst_idx].objectiveVector(x_objVec);
_pop[worst_idx].fitness(x_fitness);
// let's explore the neighborhoud of the next individual
i++;
if (i<_pop.size())
{
// initilization of the move for the next individual
moveInit(move, _pop[i]);
// initilization of the move for the next individual
moveInit(move, _pop[i]);
}
}
// if the worst solution is located after _pop[i]
else if (worst_idx > i)
// if the worst solution is located after _pop[i]
else if (worst_idx > i)
{
// the new solution takes place insteed of _pop[i+1] and _pop[worst_idx] is deleted
_pop[worst_idx] = _pop[i+1];
_pop[i+1] = _pop[i];
move(_pop[i+1]);
_pop[i+1].objectiveVector(x_objVec);
_pop[i+1].fitness(x_fitness);
// let's explore the neighborhoud of the individual _pop[i+2]
i += 2;
if (i<_pop.size())
// the new solution takes place insteed of _pop[i+1] and _pop[worst_idx] is deleted
_pop[worst_idx] = _pop[i+1];
_pop[i+1] = _pop[i];
move(_pop[i+1]);
_pop[i+1].objectiveVector(x_objVec);
_pop[i+1].fitness(x_fitness);
// let's explore the neighborhoud of the individual _pop[i+2]
i += 2;
if (i<_pop.size())
{
// initilization of the move for the next individual
moveInit(move, _pop[i]);
// initilization of the move for the next individual
moveInit(move, _pop[i]);
}
}
// update fitness values
fitnessAssignment.updateByDeleting(_pop, worst_objVec);
// update fitness values
fitnessAssignment.updateByDeleting(_pop, worst_objVec);
}
}
@ -484,35 +485,35 @@ private:
//////////////////////////////////////////////////////////////////////////////////////////
class OneObjectiveComparator : public moeoComparator < MOEOT >
{
public:
class OneObjectiveComparator : public moeoComparator < MOEOT >
{
public:
OneObjectiveComparator(unsigned int _obj) : obj(_obj)
{
if (obj > MOEOT::ObjectiveVector::nObjectives())
if (obj > MOEOT::ObjectiveVector::nObjectives())
{
throw std::runtime_error("Problem with the index of objective in OneObjectiveComparator");
throw std::runtime_error("Problem with the index of objective in OneObjectiveComparator");
}
}
const bool operator()(const MOEOT & _moeo1, const MOEOT & _moeo2)
{
if (_moeo1.objectiveVector()[obj] < _moeo2.objectiveVector()[obj])
if (_moeo1.objectiveVector()[obj] < _moeo2.objectiveVector()[obj])
{
return true;
return true;
}
else
else
{
return (_moeo1.objectiveVector()[obj] == _moeo2.objectiveVector()[obj]) && (_moeo1.objectiveVector()[(obj+1)%2] < _moeo2.objectiveVector()[(obj+1)%2]);
return (_moeo1.objectiveVector()[obj] == _moeo2.objectiveVector()[obj]) && (_moeo1.objectiveVector()[(obj+1)%2] < _moeo2.objectiveVector()[(obj+1)%2]);
}
}
private:
private:
unsigned int obj;
};
};
//////////////////////////////////////////////////////////////////////////////////////////
};
};
#endif /*MOEOIBMOLS_H_*/

View file

@ -1,4 +1,4 @@
/*
/*
* <moeoIteratedIBMOLS.h>
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007
* (C) OPAC Team, LIFL, 2002-2007
@ -64,8 +64,8 @@
*/
template < class MOEOT, class Move >
class moeoIteratedIBMOLS : public moeoLS < MOEOT, eoPop < MOEOT > & >
{
public:
{
public:
/** The type of objective vector */
typedef typename MOEOT::ObjectiveVector ObjectiveVector;
@ -84,22 +84,22 @@ public:
* @param _nNoiseIterations the number of iterations to apply the random noise
*/
moeoIteratedIBMOLS(
moMoveInit < Move > & _moveInit,
moNextMove < Move > & _nextMove,
eoEvalFunc < MOEOT > & _eval,
moeoMoveIncrEval < Move > & _moveIncrEval,
moeoBinaryIndicatorBasedFitnessAssignment < MOEOT > & _fitnessAssignment,
eoContinue < MOEOT > & _continuator,
eoMonOp < MOEOT > & _monOp,
eoMonOp < MOEOT > & _randomMonOp,
unsigned int _nNoiseIterations=1
moMoveInit < Move > & _moveInit,
moNextMove < Move > & _nextMove,
eoEvalFunc < MOEOT > & _eval,
moeoMoveIncrEval < Move > & _moveIncrEval,
moeoBinaryIndicatorBasedFitnessAssignment < MOEOT > & _fitnessAssignment,
eoContinue < MOEOT > & _continuator,
eoMonOp < MOEOT > & _monOp,
eoMonOp < MOEOT > & _randomMonOp,
unsigned int _nNoiseIterations=1
) :
ibmols(_moveInit, _nextMove, _eval, _moveIncrEval, _fitnessAssignment, _continuator),
eval(_eval),
continuator(_continuator),
monOp(_monOp),
randomMonOp(_randomMonOp),
nNoiseIterations(_nNoiseIterations)
ibmols(_moveInit, _nextMove, _eval, _moveIncrEval, _fitnessAssignment, _continuator),
eval(_eval),
continuator(_continuator),
monOp(_monOp),
randomMonOp(_randomMonOp),
nNoiseIterations(_nNoiseIterations)
{}
@ -110,19 +110,19 @@ public:
*/
void operator() (eoPop < MOEOT > & _pop, moeoArchive < MOEOT > & _arch)
{
_arch.update(_pop);
ibmols(_pop, _arch);
while (continuator(_arch))
_arch.update(_pop);
ibmols(_pop, _arch);
while (continuator(_arch))
{
// generate new solutions from the archive
generateNewSolutions(_pop, _arch);
// apply the local search (the global archive is updated in the sub-function)
ibmols(_pop, _arch);
// generate new solutions from the archive
generateNewSolutions(_pop, _arch);
// apply the local search (the global archive is updated in the sub-function)
ibmols(_pop, _arch);
}
}
private:
private:
/** the local search to iterate */
moeoIBMOLS < MOEOT, Move > ibmols;
@ -145,38 +145,38 @@ private:
*/
void generateNewSolutions(eoPop < MOEOT > & _pop, const moeoArchive < MOEOT > & _arch)
{
// shuffle vector for the random selection of individuals
vector<unsigned int> shuffle;
shuffle.resize(std::max(_pop.size(), _arch.size()));
// init shuffle
for (unsigned int i=0; i<shuffle.size(); i++)
// shuffle vector for the random selection of individuals
vector<unsigned int> shuffle;
shuffle.resize(std::max(_pop.size(), _arch.size()));
// init shuffle
for (unsigned int i=0; i<shuffle.size(); i++)
{
shuffle[i] = i;
shuffle[i] = i;
}
// randomize shuffle
UF_random_generator <unsigned int> gen;
std::random_shuffle(shuffle.begin(), shuffle.end(), gen);
// start the creation of new solutions
for (unsigned int i=0; i<_pop.size(); i++)
// randomize shuffle
UF_random_generator <unsigned int> gen;
std::random_shuffle(shuffle.begin(), shuffle.end(), gen);
// start the creation of new solutions
for (unsigned int i=0; i<_pop.size(); i++)
{
if (shuffle[i] < _arch.size()) // the given archive contains the individual i
if (shuffle[i] < _arch.size()) // the given archive contains the individual i
{
// add it to the resulting pop
_pop[i] = _arch[shuffle[i]];
// apply noise
for (unsigned int j=0; j<nNoiseIterations; j++)
// add it to the resulting pop
_pop[i] = _arch[shuffle[i]];
// apply noise
for (unsigned int j=0; j<nNoiseIterations; j++)
{
monOp(_pop[i]);
monOp(_pop[i]);
}
}
else // a random solution needs to be added
else // a random solution needs to be added
{
// random initialization
randomMonOp(_pop[i]);
// random initialization
randomMonOp(_pop[i]);
}
// evaluation of the new individual
_pop[i].invalidate();
eval(_pop[i]);
// evaluation of the new individual
_pop[i].invalidate();
eval(_pop[i]);
}
}
@ -233,6 +233,6 @@ private:
};
};
#endif /*MOEOITERATEDIBMOLS_H_*/

View file

@ -1,4 +1,4 @@
/*
/*
* <moeoLS.h>
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007
* (C) OPAC Team, LIFL, 2002-2007
@ -47,6 +47,7 @@
* Starting from a Type (i.e.: an individual, a pop, an archive...), it produces a set of new non-dominated solutions.
*/
template < class MOEOT, class Type >
class moeoLS: public moeoAlgo, public eoBF < Type, moeoArchive < MOEOT > &, void > {};
class moeoLS: public moeoAlgo, public eoBF < Type, moeoArchive < MOEOT > &, void >
{};
#endif /*MOEOLS_H_*/

View file

@ -1,4 +1,4 @@
/*
/*
* <moeoNSGA.h>
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007
* (C) OPAC Team, LIFL, 2002-2007
@ -60,8 +60,8 @@
*/
template < class MOEOT >
class moeoNSGA: public moeoEA < MOEOT >
{
public:
{
public:
/**
* Simple ctor with a eoGenOp.
@ -71,8 +71,8 @@ public:
* @param _nicheSize niche size
*/
moeoNSGA (unsigned int _maxGen, eoEvalFunc < MOEOT > & _eval, eoGenOp < MOEOT > & _op, double _nicheSize = 0.5) :
defaultGenContinuator(_maxGen), continuator(defaultGenContinuator), popEval(_eval), select(2),
diversityAssignment(_nicheSize), replace(fitnessAssignment, diversityAssignment), genBreed(select, _op), breed(genBreed)
defaultGenContinuator(_maxGen), continuator(defaultGenContinuator), popEval(_eval), select(2),
diversityAssignment(_nicheSize), replace(fitnessAssignment, diversityAssignment), genBreed(select, _op), breed(genBreed)
{}
@ -84,8 +84,8 @@ public:
* @param _nicheSize niche size
*/
moeoNSGA (unsigned int _maxGen, eoEvalFunc < MOEOT > & _eval, eoTransform < MOEOT > & _op, double _nicheSize = 0.5) :
defaultGenContinuator(_maxGen), continuator(defaultGenContinuator), popEval(_eval), select(2),
diversityAssignment(_nicheSize), replace(fitnessAssignment, diversityAssignment), genBreed(select, _op), breed(genBreed)
defaultGenContinuator(_maxGen), continuator(defaultGenContinuator), popEval(_eval), select(2),
diversityAssignment(_nicheSize), replace(fitnessAssignment, diversityAssignment), genBreed(select, _op), breed(genBreed)
{}
@ -100,9 +100,9 @@ public:
* @param _nicheSize niche size
*/
moeoNSGA (unsigned int _maxGen, eoEvalFunc < MOEOT > & _eval, eoQuadOp < MOEOT > & _crossover, double _pCross, eoMonOp < MOEOT > & _mutation, double _pMut, double _nicheSize = 0.5) :
defaultGenContinuator(_maxGen), continuator(defaultGenContinuator), popEval(_eval), select (2),
diversityAssignment(_nicheSize), replace (fitnessAssignment, diversityAssignment),
defaultSGAGenOp(_crossover, _pCross, _mutation, _pMut), genBreed (select, defaultSGAGenOp), breed (genBreed)
defaultGenContinuator(_maxGen), continuator(defaultGenContinuator), popEval(_eval), select (2),
diversityAssignment(_nicheSize), replace (fitnessAssignment, diversityAssignment),
defaultSGAGenOp(_crossover, _pCross, _mutation, _pMut), genBreed (select, defaultSGAGenOp), breed (genBreed)
{}
@ -114,8 +114,8 @@ public:
* @param _nicheSize niche size
*/
moeoNSGA (eoContinue < MOEOT > & _continuator, eoEvalFunc < MOEOT > & _eval, eoGenOp < MOEOT > & _op, double _nicheSize = 0.5) :
continuator(_continuator), popEval(_eval), select(2),
diversityAssignment(_nicheSize), replace(fitnessAssignment, diversityAssignment), genBreed(select, _op), breed(genBreed)
continuator(_continuator), popEval(_eval), select(2),
diversityAssignment(_nicheSize), replace(fitnessAssignment, diversityAssignment), genBreed(select, _op), breed(genBreed)
{}
@ -127,8 +127,8 @@ public:
* @param _nicheSize niche size
*/
moeoNSGA (eoContinue < MOEOT > & _continuator, eoEvalFunc < MOEOT > & _eval, eoTransform < MOEOT > & _op, double _nicheSize = 0.5) :
continuator(_continuator), popEval(_eval), select(2),
diversityAssignment(_nicheSize), replace(fitnessAssignment, diversityAssignment), genBreed(select, _op), breed(genBreed)
continuator(_continuator), popEval(_eval), select(2),
diversityAssignment(_nicheSize), replace(fitnessAssignment, diversityAssignment), genBreed(select, _op), breed(genBreed)
{}
@ -138,24 +138,25 @@ public:
*/
virtual void operator () (eoPop < MOEOT > &_pop)
{
eoPop < MOEOT > offspring, empty_pop;
popEval (empty_pop, _pop); // a first eval of _pop
// evaluate fitness and diversity
fitnessAssignment(_pop);
diversityAssignment(_pop);
do
eoPop < MOEOT > offspring, empty_pop;
popEval (empty_pop, _pop); // a first eval of _pop
// evaluate fitness and diversity
fitnessAssignment(_pop);
diversityAssignment(_pop);
do
{
// generate offspring, worths are recalculated if necessary
breed (_pop, offspring);
// 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));
// generate offspring, worths are recalculated if necessary
breed (_pop, offspring);
// 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:
protected:
/** a continuator based on the number of generations (used as default) */
eoGenContinue < MOEOT > defaultGenContinuator;
@ -178,6 +179,6 @@ protected:
/** breeder */
eoBreed < MOEOT > & breed;
};
};
#endif /*MOEONSGAII_H_*/

View file

@ -1,4 +1,4 @@
/*
/*
* <moeoNSGAII.h>
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007
* (C) OPAC Team, LIFL, 2002-2007
@ -63,8 +63,8 @@
*/
template < class MOEOT >
class moeoNSGAII: public moeoEA < MOEOT >
{
public:
{
public:
/**
* Simple ctor with a eoGenOp.
@ -73,9 +73,9 @@ public:
* @param _op variation operator
*/
moeoNSGAII (unsigned int _maxGen, eoEvalFunc < MOEOT > & _eval, eoGenOp < MOEOT > & _op) :
defaultGenContinuator(_maxGen), continuator(defaultGenContinuator), popEval(_eval), select(2),
replace(fitnessAssignment, diversityAssignment), defaultSGAGenOp(defaultQuadOp, 0.0, defaultMonOp, 0.0),
genBreed(select, _op), breed(genBreed)
defaultGenContinuator(_maxGen), continuator(defaultGenContinuator), popEval(_eval), select(2),
replace(fitnessAssignment, diversityAssignment), defaultSGAGenOp(defaultQuadOp, 0.0, defaultMonOp, 0.0),
genBreed(select, _op), breed(genBreed)
{}
@ -86,9 +86,9 @@ public:
* @param _op variation operator
*/
moeoNSGAII (unsigned int _maxGen, eoEvalFunc < MOEOT > & _eval, eoTransform < MOEOT > & _op) :
defaultGenContinuator(_maxGen), continuator(defaultGenContinuator), popEval(_eval), select(2),
replace(fitnessAssignment, diversityAssignment), defaultSGAGenOp(defaultQuadOp, 0.0, defaultMonOp, 0.0),
genBreed(select, _op), breed(genBreed)
defaultGenContinuator(_maxGen), continuator(defaultGenContinuator), popEval(_eval), select(2),
replace(fitnessAssignment, diversityAssignment), defaultSGAGenOp(defaultQuadOp, 0.0, defaultMonOp, 0.0),
genBreed(select, _op), breed(genBreed)
{}
@ -102,9 +102,9 @@ public:
* @param _pMut mutation probability
*/
moeoNSGAII (unsigned int _maxGen, eoEvalFunc < MOEOT > & _eval, eoQuadOp < MOEOT > & _crossover, double _pCross, eoMonOp < MOEOT > & _mutation, double _pMut) :
defaultGenContinuator(_maxGen), continuator(defaultGenContinuator), popEval(_eval), select (2),
replace (fitnessAssignment, diversityAssignment), defaultSGAGenOp(_crossover, _pCross, _mutation, _pMut),
genBreed (select, defaultSGAGenOp), breed (genBreed)
defaultGenContinuator(_maxGen), continuator(defaultGenContinuator), popEval(_eval), select (2),
replace (fitnessAssignment, diversityAssignment), defaultSGAGenOp(_crossover, _pCross, _mutation, _pMut),
genBreed (select, defaultSGAGenOp), breed (genBreed)
{}
@ -115,9 +115,9 @@ public:
* @param _op variation operator
*/
moeoNSGAII (eoContinue < MOEOT > & _continuator, eoEvalFunc < MOEOT > & _eval, eoGenOp < MOEOT > & _op) :
defaultGenContinuator(0), continuator(_continuator), popEval(_eval), select(2),
replace(fitnessAssignment, diversityAssignment), defaultSGAGenOp(defaultQuadOp, 1.0, defaultMonOp, 1.0),
genBreed(select, _op), breed(genBreed)
defaultGenContinuator(0), continuator(_continuator), popEval(_eval), select(2),
replace(fitnessAssignment, diversityAssignment), defaultSGAGenOp(defaultQuadOp, 1.0, defaultMonOp, 1.0),
genBreed(select, _op), breed(genBreed)
{}
@ -128,9 +128,9 @@ public:
* @param _op variation operator
*/
moeoNSGAII (eoContinue < MOEOT > & _continuator, eoEvalFunc < MOEOT > & _eval, eoTransform < MOEOT > & _op) :
continuator(_continuator), popEval(_eval), select(2),
replace(fitnessAssignment, diversityAssignment), defaultSGAGenOp(defaultQuadOp, 0.0, defaultMonOp, 0.0),
genBreed(select, _op), breed(genBreed)
continuator(_continuator), popEval(_eval), select(2),
replace(fitnessAssignment, diversityAssignment), defaultSGAGenOp(defaultQuadOp, 0.0, defaultMonOp, 0.0),
genBreed(select, _op), breed(genBreed)
{}
@ -140,24 +140,25 @@ public:
*/
virtual void operator () (eoPop < MOEOT > &_pop)
{
eoPop < MOEOT > offspring, empty_pop;
popEval (empty_pop, _pop); // a first eval of _pop
// evaluate fitness and diversity
fitnessAssignment(_pop);
diversityAssignment(_pop);
do
eoPop < MOEOT > offspring, empty_pop;
popEval (empty_pop, _pop); // a first eval of _pop
// evaluate fitness and diversity
fitnessAssignment(_pop);
diversityAssignment(_pop);
do
{
// generate offspring, worths are recalculated if necessary
breed (_pop, offspring);
// 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));
// generate offspring, worths are recalculated if necessary
breed (_pop, offspring);
// 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:
protected:
/** a continuator based on the number of generations (used as default) */
eoGenContinue < MOEOT > defaultGenContinuator;
@ -184,6 +185,6 @@ protected:
/** breeder */
eoBreed < MOEOT > & breed;
};
};
#endif /*MOEONSGAII_H_*/

View file

@ -1,4 +1,4 @@
/*
/*
* <moeoArchive.h>
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007
* (C) OPAC Team, LIFL, 2002-2007
@ -47,8 +47,8 @@
*/
template < class MOEOT >
class moeoArchive : public eoPop < MOEOT >
{
public:
{
public:
using eoPop < MOEOT > :: size;
using eoPop < MOEOT > :: operator[];
@ -83,17 +83,17 @@ public:
* @param _objectiveVector the objective vector to compare with the current archive
*/
bool dominates (const ObjectiveVector & _objectiveVector) const
{
{
for (unsigned int i = 0; i<size(); i++)
{
{
// if _objectiveVector is dominated by the ith individual of the archive...
if ( comparator(_objectiveVector, operator[](i).objectiveVector()) )
{
{
return true;
}
}
}
}
return false;
}
}
/**
@ -101,16 +101,16 @@ public:
* @param _objectiveVector the objective vector to compare with the current archive
*/
bool contains (const ObjectiveVector & _objectiveVector) const
{
{
for (unsigned int i = 0; i<size(); i++)
{
{
if (operator[](i).objectiveVector() == _objectiveVector)
{
{
return true;
}
}
}
}
return false;
}
}
/**
@ -119,39 +119,39 @@ public:
*/
void update (const MOEOT & _moeo)
{
// first step: removing the dominated solutions from the archive
for (unsigned int j=0; j<size();)
// first step: removing the dominated solutions from the archive
for (unsigned int j=0; j<size();)
{
// if the jth solution contained in the archive is dominated by _moeo
if ( comparator(operator[](j).objectiveVector(), _moeo.objectiveVector()) )
// if the jth solution contained in the archive is dominated by _moeo
if ( comparator(operator[](j).objectiveVector(), _moeo.objectiveVector()) )
{
operator[](j) = back();
pop_back();
operator[](j) = back();
pop_back();
}
else if (_moeo.objectiveVector() == operator[](j).objectiveVector())
else if (_moeo.objectiveVector() == operator[](j).objectiveVector())
{
operator[](j) = back();
pop_back();
operator[](j) = back();
pop_back();
}
else
else
{
j++;
j++;
}
}
// second step: is _moeo dominated?
bool dom = false;
for (unsigned int j=0; j<size(); j++)
// second step: is _moeo dominated?
bool dom = false;
for (unsigned int j=0; j<size(); j++)
{
// if _moeo is dominated by the jth solution contained in the archive
if ( comparator(_moeo.objectiveVector(), operator[](j).objectiveVector()) )
// if _moeo is dominated by the jth solution contained in the archive
if ( comparator(_moeo.objectiveVector(), operator[](j).objectiveVector()) )
{
dom = true;
break;
dom = true;
break;
}
}
if (!dom)
if (!dom)
{
push_back(_moeo);
push_back(_moeo);
}
}
@ -162,9 +162,9 @@ public:
*/
void update (const eoPop < MOEOT > & _pop)
{
for (unsigned int i=0; i<_pop.size(); i++)
for (unsigned int i=0; i<_pop.size(); i++)
{
update(_pop[i]);
update(_pop[i]);
}
}
@ -175,31 +175,31 @@ public:
*/
bool equals (const moeoArchive < MOEOT > & _arch)
{
for (unsigned int i=0; i<size(); i++)
for (unsigned int i=0; i<size(); i++)
{
if (! _arch.contains(operator[](i).objectiveVector()))
if (! _arch.contains(operator[](i).objectiveVector()))
{
return false;
return false;
}
}
for (unsigned int i=0; i<_arch.size() ; i++)
for (unsigned int i=0; i<_arch.size() ; i++)
{
if (! contains(_arch[i].objectiveVector()))
if (! contains(_arch[i].objectiveVector()))
{
return false;
return false;
}
}
return true;
return true;
}
private:
private:
/** The moeoObjectiveVectorComparator used to compare solutions */
moeoObjectiveVectorComparator < ObjectiveVector > & comparator;
/** A moeoObjectiveVectorComparator based on Pareto dominance (used as default) */
moeoParetoObjectiveVectorComparator < ObjectiveVector > paretoComparator;
};
};
#endif /*MOEOARCHIVE_H_ */

View file

@ -1,4 +1,4 @@
/*
/*
* <moeoAggregativeComparator.h>
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007
* (C) OPAC Team, LIFL, 2002-2007
@ -45,8 +45,8 @@
*/
template < class MOEOT >
class moeoAggregativeComparator : public moeoComparator < MOEOT >
{
public:
{
public:
/**
* Ctor.
@ -64,17 +64,17 @@ public:
*/
const bool operator()(const MOEOT & _moeo1, const MOEOT & _moeo2)
{
return ( weightFitness * _moeo1.fitness() + weightDiversity * _moeo1.diversity() ) < ( weightFitness * _moeo2.fitness() + weightDiversity * _moeo2.diversity() );
return ( weightFitness * _moeo1.fitness() + weightDiversity * _moeo1.diversity() ) < ( weightFitness * _moeo2.fitness() + weightDiversity * _moeo2.diversity() );
}
private:
private:
/** the weight for fitness */
double weightFitness;
/** the weight for diversity */
double weightDiversity;
};
};
#endif /*MOEOAGGREGATIVECOMPARATOR_H_*/

View file

@ -1,4 +1,4 @@
/*
/*
* <moeoComparator.h>
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007
* (C) OPAC Team, LIFL, 2002-2007
@ -44,6 +44,7 @@
* Functor allowing to compare two solutions.
*/
template < class MOEOT >
class moeoComparator : public eoBF < const MOEOT &, const MOEOT &, const bool > {};
class moeoComparator : public eoBF < const MOEOT &, const MOEOT &, const bool >
{};
#endif /*MOEOCOMPARATOR_H_*/

View file

@ -1,4 +1,4 @@
/*
/*
* <moeoDiversityThenFitnessComparator.h>
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007
* (C) OPAC Team, LIFL, 2002-2007
@ -45,8 +45,8 @@
*/
template < class MOEOT >
class moeoDiversityThenFitnessComparator : public moeoComparator < MOEOT >
{
public:
{
public:
/**
* Returns true if _moeo1 < _moeo2 according to their diversity values, then according to their fitness values
@ -55,16 +55,16 @@ public:
*/
const bool operator()(const MOEOT & _moeo1, const MOEOT & _moeo2)
{
if (_moeo1.diversity() == _moeo2.diversity())
if (_moeo1.diversity() == _moeo2.diversity())
{
return _moeo1.fitness() < _moeo2.fitness();
return _moeo1.fitness() < _moeo2.fitness();
}
else
else
{
return _moeo1.diversity() < _moeo2.diversity();
return _moeo1.diversity() < _moeo2.diversity();
}
}
};
};
#endif /*MOEODIVERSITYTHENFITNESSCOMPARATOR_H_*/

View file

@ -1,4 +1,4 @@
/*
/*
* <moeoFitnessThenDiversityComparator.h>
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007
* (C) OPAC Team, LIFL, 2002-2007
@ -45,8 +45,8 @@
*/
template < class MOEOT >
class moeoFitnessThenDiversityComparator : public moeoComparator < MOEOT >
{
public:
{
public:
/**
* Returns true if _moeo1 < _moeo2 according to their fitness values, then according to their diversity values
@ -55,16 +55,16 @@ public:
*/
const bool operator()(const MOEOT & _moeo1, const MOEOT & _moeo2)
{
if (_moeo1.fitness() == _moeo2.fitness())
if (_moeo1.fitness() == _moeo2.fitness())
{
return _moeo1.diversity() < _moeo2.diversity();
return _moeo1.diversity() < _moeo2.diversity();
}
else
else
{
return _moeo1.fitness() < _moeo2.fitness();
return _moeo1.fitness() < _moeo2.fitness();
}
}
};
};
#endif /*MOEOFITNESSTHENDIVERSITYCOMPARATOR_H_*/

View file

@ -1,4 +1,4 @@
/*
/*
* <moeoGDominanceObjectiveVectorComparator.h>
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007
* (C) OPAC Team, LIFL, 2002-2007
@ -48,8 +48,8 @@
*/
template < class ObjectiveVector >
class moeoGDominanceObjectiveVectorComparator : public moeoObjectiveVectorComparator < ObjectiveVector >
{
public:
{
public:
/**
* Ctor.
@ -66,27 +66,27 @@ public:
*/
const bool operator()(const ObjectiveVector & _objectiveVector1, const ObjectiveVector & _objectiveVector2)
{
unsigned int flag1 = flag(_objectiveVector1);
unsigned int flag2 = flag(_objectiveVector2);
if (flag2==0)
unsigned int flag1 = flag(_objectiveVector1);
unsigned int flag2 = flag(_objectiveVector2);
if (flag2==0)
{
// cannot dominate
return false;
// cannot dominate
return false;
}
else if ( (flag2==1) && (flag1==0) )
else if ( (flag2==1) && (flag1==0) )
{
// is dominated
return true;
// is dominated
return true;
}
else // (flag1==1) && (flag2==1)
else // (flag1==1) && (flag2==1)
{
// both are on the good region, so let's use the classical Pareto dominance
return paretoComparator(_objectiveVector1, _objectiveVector2);
// both are on the good region, so let's use the classical Pareto dominance
return paretoComparator(_objectiveVector1, _objectiveVector2);
}
}
private:
private:
/** the reference point */
ObjectiveVector & ref;
@ -100,28 +100,28 @@ private:
*/
unsigned int flag(const ObjectiveVector & _objectiveVector)
{
unsigned int result=1;
for (unsigned int i=0; i<ref.nObjectives(); i++)
unsigned int result=1;
for (unsigned int i=0; i<ref.nObjectives(); i++)
{
if (_objectiveVector[i] > ref[i])
if (_objectiveVector[i] > ref[i])
{
result=0;
result=0;
}
}
if (result==0)
if (result==0)
{
result=1;
for (unsigned int i=0; i<ref.nObjectives(); i++)
result=1;
for (unsigned int i=0; i<ref.nObjectives(); i++)
{
if (_objectiveVector[i] < ref[i])
if (_objectiveVector[i] < ref[i])
{
result=0;
result=0;
}
}
}
return result;
return result;
}
};
};
#endif /*MOEOGDOMINANCEOBJECTIVEVECTORCOMPARATOR_H_*/

View file

@ -1,4 +1,4 @@
/*
/*
* <moeoObjectiveObjectiveVectorComparator.h>
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007
* (C) OPAC Team, LIFL, 2002-2007
@ -45,8 +45,8 @@
*/
template < class ObjectiveVector >
class moeoObjectiveObjectiveVectorComparator : public moeoObjectiveVectorComparator < ObjectiveVector >
{
public:
{
public:
/**
* Returns true if _objectiveVector1 < _objectiveVector2 on the first objective, then on the second, and so on
@ -55,23 +55,23 @@ public:
*/
const bool operator()(const ObjectiveVector & _objectiveVector1, const ObjectiveVector & _objectiveVector2)
{
for (unsigned int i=0; i<ObjectiveVector::nObjectives(); i++)
for (unsigned int i=0; i<ObjectiveVector::nObjectives(); i++)
{
if ( fabs(_objectiveVector1[i] - _objectiveVector2[i]) > ObjectiveVector::Traits::tolerance() )
if ( fabs(_objectiveVector1[i] - _objectiveVector2[i]) > ObjectiveVector::Traits::tolerance() )
{
if (_objectiveVector1[i] < _objectiveVector2[i])
if (_objectiveVector1[i] < _objectiveVector2[i])
{
return true;
return true;
}
else
else
{
return false;
return false;
}
}
}
return false;
return false;
}
};
};
#endif /*MOEOOBJECTIVEOBJECTIVEVECTORCOMPARATOR_H_*/

View file

@ -1,4 +1,4 @@
/*
/*
* <moeoObjectiveVectorComparator.h>
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007
* (C) OPAC Team, LIFL, 2002-2007
@ -46,6 +46,7 @@
* The template argument ObjectiveVector have to be a moeoObjectiveVector.
*/
template < class ObjectiveVector >
class moeoObjectiveVectorComparator : public eoBF < const ObjectiveVector &, const ObjectiveVector &, const bool > {};
class moeoObjectiveVectorComparator : public eoBF < const ObjectiveVector &, const ObjectiveVector &, const bool >
{};
#endif /*MOEOOBJECTIVEVECTORCOMPARATOR_H_*/

Some files were not shown because too many files have changed in this diff Show more