- Main Page
- Classes
- Files

- Search for |

# moeoRouletteSelect.h

    00001 // -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
    00002
    00003 //-----------------------------------------------------------------------------
    00004 // moeoRouletteSelect.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 MOEOROULETTESELECT_H_
    00014 #define MOEOROULETTESELECT_H_
    00015
    00016 #include <selection/moeoSelectOne.h>
    00017 #include <selection/moeoSelectors.h>
    00018
    00023 template < class MOEOT >
    00024 class moeoRouletteSelect:public moeoSelectOne < MOEOT >
    00025 {
    00026 public:
    00027
    00032     moeoRouletteSelect (unsigned int _tSize = 2) : tSize (_tSize)
    00033     {
    00034         // consistency check
    00035         if (tSize < 2)
    00036         {
    00037             std::
    00038             cout << "Warning, Tournament size should be >= 2\nAdjusted to 2\n";
    00039             tSize = 2;
    00040         }
    00041     }
    00042
    00043
    00048     const MOEOT & operator  () (const eoPop < MOEOT > & _pop)
    00049     {
    00050         // use the selector
    00051         return mo_roulette_wheel(_pop,tSize);
    00052     }
    00053
    00054
    00055 protected:
    00056
    00058     double & tSize;
    00059
    00060 };
    00061
    00062 #endif /*MOEOROULETTESELECT_H_ */