43 TMVA::GeneticRange::GeneticRange(
TRandom3*rnd, Interval *interval )
47 fFrom = fInterval->GetMin();
48 fTo = fInterval->GetMax();
49 fNbins= fInterval->GetNbins();
50 fTotalLength = fTo-fFrom;
52 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);
99 if (fFrom >= fTo )
return val;
100 if (val < fFrom )
return ReMap( (val-fFrom) + fTo );
101 if (val >= fTo )
return ReMap( (val-fTo) + fFrom );
111 if (fFrom >= fTo )
return val;
112 if (val < fFrom )
return ReMap( fFrom - (val-fFrom) );
113 if (val >= fTo )
return ReMap( fTo - (val-fTo) );
Random number generator class based on M.
TRandom3 * fRandomGenerator
ClassImp(TMVA::GeneticRange) TMVA
defines the "f" (from) and "t" (to) of the coefficient and takes a randomgenerator ...
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: Bool_t near : takes a random value near th...
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).
Abstract ClassifierFactory template that handles arbitrary types.
Double_t RandomDiscrete()
creates a new random value for the coefficient; returns a discrete value