49 fFrom = fInterval->GetMin();
50 fTo = fInterval->GetMax();
51 fNbins= fInterval->GetNbins();
52 fTotalLength = fTo-fFrom;
54 fRandomGenerator = rnd;
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) );
Random number generator class based on M.
TRandom3 * fRandomGenerator
Double_t ReMapMirror(Double_t val)
remapping the value to the allowed space by reflecting on the boundaries
virtual Double_t GetElement(Int_t position) const
calculates the value of the "number" bin in a discrete interval.
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:
The TMVA::Interval Class.
Double_t ReMap(Double_t val)
remapping the value to the allowed space
virtual ~GeneticRange()
destructor
virtual Double_t Uniform(Double_t x1=1)
Returns a uniform deviate on the interval (0, x1).
Double_t RandomDiscrete()
creates a new random value for the coefficient; returns a discrete value
Range definition for genetic algorithm.