00001 /** 00002 * @file Individual.h 00003 * 00004 * Declaration of class Individual 00005 * 00006 * @author <a href=mailto:dueffert@informatik.hu-berlin.de>Uwe Düffert</a> 00007 * @author <a href="mailto:a.cesarz@gmx.de">Arthur Cesarz</a> 00008 * @author <a href="mailto:matthias.hebbel@uni-dortmund.de">Matthias Hebbel</a> 00009 */ 00010 00011 #ifndef __Individual_h_ 00012 #define __Individual_h_ 00013 00014 /** 00015 * @class Individual 00016 * 00017 * This is a base class for all parameters sets we want to use in evolution. 00018 */ 00019 class Individual 00020 { 00021 public: 00022 00023 /** Constructor. */ 00024 Individual(); 00025 00026 typedef enum ValueType {valueInt, valueDouble, value2PiDouble} ValueType; 00027 00028 virtual void getDimension(int& dim1, int& dim2)=0; 00029 virtual void getValue(int index1, int index2, double& min, double& max, double& value, ValueType& type)=0; 00030 virtual void setValue(int index1, int index2, double value)=0; 00031 00032 /** let this Individual be the mutation of another one: maximum rate of the genes are mutated by maximum amount of (max-min) 00033 * @param father Take this as original to copy from before mutation 00034 * @param rate Do mutate with this maximum rate, 0.0...1.0 is useful, 0.5 would mutate up to every second gene 00035 * @param amount Do mutate single genes at maximum amount*(maxValue-minValue) 00036 * @param uniformNoise Do mutate with uniform distributed noise if true, with normal distributed otherwise 00037 */ 00038 void mutationOf(Individual* father, double rate, double amount, bool uniformNoise=false/*, other EvoParams*/); 00039 00040 /** let this Individual be the crossing over of father and mother 00041 * even genes are taken from father, uneven from mother 00042 * @param father Take this as original father to copy one half of the genes from 00043 * @param mother Take this as original mother to copy one half of the genes from 00044 */ 00045 void crossingOverOf(Individual* father, Individual* mother/*, other EvoParams*/); 00046 00047 double fitness; 00048 }; 00049 00050 #endif //__Individual_h_ 00051 00052 /* 00053 * Change log : 00054 * 00055 * $Log: Individual.h,v $ 00056 * Revision 1.1.1.1 2004/05/22 17:36:14 cvsadm 00057 * created new repository GT2004_WM 00058 * 00059 * Revision 1.2 2004/03/24 13:44:49 dueffert 00060 * support for uniform noise mutation readded 00061 * 00062 * Revision 1.1 2003/10/07 10:13:22 cvsadm 00063 * Created GT2004 (M.J.) 00064 * 00065 * Revision 1.1 2003/09/26 11:40:40 juengel 00066 * - sorted tools 00067 * - clean-up in DataTypes 00068 * 00069 * Revision 1.4 2003/09/01 15:57:42 dueffert 00070 * Genom and Individual merged 00071 * 00072 * Revision 1.3 2003/08/08 14:27:07 dueffert 00073 * implementation added 00074 * 00075 * Revision 1.2 2003/07/30 14:48:11 dueffert 00076 * comments corrected 00077 * 00078 * Revision 1.1.1.1 2003/07/02 09:40:22 cvsadm 00079 * created new repository for the competitions in Padova from the 00080 * tamara CVS (Tuesday 2:00 pm) 00081 * 00082 * removed unused solutions 00083 * 00084 * Revision 1.1 2003/02/10 15:26:58 dueffert 00085 * self made GA stuff 00086 * 00087 * 00088 */