- Main Page
- Classes
- Files

- Search for |

# moeoHybridMOLS.h

    00001 // -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
    00002
    00003 //-----------------------------------------------------------------------------
    00004 // moeoHybridMOLS.h
    00005 // (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2006
    00006 /*
    00007     This library...
    00008
    00009     Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr
    00010  */
    00011 //-----------------------------------------------------------------------------
    00012
    00013 #ifndef MOEOHYBRIDMOLS_H_
    00014 #define MOEOHYBRIDMOLS_H_
    00015
    00016 #include <eoContinue.h>
    00017 #include <eoPop.h>
    00018 #include <eoUpdater.h>
    00019 #include <eoSelect.h>
    00020 #include <moeoArchive.h>
    00021 #include <moeoMOLS.h>
    00022
    00027 template < class EOT > class moeoHybridMOLS:public eoUpdater
    00028 {
    00029 public:
    00030
    00038 eoHybridMOLS (eoContinue < EOT > &_term, eoSelect < EOT > &_select, moeoMOLS < EOT > &_mols, moeoArchive < EOT > &_arch):term (_term), select (_select), mols (_mols),
    00039     arch
    00040     (_arch)
    00041   {
    00042   }
    00043
    00047   void operator  () ()
    00048   {
    00049     if (!cont (arch))
    00050       {
    00051         // selection of solutions
    00052         eoPop < EOT > selectedSolutions;
    00053         select (arch, selectedSolutions);
    00054         // apply the local search to every selected solution
    00055         for (unsigned i = 0; i < selectedSolutions.size (); i++)
    00056           mols (selectedSolutions[i], arch);
    00057       }
    00058   }
    00059
    00060
    00061 private:
    00062
    00064   eoContinue < EOT > &term;
    00066   eoSelect < EOT > &select;
    00068   moeoMOLS < EOT > &mols;
    00070   moeoArchive < EOT > &arch;
    00071
    00072 };
    00073
    00074 #endif /*MOEOHYBRIDMOLS_H_ */