00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #include "freESCommaSelectionController.h"
00023 #include "freExceptions.h"
00024
00025 namespace FREE
00026 {
00027
00031
00032
00033 DefineParameterMacro(ESCommaSelectionController,MaxGenerationAge,"MaxGenerationAge","Maximum age an individual may have before sorted out (independent from its objectiv value). 0: only use the children (original comma selection)");
00034
00035 ESCommaSelectionController::
00036 ESCommaSelectionController()
00037 {
00038
00039 this->UpdateControllerID(ControllerID::ESCommaSelectionController);
00040 this->m_Description = "Comma selection for ES.";
00041 };
00042
00043 void
00044 ESCommaSelectionController::
00045 GenerateProfile(CtrlProfile::ControllerProfile& profile,
00046 const SessionComponentCache* pComponentCache,
00047 bool bRegardOldSetup) const
00048 {
00049 Superclass::GenerateProfile(profile,pComponentCache,bRegardOldSetup);
00050
00051
00052 profile.Parameters().AddParameter(cParam_MaxGenerationAge,CtrlProfile::Parameter::PVTInteger,cParamDsc_MaxGenerationAge,1,"0");
00053 };
00054
00055 void
00056 ESCommaSelectionController::
00057 ActualizeMainComponent(ComponentType* pMainComponent,
00058 SessionComponentCache* pComponentCache, SessionInfo* pSessionInfo,
00059 const unsigned int& iActLevel) const
00060 {
00061 Superclass::ActualizeMainComponent(pMainComponent, pComponentCache,
00062 pSessionInfo, iActLevel);
00063
00064 int iAge;
00065 try
00066 {
00067 SessionAccessor::GetParameterValue(pComponentCache,cParam_MaxGenerationAge,iAge,0,iActLevel,true);
00068 }
00069 catchAllNPassMacro("Error while retrieving parameter values.");
00070
00071 pMainComponent->SetMaxGenerationAge(iAge);
00072 };
00073
00074 }