- Main Page
- Classes
- Files

- Search for |

# moeoHybridLS.h

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