00001 #ifndef GLSELECTIONISTMIXER_H_ 00002 #define GLSELECTIONISTMIXER_H_ 00003 00004 #include "GLBaseParameters.h" 00005 #include "GLBaseSelectionist.h" 00006 00007 class GLBaseRanker; 00013 class GLSelectionistMixer : public GLBaseSelectionist 00014 { 00015 public: 00016 class TParameters; 00029 GLSelectionistMixer(GLBaseRanker* ranker, 00030 const double& proportion_old = 0.2); 00031 00040 GLSelectionistMixer(GLBaseRanker* ranker, 00041 const GLSelectionistMixer::TParameters* parameters); 00042 00046 virtual ~GLSelectionistMixer(); 00047 00075 virtual int doSelection( 00076 const vector<GLBaseOrganism*>& current_population, 00077 const vector<GLBaseOrganism*>& candidates, 00078 size_t new_size, 00079 vector<GLBaseOrganism*>& to_live, 00080 vector<GLBaseOrganism*>& to_die, 00081 vector<const GLBaseOrganism*>& best_survived); 00088 double getProportionOld() const 00089 { return m_proportion_old; } 00090 00097 void setProportionOld(const double& new_proportion_old); 00098 00103 struct TParameters: public GLBaseParameters 00104 { 00105 00109 TParameters(const double& proportion_old): 00110 t_proportion_old(proportion_old) {}; 00112 TParameters(const TParameters* source): 00113 t_proportion_old(source->t_proportion_old){} 00114 00117 virtual TParameters* copy() const 00118 { return new TParameters(this); } 00119 00121 double t_proportion_old; 00122 };//TParameters 00123 private: 00124 double m_proportion_old; 00125 }; 00126 00127 #endif /*GLSELECTIONISTMIXER_H_*/