Modifications 22/02/2007

git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@183 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
legrand 2007-02-22 15:38:01 +00:00
commit 8312d91a84
19 changed files with 930 additions and 805 deletions

View file

@ -24,8 +24,7 @@
* This class allows to apply a multi-objective local search to a number of selected individuals contained in the archive
* at every generation until a stopping criteria is verified.
*/
template < class MOEOT >
class moeoHybridLS : public eoUpdater
template < class MOEOT > class moeoHybridLS:public eoUpdater
{
public:
@ -33,42 +32,45 @@ public:
* Ctor
* @param _term stopping criteria
* @param _select selector
* @param _mols a multi-objective local search
* @param _ls a multi-objective local search
* @param _arch the archive
*/
eoHybridLS (eoContinue < MOEOT > & _term, eoSelect < MOEOT > & _select, moeoLS < MOEOT > & _mols, moeoArchive < MOEOT > & _arch) : term(_term), select(_select), mols(_mols), arch(_arch)
{}
eoHybridLS (eoContinue < MOEOT > &_term, eoSelect < MOEOT > &_select, moeoLS < MOEOT > &_ls, moeoArchive < MOEOT > &_arch):term (_term), select (_select), ls (_ls),
arch
(_arch)
{
}
/**
* Applies the multi-objective local search to selected individuals contained in the archive if the stopping criteria is not verified
*/
void operator () ()
{
if (! cont (arch))
{
// selection of solutions
eoPop < MOEOT > selectedSolutions;
select(arch, selectedSolutions);
// apply the local search to every selected solution
for (unsigned i=0; i<selectedSolutions.size(); i++)
{
mols(selectedSolutions[i], arch);
}
}
}
void operator () ()
{
if (!cont (arch))
{
// selection of solutions
eoPop < MOEOT > selectedSolutions;
select (arch, selectedSolutions);
// apply the local search to every selected solution
for (unsigned i = 0; i < selectedSolutions.size (); i++)
{
ls (selectedSolutions[i], arch);
}
}
}
private:
/** stopping criteria*/
eoContinue < MOEOT > & term;
eoContinue < MOEOT > &term;
/** selector */
eoSelect < MOEOT > & select;
eoSelect < MOEOT > &select;
/** multi-objective local search */
moeoLS < MOEOT > & mols;
moeoLS < MOEOT > &ls;
/** archive */
moeoArchive < MOEOT > & arch;
moeoArchive < MOEOT > &arch;
};
#endif /*MOEOHYBRIDLS_H_*/
#endif /*MOEOHYBRIDLS_H_ */