0.0133650302887
3.75138807297
Processing /mnt/build/workspace/root-makedoc-v612/rootspi/rdoc/src/v6-12-00-patches/tutorials/tmva/TMVAGAexample.C...
Start Test TMVAGAexample
========================
EXAMPLE
range: 0 15
range: 0 13
range: 0 5
: fitness: -173.083 f_0: 15 f_1: 12.5389 f_2: 5
---
: fitness: -175.583 f_0: 15 f_1: 12.5389 f_2: 2.5
---
: fitness: -175.583 f_0: 15 f_1: 12.5389 f_2: 2.5
---
: fitness: -175.583 f_0: 15 f_1: 12.5389 f_2: 2.5
---
: fitness: -180.385 f_0: 15 f_1: 12.6924 f_2: 0
---
: fitness: -183.752 f_0: 15 f_1: 12.9168 f_2: 0
---
: fitness: -183.752 f_0: 15 f_1: 12.9168 f_2: 0
---
: fitness: -184.545 f_0: 15 f_1: 12.9697 f_2: 0
---
: fitness: -184.545 f_0: 15 f_1: 12.9697 f_2: 0
---
: fitness: -184.545 f_0: 15 f_1: 12.9697 f_2: 0
---
: fitness: -184.545 f_0: 15 f_1: 12.9697 f_2: 0
---
: fitness: -184.545 f_0: 15 f_1: 12.9697 f_2: 0
---
: fitness: -184.545 f_0: 15 f_1: 12.9697 f_2: 0
---
: fitness: -184.545 f_0: 15 f_1: 12.9697 f_2: 0
---
: fitness: -184.545 f_0: 15 f_1: 12.9697 f_2: 0
---
: fitness: -184.545 f_0: 15 f_1: 12.9697 f_2: 0
---
: fitness: -184.545 f_0: 15 f_1: 12.9697 f_2: 0
---
: fitness: -184.545 f_0: 15 f_1: 12.9697 f_2: 0
---
: fitness: -184.545 f_0: 15 f_1: 12.9697 f_2: 0
---
: fitness: -184.545 f_0: 15 f_1: 12.9697 f_2: 0
---
: fitness: -184.685 f_0: 15 f_1: 12.979 f_2: 0
---
: fitness: -184.685 f_0: 15 f_1: 12.979 f_2: 0
---
: fitness: -184.685 f_0: 15 f_1: 12.979 f_2: 0
---
: fitness: -184.685 f_0: 15 f_1: 12.979 f_2: 0
---
: fitness: -184.685 f_0: 15 f_1: 12.979 f_2: 0
---
: fitness: -184.685 f_0: 15 f_1: 12.979 f_2: 0
---
: fitness: -184.685 f_0: 15 f_1: 12.979 f_2: 0
---
: fitness: -184.685 f_0: 15 f_1: 12.979 f_2: 0
---
: fitness: -184.685 f_0: 15 f_1: 12.979 f_2: 0
---
: fitness: -184.685 f_0: 15 f_1: 12.979 f_2: 0
---
: fitness: -184.685 f_0: 15 f_1: 12.979 f_2: 0
---
: fitness: -184.685 f_0: 15 f_1: 12.979 f_2: 0
---
: fitness: -184.705 f_0: 15 f_1: 12.9803 f_2: 0
---
: fitness: -184.705 f_0: 15 f_1: 12.9803 f_2: 0
---
: fitness: -184.705 f_0: 15 f_1: 12.9803 f_2: 0
---
: fitness: -184.917 f_0: 15 f_1: 12.9945 f_2: 0
---
: fitness: -184.917 f_0: 15 f_1: 12.9945 f_2: 0
---
: fitness: -184.917 f_0: 15 f_1: 12.9945 f_2: 0
---
: fitness: -184.917 f_0: 15 f_1: 12.9945 f_2: 0
---
: fitness: -184.917 f_0: 15 f_1: 12.9945 f_2: 0
---
: fitness: -184.917 f_0: 15 f_1: 12.9945 f_2: 0
---
: fitness: -184.917 f_0: 15 f_1: 12.9945 f_2: 0
---
: fitness: -184.917 f_0: 15 f_1: 12.9945 f_2: 0
---
: fitness: -184.917 f_0: 15 f_1: 12.9945 f_2: 0
---
: fitness: -184.917 f_0: 15 f_1: 12.9945 f_2: 0
---
: fitness: -184.917 f_0: 15 f_1: 12.9945 f_2: 0
---
: fitness: -184.917 f_0: 15 f_1: 12.9945 f_2: 0
---
: fitness: -184.927 f_0: 15 f_1: 12.9951 f_2: 0
---
: fitness: -184.927 f_0: 15 f_1: 12.9951 f_2: 0
---
: fitness: -184.945 f_0: 15 f_1: 12.9963 f_2: 0
---
: fitness: -184.945 f_0: 15 f_1: 12.9963 f_2: 0
---
: fitness: -184.945 f_0: 15 f_1: 12.9963 f_2: 0
---
: fitness: -184.945 f_0: 15 f_1: 12.9963 f_2: 0
---
: fitness: -184.945 f_0: 15 f_1: 12.9963 f_2: 0
---
: fitness: -184.945 f_0: 15 f_1: 12.9963 f_2: 0
---
: fitness: -184.945 f_0: 15 f_1: 12.9963 f_2: 0
---
: fitness: -184.945 f_0: 15 f_1: 12.9963 f_2: 0
---
: fitness: -184.945 f_0: 15 f_1: 12.9963 f_2: 0
---
: fitness: -184.945 f_0: 15 f_1: 12.9963 f_2: 0
---
: fitness: -184.945 f_0: 15 f_1: 12.9963 f_2: 0
---
: fitness: -184.945 f_0: 15 f_1: 12.9963 f_2: 0
---
: fitness: -184.945 f_0: 15 f_1: 12.9963 f_2: 0
---
: fitness: -184.945 f_0: 15 f_1: 12.9963 f_2: 0
---
: fitness: -184.945 f_0: 15 f_1: 12.9963 f_2: 0
---
: fitness: -184.945 f_0: 15 f_1: 12.9963 f_2: 0
---
: fitness: -184.945 f_0: 15 f_1: 12.9963 f_2: 0
---
: fitness: -184.945 f_0: 15 f_1: 12.9963 f_2: 0
---
: fitness: -184.945 f_0: 15 f_1: 12.9963 f_2: 0
---
: fitness: -184.945 f_0: 15 f_1: 12.9963 f_2: 0
---
: fitness: -184.945 f_0: 15 f_1: 12.9963 f_2: 0
---
FACTOR 0 : 15
FACTOR 1 : 12.9963
FACTOR 2 : 0
#include <iostream>
#include <vector>
public:
}
Double_t EstimatorFunction( std::vector<Double_t> & factors ){
return (10.- factors.at(0) *factors.at(1) + factors.at(2));
}
};
public:
size, ranges ){
}
};
void TMVAGAexample() {
std::cout << "Start Test TMVAGAexample" << std::endl
<< "========================" << std::endl
<< "\nEXAMPLE" << std::endl;
vector<Interval*> ranges;
ranges.push_back(
new Interval(0,15,30) );
ranges.push_back(
new Interval(0,5,3) );
for( std::vector<Interval*>::iterator it = ranges.begin(); it != ranges.end(); it++ ){
std::cout << " range: " << (*it)->GetMin() << " " << (*it)->GetMax() << std::endl;
}
MyGA2nd
mg( *myFitness, 100, ranges );
#define CONVSTEPS 20
#define CONVCRIT 0.0001
#define SCSTEPS 10
#define SCRATE 5
#define SCFACTOR 0.95
do {
mg.Init();
mg.CalculateFitness();
mg.GetGeneticPopulation().
Print(0);
std::cout << "---" << std::endl;
mg.GetGeneticPopulation().TrimPopulation();
mg.SpreadControl( SCSTEPS, SCRATE, SCFACTOR );
} while (!mg.HasConverged( CONVSTEPS, CONVCRIT ));
GeneticGenes* genes = mg.GetGeneticPopulation().GetGenes( 0 );
std::vector<Double_t> gvec;
int n = 0;
for( std::vector<Double_t>::iterator it = gvec.begin(); it<gvec.end(); it++ ){
std::cout << "FACTOR " << n << " : " << (*it) << std::endl;
n++;
}
}
int main(
int argc,
char** argv )
{
TMVAGAexample();
}