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_
1.3.6