22using std::vector, std::cout, std::endl;
27class 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();
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;
100void TMVAGAexample2() {
101 cout <<
"Start Test TMVAGAexample" << endl
102 <<
"========================" << endl
110int main(
int argc,
char** argv )
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 result
create variable transformations