35#ifdef _GLIBCXX_PARALLEL
69 const std::vector<Interval*>& ranges,
UInt_t seed )
102 if ( fFirstTime ) fFirstTime =
kFALSE;
137#ifdef _GLIBCXX_PARALLEL
141 for (
int i =0; i <
nt; ++i )
142 bests[i] = fBestFitness;
148 for (
int index = 0;
index < fPopulation.GetPopulationSize(); ++
index )
152 fFitterTarget.EstimatorFunction(
genes->GetFactors()) );
164 for (
int index = 0;
index < fPopulation.GetPopulationSize(); ++
index ) {
167 fFitterTarget.EstimatorFunction(
genes->GetFactors()) );
192 fPopulation.MakeCopies( 5 );
193 fPopulation.MakeChildren();
195 fPopulation.Mutate( 10, 3,
kTRUE, fSpread, fMirror );
196 fPopulation.Mutate( 40, fPopulation.GetPopulationSize()*3/4 );
219 if ( fBestFitness < fLastResult || fSuccessList.size() <=0 ) {
220 fLastResult = fBestFitness;
221 fSuccessList.push_front( 1 );
224 fSuccessList.push_front( 0 );
228 std::deque<Int_t>::iterator
vec = fSuccessList.begin();
229 for (;
vec != fSuccessList.end() ; ++
vec) {
235 fSuccessList.pop_back();
238 if (GeneticAlgorithm__DEBUG__) Log() << kINFO <<
">" << std::flush;
241 if (GeneticAlgorithm__DEBUG__) Log() <<
"=" << std::flush;
245 if (GeneticAlgorithm__DEBUG__) Log() <<
"<" << std::flush;
261 if (fConvCounter < 0) {
262 fConvValue = fBestFitness;
269 fConvValue = fBestFitness;
271 if (GeneticAlgorithm__DEBUG__) Log() <<
"." << std::flush;
Basic types used by ROOT and required by TInterpreter.
bool Bool_t
Boolean (0=false, 1=true) (bool)
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t target
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
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...
GeneticPopulation fPopulation
void Init()
calls evolution, but if it is not the first time.
virtual void Evolution()
this function is called from "init" and controls the evolution of the individuals.
virtual ~GeneticAlgorithm()
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....
Cut optimisation interface class for genetic algorithm.
void SetRandomSeed(UInt_t seed=0)
the random seed of the random generator
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)