62 Double_t value = fRandomGenerator->Uniform(0, 1);
63 return fInterval->GetElement(
Int_t(value*fNbins) );
78 if (fInterval->GetNbins() > 0) {
79 return RandomDiscrete();
81 else if (fFrom == fTo) {
86 ret = fRandomGenerator->Gaus( value, fTotalLength*spread );
87 if (mirror )
return ReMapMirror( ret );
88 else return ReMap( ret );
90 return fRandomGenerator->Uniform(fFrom, fTo);
98 if (fFrom >= fTo )
return val;
99 if (val < fFrom )
return ReMap( (val-fFrom) + fTo );
100 if (val >= fTo )
return ReMap( (val-fTo) + fFrom );
109 if (fFrom >= fTo )
return val;
110 if (val < fFrom )
return ReMap( fFrom - (val-fFrom) );
111 if (val >= fTo )
return ReMap( fTo - (val-fTo) );
Range definition for genetic algorithm.
virtual ~GeneticRange()
destructor
GeneticRange(TRandom3 *rnd, Interval *interval)
defines the "f" (from) and "t" (to) of the coefficient and takes a randomgenerator
Double_t ReMap(Double_t val)
remapping the value to the allowed space
Double_t RandomDiscrete()
creates a new random value for the coefficient; returns a discrete value
Double_t Random(Bool_t near=kFALSE, Double_t value=0, Double_t spread=0.1, Bool_t mirror=kFALSE)
creates a new random value for the coefficient Parameters:
Double_t ReMapMirror(Double_t val)
remapping the value to the allowed space by reflecting on the boundaries
TRandom3 * fRandomGenerator
The TMVA::Interval Class.
virtual Double_t GetMin() const
virtual Double_t GetMax() const
virtual Int_t GetNbins() const
Random number generator class based on M.