Population definition for genetic algorithm.
Definition at line 48 of file GeneticPopulation.h.
Public Member Functions | |
GeneticPopulation (const std::vector< TMVA::Interval * > &ranges, Int_t size, UInt_t seed=0) | |
Constructor. | |
virtual | ~GeneticPopulation () |
destructor | |
void | AddPopulation (GeneticPopulation &strangers) |
add another population (strangers) to the one of this GeneticPopulation | |
void | AddPopulation (GeneticPopulation *strangers) |
add another population (strangers) to the one of this GeneticPopulation | |
Double_t | GetFitness () const |
std::vector< TMVA::GeneticGenes > & | GetGenePool () |
const std::vector< TMVA::GeneticGenes > & | GetGenePool () const |
GeneticGenes * | GetGenes (Int_t index) |
gives back the "Genes" of the population with the given index. | |
Int_t | GetPopulationSize () const |
std::vector< TMVA::GeneticRange * > & | GetRanges () |
const std::vector< TMVA::GeneticRange * > & | GetRanges () const |
void | GiveHint (std::vector< Double_t > &hint, Double_t fitness=0) |
add an individual (a set of variables) to the population if there is a set of variables which is known to perform good, they can be given as a hint to the population | |
void | MakeChildren () |
Creates children out of members of the current generation. | |
void | MakeCopies (int number) |
Produces offspring which is are copies of their parents. | |
void | Mutate (Double_t probability=20, Int_t startIndex=0, Bool_t near=kFALSE, Double_t spread=0.1, Bool_t mirror=kFALSE) |
Mutates the individuals in the genePool. | |
void | NextGeneration () |
void | Print (Int_t untilIndex=-1) |
make a little printout of the individuals up to index "untilIndex" this means, . | |
void | Print (std::ostream &out, Int_t utilIndex=-1) |
make a little printout to the stream "out" of the individuals up to index "untilIndex" this means, . | |
void | SetRandomSeed (UInt_t seed=0) |
the random seed of the random generator | |
void | Sort () |
sort the genepool according to the fitness of the individuals | |
void | TrimPopulation () |
trim the population to the predefined size | |
std::vector< Double_t > | VariableDistribution (Int_t varNumber) |
gives back all the values of coefficient "varNumber" of the current generation | |
TH1F * | VariableDistribution (Int_t varNumber, Int_t bins, Int_t min, Int_t max) |
give back a histogram with the distribution of the coefficients. | |
Private Member Functions | |
MsgLogger & | Log () const |
GeneticGenes | MakeSex (GeneticGenes male, GeneticGenes female) |
this function takes two individuals and produces offspring by mixing (recombining) their coefficients. | |
Private Attributes | |
std::vector< TMVA::GeneticGenes > | fGenePool |
MsgLogger * | fLogger |
Int_t | fPopulationSizeLimit |
TRandom3 * | fRandomGenerator |
std::vector< TMVA::GeneticRange * > | fRanges |
#include <TMVA/GeneticPopulation.h>
TMVA::GeneticPopulation::GeneticPopulation | ( | const std::vector< TMVA::Interval * > & | ranges, |
Int_t | size, | ||
UInt_t | seed = 0 |
||
) |
Constructor.
Definition at line 49 of file GeneticPopulation.cxx.
|
virtual |
destructor
Definition at line 78 of file GeneticPopulation.cxx.
void TMVA::GeneticPopulation::AddPopulation | ( | GeneticPopulation & | strangers | ) |
add another population (strangers) to the one of this GeneticPopulation
Definition at line 291 of file GeneticPopulation.cxx.
void TMVA::GeneticPopulation::AddPopulation | ( | GeneticPopulation * | strangers | ) |
add another population (strangers) to the one of this GeneticPopulation
Definition at line 280 of file GeneticPopulation.cxx.
|
inline |
Definition at line 63 of file GeneticPopulation.h.
|
inline |
Definition at line 68 of file GeneticPopulation.h.
|
inline |
Definition at line 65 of file GeneticPopulation.h.
TMVA::GeneticGenes * TMVA::GeneticPopulation::GetGenes | ( | Int_t | index | ) |
gives back the "Genes" of the population with the given index.
Definition at line 194 of file GeneticPopulation.cxx.
|
inline |
Definition at line 62 of file GeneticPopulation.h.
|
inline |
Definition at line 69 of file GeneticPopulation.h.
|
inline |
Definition at line 66 of file GeneticPopulation.h.
add an individual (a set of variables) to the population if there is a set of variables which is known to perform good, they can be given as a hint to the population
Definition at line 310 of file GeneticPopulation.cxx.
|
inlineprivate |
Definition at line 100 of file GeneticPopulation.h.
void TMVA::GeneticPopulation::MakeChildren | ( | ) |
Creates children out of members of the current generation.
Children have a combination of the coefficients of their parents
Definition at line 119 of file GeneticPopulation.cxx.
Produces offspring which is are copies of their parents.
Parameters:
Definition at line 104 of file GeneticPopulation.cxx.
|
private |
this function takes two individuals and produces offspring by mixing (recombining) their coefficients.
Definition at line 136 of file GeneticPopulation.cxx.
void TMVA::GeneticPopulation::Mutate | ( | Double_t | probability = 20 , |
Int_t | startIndex = 0 , |
||
Bool_t | near = kFALSE , |
||
Double_t | spread = 0.1 , |
||
Bool_t | mirror = kFALSE |
||
) |
Mutates the individuals in the genePool.
Parameters:
Definition at line 168 of file GeneticPopulation.cxx.
|
inline |
Definition at line 82 of file GeneticPopulation.h.
make a little printout of the individuals up to index "untilIndex" this means, .
. write out the best "untilIndex" individuals.
Definition at line 203 of file GeneticPopulation.cxx.
make a little printout to the stream "out" of the individuals up to index "untilIndex" this means, .
. write out the best "untilIndex" individuals.
Definition at line 225 of file GeneticPopulation.cxx.
the random seed of the random generator
Definition at line 93 of file GeneticPopulation.cxx.
void TMVA::GeneticPopulation::Sort | ( | ) |
sort the genepool according to the fitness of the individuals
Definition at line 321 of file GeneticPopulation.cxx.
void TMVA::GeneticPopulation::TrimPopulation | ( | ) |
trim the population to the predefined size
Definition at line 299 of file GeneticPopulation.cxx.
gives back all the values of coefficient "varNumber" of the current generation
Definition at line 268 of file GeneticPopulation.cxx.
TH1F * TMVA::GeneticPopulation::VariableDistribution | ( | Int_t | varNumber, |
Int_t | bins, | ||
Int_t | min, | ||
Int_t | max | ||
) |
give back a histogram with the distribution of the coefficients.
Parameters:
Definition at line 251 of file GeneticPopulation.cxx.
|
private |
Definition at line 94 of file GeneticPopulation.h.
|
mutableprivate |
Definition at line 99 of file GeneticPopulation.h.
|
private |
Definition at line 102 of file GeneticPopulation.h.
|
private |
Definition at line 97 of file GeneticPopulation.h.
|
private |
Definition at line 95 of file GeneticPopulation.h.