00001 /*************************************************************************** 00002 * Copyright (C) 2005-2009 by Robot Group Leipzig * 00003 * martius@informatik.uni-leipzig.de * 00004 * fhesse@informatik.uni-leipzig.de * 00005 * der@informatik.uni-leipzig.de * 00006 * guettler@informatik.uni-leipzig.de * 00007 * jhoffmann@informatik.uni-leipzig.de * 00008 * joergweide84@aol.com (robot12) * 00009 * * 00010 * This program is free software; you can redistribute it and/or modify * 00011 * it under the terms of the GNU General Public License as published by * 00012 * the Free Software Foundation; either version 2 of the License, or * 00013 * (at your option) any later version. * 00014 * * 00015 * This program is distributed in the hope that it will be useful, * 00016 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00018 * GNU General Public License for more details. * 00019 * * 00020 * You should have received a copy of the GNU General Public License * 00021 * along with this program; if not, write to the * 00022 * Free Software Foundation, Inc., * 00023 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 00024 *************************************************************************** 00025 * * 00026 * This class implements the IGenerationSize strategy interface for the * 00027 * GenAlgEngine with a fix generation size. * 00028 * * 00029 * $Log: FixGenerationSizeStrategy.h,v $ 00030 * Revision 1.3 2009/07/21 08:37:58 robot12 00031 * add some comments 00032 * 00033 * Revision 1.2 2009/06/16 12:25:32 robot12 00034 * finishing the generation size strategy and implements the comments. 00035 * 00036 * Revision 1.1 2009/05/04 15:27:57 robot12 00037 * rename of some files and moving files to other positions 00038 * - SingletonGenAlgAPI has one error!!! --> is not ready now 00039 * 00040 * Revision 1.4 2009/05/04 07:06:14 robot12 00041 * some implements... Part6 00042 * 00043 * Revision 1.3 2009/04/30 14:32:34 robot12 00044 * some implements... Part5 00045 * 00046 * Revision 1.2 2009/04/30 11:35:53 robot12 00047 * some changes: 00048 * - insert a SelectStrategie 00049 * - insert a MutationStrategie 00050 * - reorganisation of the design 00051 * 00052 * 00053 * 00054 ***************************************************************************/ 00055 00056 #ifndef FIXGENERATIONSIZESTRATEGY_H_ 00057 #define FIXGENERATIONSIZESTRATEGY_H_ 00058 00059 //forward declaration 00060 class Generation; 00061 00062 //ga_tools includes 00063 #include "IGenerationSizeStrategy.h" 00064 00065 /** 00066 * This class implements the generation size strategy with a fix value which is over the constructor given 00067 */ 00068 class FixGenerationSizeStrategy: public IGenerationSizeStrategy { 00069 public: 00070 /** 00071 * constructor 00072 * @param value (int) the fix value which is every time give back by calcGenerationSize. 00073 */ 00074 FixGenerationSizeStrategy(int value); 00075 00076 /** 00077 * default destructor 00078 */ 00079 virtual ~FixGenerationSizeStrategy(); 00080 00081 /** 00082 * gives the fix value m_size as new generation size back. 00083 * @param oldGeneration (Generation*) the old Generation. dont needed 00084 * @return (int) m_size 00085 */ 00086 virtual int calcGenerationSize(Generation* oldGeneration); 00087 00088 protected: 00089 /** 00090 * the fix generation size 00091 */ 00092 int m_size; 00093 00094 private: 00095 /** 00096 * disable the default constructor 00097 */ 00098 FixGenerationSizeStrategy(); 00099 }; 00100 00101 #endif /* FIXGENERATIONSIZESTRATEGY_H_ */