freESMutationBase.txx

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: freESMutationBase.txx,v $
00007   Language:  C++
00008 
00009 
00010 
00011   Copyright (c) 2007 Ralf o Floca (Department of Medical Informatics,
00012   Institute for Medical Biometry and Informatics, University of Heidelberg,
00013   Germany). All rights reserved.
00014   See FREECopyright.txt or http://www.mi.med.uni-hd.de/free/copyright.htm
00015   for details.
00016 
00017      This software is distributed WITHOUT ANY WARRANTY; without even 
00018      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00019      PURPOSE.  See the above copyright notices for more information.
00020 
00021 =========================================================================*/
00022 #ifndef _freESMutationBase_txx
00023 #define _freESMutationBase_txx
00024 
00025 #include "freESMutationBase.h"
00026 
00027 namespace FREE
00028 {
00029 namespace ES
00030 {
00031 
00032 template <class TIndividual>
00033 MutationBase<TIndividual>
00034 ::MutationBase()
00035 {
00036   m_ScalesInitialized = false;
00037   m_MutateValueScale = 1.0;
00038 }
00039 
00040 template <class TIndividual>
00041 MutationBase<TIndividual>
00042 ::~MutationBase() 
00043 {
00044 }
00045 
00046 template <class TIndividual>
00047 void
00048 MutationBase<TIndividual>
00049 ::Mutate(IndividualType* pIndividual, PopulationType* pPopulation) const
00050 {
00051   if (!pIndividual) throwExceptionMacro("Error. Passed individual is Null.");
00052   if (!pPopulation) throwExceptionMacro("Error. Passed population is Null.");
00053 
00054   MutateObjectivParameters(pIndividual, pPopulation);
00055 
00056   //after mutating the individual the objective value may be invalid, so reset it.
00057   pIndividual->ResetObjectiveValue();
00058 };
00059      
00061 template <class TIndividual>
00062 void
00063 MutationBase<TIndividual>
00064 ::SetGeneralObjectiveScales(const ScalesType & scales)
00065 {
00066   itkDebugMacro("setting scales to " <<  scales);
00067   m_GeneralObjectiveScales = scales;
00068   m_ScalesInitialized = true;
00069   this->Modified();
00070 }
00071 
00072 } // end of namespace ES
00073 } // end of namespace FREE
00074 
00075 #endif

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