freESPopulation.h

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: freESPopulation.h,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 __freESPopulation_h
00023 #define __freESPopulation_h
00024 
00025 #include "itkVectorContainer.h"
00026 
00027 namespace FREE
00028 {
00029   namespace ES
00030   {
00034     template <class TIndividual>
00035     class ITK_EXPORT Population :
00036       public itk::VectorContainer<unsigned long, typename TIndividual::Pointer>
00037     {
00038     public:
00039       /* Standard class typedefs. */
00040       typedef Population<TIndividual> Self;
00041       typedef itk::VectorContainer<unsigned long, typename TIndividual::Pointer> Superclass;
00042       typedef itk::SmartPointer<Self> Pointer;
00043       typedef itk::SmartPointer<const Self> ConstPointer;
00044 
00045       /* Method for creation through the object factory. */
00046       itkNewMacro(Self);
00047 
00048       /* Run-time type information (and related methods). */
00049       itkTypeMacro(Population, VectorContainer);
00050 
00051       /* Other typedefs */
00052       typedef TIndividual                                         IndividualType;
00053       typedef typename IndividualType::Pointer                    IndividualPointer;
00054       typedef typename Superclass::ElementIdentifier              ElementIdentifier;
00055       typedef unsigned long                                       GenerationIDType;
00056       typedef unsigned long                                       IndividualIDType;
00057 
00058       typedef typename IndividualType::StrategicParametersType    StrategicParametersType;
00059 
00060       GenerationIDType GetGenerationID() const {return m_GenerationID;};
00061       void SetGenerationID(GenerationIDType id) {m_GenerationID = id;};
00062 
00063       //Is usede to generate an unique ID for a new individual within the population.
00064       IndividualIDType GenerateUniqueIndividualID() {return m_UniqueID++;} ;
00065 
00066       IndividualIDType GetLastUniqueIndividualID() const {return m_UniqueID;} ;
00067 
00068       IndividualType* GetIndividualByUniqueID(IndividualIDType iID);
00069 
00073       itkSetObjectMacro(BestIndividualEver, IndividualType);
00076       itkGetConstObjectMacro(BestIndividualEver, IndividualType);
00077       itkGetObjectMacro(BestIndividualEver, IndividualType);
00078 
00082       itkSetObjectMacro(BestIndividual, IndividualType);
00085       itkGetConstObjectMacro(BestIndividual, IndividualType);
00086       itkGetObjectMacro(BestIndividual, IndividualType);
00087 
00088       const StrategicParametersType& StrategicParameters() const
00089       {
00090         return *(m_StrategicParameters.GetPointer());
00091       };
00092 
00093       StrategicParametersType& StrategicParameters()
00094       {
00095         return *(m_StrategicParameters.GetPointer());
00096       };
00097 
00098       virtual Pointer Clone() const;
00099 
00100     protected:
00103       Population();
00104       virtual ~Population(){}
00105 
00106       GenerationIDType m_GenerationID;
00107       IndividualIDType m_UniqueID;
00108 
00110       typename StrategicParametersType::Pointer m_StrategicParameters;
00111 
00114       IndividualPointer m_BestIndividualEver;
00115 
00118       IndividualPointer m_BestIndividual;
00119 
00120       virtual void PrintSelf(std::ostream& os, itk::Indent indent) const;
00121 
00122       void operator=(Self const& population);
00123 
00124     private:
00125       Population(Self const&); // Purposely not implemented.
00126     };
00127 
00128   } //end namspsace ES
00129 } // end namespace FREE
00130 
00131 #ifndef ITK_MANUAL_INSTANTIATION
00132 #include "freESPopulation.txx"
00133 #endif
00134 
00135 #endif // __freESPopulations_h

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