Definition at line 56 of file GeneticAlgorithm.h.
#include <TMVA/GeneticAlgorithm.h>
◆ GeneticAlgorithm()
Constructor Parameters: int populationSize : defines the number of "Individuals" which are created and tested within one Generation (Iteration of the Evolution) std::vector<TMVA::Interval*> ranges : Interval holds the information of an interval, where the GetMin gets the low and GetMax gets the high constraint of the variable the size of "ranges" is the number of coefficients which are optimised Purpose: Creates a random population with individuals of the size ranges.size()
Definition at line 65 of file GeneticAlgorithm.cxx.
◆ ~GeneticAlgorithm()
TMVA::GeneticAlgorithm::~GeneticAlgorithm |
( |
| ) |
|
|
virtual |
◆ CalculateFitness()
Double_t TMVA::GeneticAlgorithm::CalculateFitness |
( |
| ) |
|
|
virtual |
starts the evaluation of the fitness of all different individuals of the population.
this function calls implicitly (many times) the "fitnessFunction" which has been overridden by the user.
Definition at line 131 of file GeneticAlgorithm.cxx.
◆ Evolution()
void TMVA::GeneticAlgorithm::Evolution |
( |
| ) |
|
|
virtual |
this function is called from "init" and controls the evolution of the individuals.
the function can be overridden to change the parameters for mutation rate sexual reproduction and so on.
Definition at line 185 of file GeneticAlgorithm.cxx.
◆ GetGeneticPopulation()
◆ GetMakeCopies()
Bool_t TMVA::GeneticAlgorithm::GetMakeCopies |
( |
| ) |
|
|
inline |
◆ GetSpread()
Double_t TMVA::GeneticAlgorithm::GetSpread |
( |
| ) |
const |
|
inline |
◆ HasConverged()
gives back true if the last "steps" steps have lead to an improvement of the "fitness" of the "individuals" of at least "improvement"
this gives a simple measure of if the fitness of the individuals is converging and no major improvement is to be expected soon.
Definition at line 255 of file GeneticAlgorithm.cxx.
◆ Init()
void TMVA::GeneticAlgorithm::Init |
( |
void |
| ) |
|
calls evolution, but if it is not the first time.
If it's the first time, the random population created by the constructor is still not evaluated, .. therefore we wait for the second time init is called.
Definition at line 97 of file GeneticAlgorithm.cxx.
◆ Log()
MsgLogger& TMVA::GeneticAlgorithm::Log |
( |
| ) |
const |
|
inlineprotected |
◆ NewFitness()
if the "fitnessFunction" is called multiple times for one set of factors (because i.e.
each event of a TTree has to be assessed with each set of Factors proposed by the Genetic Algorithm) the value of the current calculation has to be added(? or else) to the value obtained up to now. example: some chi-square is calculated for every event, after every event the new chi-square (newValue) has to be simply added to the oldValue.
this function has to be overridden eventually it might contain only the following return statement. return oldValue + newValue;
Definition at line 119 of file GeneticAlgorithm.cxx.
◆ SetMakeCopies()
void TMVA::GeneticAlgorithm::SetMakeCopies |
( |
Bool_t |
s | ) |
|
|
inline |
◆ SetSpread()
◆ SpreadControl()
this function provides the ability to change the stepSize of a mutation according to the success of the last generations.
Parameters: int ofSteps : = if OF the number of STEPS given in this variable (ofSteps) int successSteps : >sucessSteps Generations could improve the result double factor : than multiply the stepSize ( spread ) by this factor (if ofSteps == successSteps nothing is changed, if ofSteps < successSteps, the spread is divided by the factor)
using this function one can increase the stepSize of the mutation when we have good success (to pass fast through the easy phase-space) and reduce the stepSize if we are in a difficult "territory" of the phase-space.
Definition at line 211 of file GeneticAlgorithm.cxx.
◆ fBestFitness
Double_t TMVA::GeneticAlgorithm::fBestFitness |
|
protected |
◆ fConvCounter
Int_t TMVA::GeneticAlgorithm::fConvCounter |
◆ fConvValue
Double_t TMVA::GeneticAlgorithm::fConvValue |
|
protected |
◆ fFirstTime
Bool_t TMVA::GeneticAlgorithm::fFirstTime |
|
protected |
◆ fFitterTarget
◆ fLastResult
Double_t TMVA::GeneticAlgorithm::fLastResult |
|
protected |
◆ fLogger
◆ fMakeCopies
Bool_t TMVA::GeneticAlgorithm::fMakeCopies |
|
protected |
◆ fMirror
Bool_t TMVA::GeneticAlgorithm::fMirror |
|
protected |
◆ fPopulation
◆ fPopulationSize
Int_t TMVA::GeneticAlgorithm::fPopulationSize |
|
protected |
◆ fRanges
◆ fSpread
Double_t TMVA::GeneticAlgorithm::fSpread |
|
protected |
◆ fSuccessList
std::deque<Int_t> TMVA::GeneticAlgorithm::fSuccessList |
|
protected |
The documentation for this class was generated from the following files: