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
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