00001 #ifndef Individual_h 00002 #define Individual_h 00003 00004 #include "Genotype.h" 00005 #include "Fitness.h" 00006 00011 class Individual : public std::vector <GenotypeP> 00012 { 00013 protected: 00014 StateP state_; 00015 00016 public: 00017 Individual() 00018 { 00019 cid = 0; 00020 } 00021 00022 Individual(StateP state); 00023 00024 bool initialize(StateP state); 00025 00026 void write(XMLNode&); 00027 00028 void read(XMLNode&); 00029 00030 std::string toString(); 00031 00032 Individual* copy(); 00033 00034 GenotypeP getGenotype(uint index = 0); 00035 00036 FitnessP fitness; 00037 00038 unsigned int index; 00039 00040 unsigned int cid; 00041 }; 00042 typedef boost::shared_ptr<Individual> IndividualP; 00043 00044 #endif // Individual_h 00045