27 class MyFitness :
public IFitterTarget {
29 MyFitness() : IFitterTarget() {
43 Double_t EstimatorFunction( std::vector<Double_t> & factors ){
45 return (10.- factors.at(0) *factors.at(1) + factors.at(2));
59 std::cout <<
"\nEXAMPLE" << std::endl;
62 vector<Interval*> ranges;
63 ranges.push_back(
new Interval(0,15,30) );
64 ranges.push_back(
new Interval(0,13) );
65 ranges.push_back(
new Interval(0,5,3) );
67 for( std::vector<Interval*>::iterator it = ranges.begin(); it != ranges.end(); it++ ){
68 std::cout <<
" range: " << (*it)->GetMin() <<
" " << (*it)->GetMax() << std::endl;
71 IFitterTarget* myFitness =
new MyFitness();
79 const TString
name(
"exampleGA" );
80 const TString opts(
"PopSize=100:Steps=30" );
82 GeneticFitter
mg( *myFitness,
name, ranges, opts);
85 std::vector<Double_t> result;
89 for( std::vector<Double_t>::iterator it = result.begin(); it<result.end(); it++ ){
90 std::cout <<
"FACTOR " << n <<
" : " << (*it) << std::endl;
100 void TMVAGAexample2() {
101 cout <<
"Start Test TMVAGAexample" << endl
102 <<
"========================" << endl
110 int main(
int argc,
char** argv )
static constexpr double mg
int main(int argc, char **argv)
Abstract ClassifierFactory template that handles arbitrary types.