41 Double_t EstimatorFunction( std::vector<Double_t> & factors ){
43 return (10.- factors.at(0) *factors.at(1) + factors.at(2));
80 std::cout <<
"Start Test TMVAGAexample" << std::endl
81 <<
"========================" << std::endl
82 <<
"\nEXAMPLE" << std::endl;
85 vector<Interval*> ranges;
86 ranges.push_back(
new Interval(0,15,30) );
87 ranges.push_back(
new Interval(0,13) );
88 ranges.push_back(
new Interval(0,5,3) );
90 for( std::vector<Interval*>::iterator it = ranges.begin(); it != ranges.end(); it++ ){
91 std::cout <<
" range: " << (*it)->GetMin() <<
" " << (*it)->GetMax() << std::endl;
102 MyGA2nd mg( *myFitness, 100, ranges );
106 #define CONVCRIT 0.0001
109 #define SCFACTOR 0.95
116 mg.CalculateFitness();
118 mg.GetGeneticPopulation().Print(0);
119 std::cout <<
"---" << std::endl;
122 mg.GetGeneticPopulation().TrimPopulation();
132 mg.SpreadControl( SCSTEPS, SCRATE, SCFACTOR );
134 }
while (!mg.HasConverged( CONVSTEPS, CONVCRIT ));
136 GeneticGenes* genes = mg.GetGeneticPopulation().GetGenes( 0 );
137 std::vector<Double_t> gvec;
140 for( std::vector<Double_t>::iterator it = gvec.begin(); it<gvec.end(); it++ ){
141 std::cout <<
"FACTOR " <<
n <<
" : " << (*it) << std::endl;
147int main(
int argc,
char** argv )
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
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
Base definition for genetic algorithm.
Cut optimisation interface class for genetic algorithm.
std::vector< Double_t > & GetFactors()
Interface for a fitter 'target'.
The TMVA::Interval Class.
create variable transformations