freESDiscriminativeRecombinatorController.cxx

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   F.R.E.E. - flexible registration evaluation engine
00004   Version:   v.1.0.0
00005   Date:      $Date: 2006/09/01 12:00:00 $
00006   Module:    $RCSfile: freESDiscriminativeRecombinatorController.cxx,v $
00007   Language:  C++
00008 
00009 
00010   Copyright (c) 2007 Ralf o Floca (Department of Medical Informatics,
00011   Institute for Medical Biometry and Informatics, University of Heidelberg,
00012   Germany). All rights reserved.
00013   See FREECopyright.txt or http://www.mi.med.uni-hd.de/free/copyright.htm
00014   for details.
00015 
00016      This software is distributed WITHOUT ANY WARRANTY; without even 
00017      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00018      PURPOSE.  See the above copyright notices for more information.
00019 
00020 =========================================================================*/
00021 
00022 #include "freESDiscriminativeRecombinatorController.h"
00023 #include "freExceptions.h"
00024 
00025 #include "freESDominantRecombinatorController.h"
00026 #include "freESDominantRecombinatorController.h"
00027 #include "freESIntermediateRecombinatorController.h"
00028 
00029 
00030 namespace FREE
00031 {
00032 
00036 
00037 
00038 ESDiscriminativeRecombinatorController::
00039 ESDiscriminativeRecombinatorController()
00040 {
00041   //Profile settings
00042   this->UpdateControllerID(ControllerID::ESDiscriminativeRecombinatorController);
00043   this->m_Description = "Recombines objective and strategic values seperately to a new individuals. Used by evolutionary strategy search approach.";
00044 };
00045 
00046 void
00047 ESDiscriminativeRecombinatorController::
00048 GenerateProfile(CtrlProfile::ControllerProfile& profile,
00049                 const SessionComponentCache* pComponentCache,
00050                 bool bRegardOldSetup) const
00051 {
00052   Superclass::GenerateProfile(profile,pComponentCache,bRegardOldSetup);
00053 
00054   //Subcomponents
00055   profile.SubComponents().AddSubComponent("ObjectiveRecombinator",1,ControllerID::ESDominantRecombinatorController);
00056   profile.SubComponents().AddSubComponent("StrategicRecombinator",1,ControllerID::ESIntermediateRecombinatorController);
00057 
00058   //Requirements
00059         CtrlProfile::ProfileOption* pOption;
00060     //objective recombinator
00061         pOption = profile.Requirements().AddRequirement("ObjectiveRecombinator")->AddProfileOption();
00062         pOption->Inheritance().AddAncestor(ControllerID::ESRecombinatorControllerBase);
00063         pOption->CheckForInheritance();
00064 
00065     //strategic recombinator
00066         pOption = profile.Requirements().AddRequirement("StrategicRecombinator")->AddProfileOption();
00067         pOption->Inheritance().AddAncestor(ControllerID::ESRecombinatorControllerBase);
00068         pOption->CheckForInheritance();
00069 };
00070 
00071 GenericComponentType*
00072 ESDiscriminativeRecombinatorController::
00073 GetSubComponentCasted(ComponentType* pMainComponent, const ComponentID& compID,
00074                       SessionComponentCache* pMainComponentCache) const
00075 {
00076         if (compID == "ObjectiveRecombinator") return pMainComponent->GetObjectiveRecombinator();
00077         if (compID == "StrategicRecombinator") return pMainComponent->GetStrategicRecombinator();
00078         return Superclass::GetSubComponentCasted(pMainComponent, compID, pMainComponentCache);
00079 }; 
00080 
00081 void
00082 ESDiscriminativeRecombinatorController::
00083 SetSubComponentCasted(GenericComponentType* pSubComponent,
00084                                                                                                                                                  ComponentType* pMainComponent,
00085                                                                                                                                                  const ComponentID compID,
00086                                      SessionComponentCache* pMainComponentCache) const
00087 {
00088         if (compID == "ObjectiveRecombinator") pMainComponent->SetObjectiveRecombinator(dynamic_cast<ComponentType::SubRecombinatorType*>(pSubComponent));
00089         if (compID == "StrategicRecombinator") pMainComponent->SetStrategicRecombinator(dynamic_cast<ComponentType::SubRecombinatorType*>(pSubComponent));
00090   else Superclass::SetSubComponentCasted(pSubComponent, pMainComponent, compID, pMainComponentCache);
00091 };
00092 
00093 } //end of namespace free

Generated at Sat Oct 13 15:53:35 2007 for f.r.e.e. - Flexible Registration and Evaluation Engine by doxygen 1.5.3 written by Dimitri van Heesch, © 1997-2000