35#ifdef _GLIBCXX_PARALLEL
69 const std::vector<Interval*>& ranges,
UInt_t seed )
137#ifdef _GLIBCXX_PARALLEL
139 const int nt = omp_get_num_threads();
141 for (
int i =0; i < nt; ++i )
146 int thread_number = omp_get_thread_num();
148 for (
int index = 0; index <
fPopulation.GetPopulationSize(); ++index )
155 if ( bests[thread_number] > fitness )
156 bests[thread_number] = fitness;
164 for (
int index = 0; index <
fPopulation.GetPopulationSize(); ++index ) {
234 if (
n >= ofSteps ) {
236 if (
sum > successSteps ) {
238 if (GeneticAlgorithm__DEBUG__)
Log() << kINFO <<
">" << std::flush;
240 else if (
sum == successSteps ) {
241 if (GeneticAlgorithm__DEBUG__)
Log() <<
"=" << std::flush;
245 if (GeneticAlgorithm__DEBUG__)
Log() <<
"<" << std::flush;
271 if (GeneticAlgorithm__DEBUG__)
Log() <<
"." << std::flush;
Basic types used by ROOT and required by TInterpreter.
int Int_t
Signed integer 4 bytes (int).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
bool Bool_t
Boolean (0=false, 1=true) (bool).
double Double_t
Double 8 bytes.
virtual Double_t SpreadControl(Int_t steps, Int_t ofSteps, Double_t factor)
this function provides the ability to change the stepSize of a mutation according to the success of t...
virtual Bool_t HasConverged(Int_t steps=10, Double_t ratio=0.1)
gives back true if the last "steps" steps have lead to an improvement of the "fitness" of the "indivi...
const std::vector< TMVA::Interval * > & fRanges
GeneticPopulation fPopulation
void Init()
calls evolution, but if it is not the first time.
std::deque< Int_t > fSuccessList
virtual void Evolution()
this function is called from "init" and controls the evolution of the individuals.
virtual ~GeneticAlgorithm()
IFitterTarget & fFitterTarget
virtual Double_t CalculateFitness()
starts the evaluation of the fitness of all different individuals of the population.
GeneticAlgorithm(IFitterTarget &target, Int_t populationSize, const std::vector< TMVA::Interval * > &ranges, UInt_t seed=0)
Constructor.
virtual Double_t NewFitness(Double_t oldValue, Double_t newValue)
if the "fitnessFunction" is called multiple times for one set of factors (because i....
MsgLogger * fLogger
! message logger
Cut optimisation interface class for genetic algorithm.
void SetFitness(Double_t fitness)
std::vector< Double_t > & GetFactors()
Double_t GetFitness() const
Interface for a fitter 'target'.
ostringstream derivative to redirect and format output
const Bool_t GeneticAlgorithm__DEBUG__
create variable transformations
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.
static uint64_t sum(uint64_t i)