• Main Page
  • Modules
  • Classes
  • Files
  • File List

D:/Projekt/ECF_trunk/ECF/Mutation.h

00001 #ifndef Mutation_h
00002 #define Mutation_h
00003 
00004 class Individual;
00005 typedef boost::shared_ptr<Individual> IndividualP;
00006 class Genotype;
00007 typedef boost::shared_ptr<Genotype>  GenotypeP;
00008 
00016 class MutationOp
00017 {
00018 public:
00019     MutationOp()
00020     {   probability_ = 0;   }
00021 
00026     virtual bool mutate(GenotypeP) = 0;
00027 
00029     virtual bool initialize(StateP)
00030     {   return true;    }
00031 
00033     virtual void registerParameters(StateP)
00034     {   }
00035 
00036     virtual ~MutationOp()
00037     {   }
00038 
00039     StateP state_;
00040     double probability_;    
00041     GenotypeP myGenotype_;  
00042 };
00043 typedef boost::shared_ptr<MutationOp> MutationOpP;
00044 
00045 
00054 class Mutation
00055 {
00056 public:
00057     bool mutate(IndividualP ind);
00058     uint mutation(const std::vector<IndividualP>&);
00059     void registerParameters(StateP);
00060     bool initialize(StateP);
00061 
00062     std::vector< std::vector<MutationOpP> > operators;  
00063     std::vector< std::vector<double> > opProb;          
00064 
00065     IndividualP currentInd; // samo za ad hoc lokalnu pretragu!
00066 
00067 protected:
00068     StateP state_;
00069     double indMutProb_;                     
00070     uint mutateGenotypes_;                  
00071     std::vector<bool> protectedGenotypes_;  
00072 
00073 };
00074 typedef boost::shared_ptr<Mutation> MutationP;
00075 
00076 #endif // Mutation_h

Generated on Thu Oct 6 2011 13:41:01 for ECF by  doxygen 1.7.1