00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #include "freESRankRecombinatorController.h"
00023 #include "freExceptions.h"
00024
00025 namespace FREE
00026 {
00027
00031
00032
00033
00034 DefineParameterMacro(ESRankRecombinatorController,RankDirection,"RankDirection","Determines of the lowest objective value (true) or the highest (false) is best.");
00035 ESRankRecombinatorController::
00036 ESRankRecombinatorController()
00037 {
00038
00039 this->UpdateControllerID(ControllerID::ESRankRecombinatorController);
00040 this->m_Description = "ES rank parent recombinator, recombines the parents to a weighted mean depending on their rank.";
00041 };
00042
00043 void
00044 ESRankRecombinatorController::
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_RankDirection,CtrlProfile::Parameter::PVTBool,cParamDsc_RankDirection,1,"true");
00053 };
00054
00055 void
00056 ESRankRecombinatorController::
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 bool bRankDirection;
00065
00066 try
00067 {
00068 SessionAccessor::GetParameterValue(pComponentCache,cParam_RankDirection,bRankDirection,0,iActLevel,true);
00069 }
00070 catchAllNPassMacro("Error while retrieving parameter values.");
00071
00072 pMainComponent->SetRankDirection(bRankDirection);
00073 };
00074
00075 }