Start Test TMVAGAexample
========================
EXAMPLE
range: 0 15
range: 0 13
range: 0 5
: fitness: -153.684 f_0: 13.9655 f_1: 12.0786 f_2: 5
---
: fitness: -153.684 f_0: 13.9655 f_1: 12.0786 f_2: 5
---
: fitness: -167.599 f_0: 15 f_1: 11.8399 f_2: 0
---
: fitness: -167.599 f_0: 15 f_1: 11.8399 f_2: 0
---
: fitness: -168.45 f_0: 14.4828 f_1: 12.6668 f_2: 5
---
: fitness: -173.134 f_0: 15 f_1: 12.209 f_2: 0
---
: fitness: -177.222 f_0: 14.4828 f_1: 12.9273 f_2: 0
---
: fitness: -177.284 f_0: 14.4828 f_1: 12.9315 f_2: 0
---
: fitness: -177.935 f_0: 15 f_1: 12.8624 f_2: 5
---
: fitness: -180.001 f_0: 15 f_1: 12.6668 f_2: 0
---
: fitness: -183.909 f_0: 15 f_1: 12.9273 f_2: 0
---
: fitness: -183.909 f_0: 15 f_1: 12.9273 f_2: 0
---
: fitness: -184.187 f_0: 15 f_1: 12.9458 f_2: 0
---
: fitness: -184.187 f_0: 15 f_1: 12.9458 f_2: 0
---
: fitness: -184.187 f_0: 15 f_1: 12.9458 f_2: 0
---
: fitness: -184.187 f_0: 15 f_1: 12.9458 f_2: 0
---
: fitness: -184.187 f_0: 15 f_1: 12.9458 f_2: 0
---
: fitness: -184.427 f_0: 15 f_1: 12.9618 f_2: 0
---
: fitness: -184.427 f_0: 15 f_1: 12.9618 f_2: 0
---
: fitness: -184.893 f_0: 15 f_1: 12.9929 f_2: 0
---
: fitness: -184.893 f_0: 15 f_1: 12.9929 f_2: 0
---
: fitness: -184.893 f_0: 15 f_1: 12.9929 f_2: 0
---
: fitness: -184.893 f_0: 15 f_1: 12.9929 f_2: 0
---
: fitness: -184.893 f_0: 15 f_1: 12.9929 f_2: 0
---
: fitness: -184.893 f_0: 15 f_1: 12.9929 f_2: 0
---
: fitness: -184.893 f_0: 15 f_1: 12.9929 f_2: 0
---
: fitness: -184.893 f_0: 15 f_1: 12.9929 f_2: 0
---
: fitness: -184.893 f_0: 15 f_1: 12.9929 f_2: 0
---
: fitness: -184.893 f_0: 15 f_1: 12.9929 f_2: 0
---
: fitness: -184.893 f_0: 15 f_1: 12.9929 f_2: 0
---
: fitness: -184.893 f_0: 15 f_1: 12.9929 f_2: 0
---
: fitness: -184.893 f_0: 15 f_1: 12.9929 f_2: 0
---
: fitness: -184.893 f_0: 15 f_1: 12.9929 f_2: 0
---
: fitness: -184.893 f_0: 15 f_1: 12.9929 f_2: 0
---
: fitness: -184.893 f_0: 15 f_1: 12.9929 f_2: 0
---
: fitness: -184.923 f_0: 15 f_1: 12.9949 f_2: 0
---
: fitness: -184.923 f_0: 15 f_1: 12.9949 f_2: 0
---
: fitness: -184.923 f_0: 15 f_1: 12.9949 f_2: 0
---
: fitness: -184.923 f_0: 15 f_1: 12.9949 f_2: 0
---
: fitness: -184.923 f_0: 15 f_1: 12.9949 f_2: 0
---
: fitness: -184.923 f_0: 15 f_1: 12.9949 f_2: 0
---
: fitness: -184.923 f_0: 15 f_1: 12.9949 f_2: 0
---
: fitness: -184.923 f_0: 15 f_1: 12.9949 f_2: 0
---
: fitness: -184.923 f_0: 15 f_1: 12.9949 f_2: 0
---
: fitness: -184.923 f_0: 15 f_1: 12.9949 f_2: 0
---
: fitness: -184.923 f_0: 15 f_1: 12.9949 f_2: 0
---
: fitness: -184.923 f_0: 15 f_1: 12.9949 f_2: 0
---
: fitness: -184.923 f_0: 15 f_1: 12.9949 f_2: 0
---
: fitness: -184.985 f_0: 15 f_1: 12.999 f_2: 0
---
: fitness: -184.985 f_0: 15 f_1: 12.999 f_2: 0
---
: fitness: -184.985 f_0: 15 f_1: 12.999 f_2: 0
---
: fitness: -184.985 f_0: 15 f_1: 12.999 f_2: 0
---
: fitness: -184.985 f_0: 15 f_1: 12.999 f_2: 0
---
: fitness: -184.985 f_0: 15 f_1: 12.999 f_2: 0
---
: fitness: -184.985 f_0: 15 f_1: 12.999 f_2: 0
---
: fitness: -184.985 f_0: 15 f_1: 12.999 f_2: 0
---
: fitness: -184.985 f_0: 15 f_1: 12.999 f_2: 0
---
: fitness: -184.985 f_0: 15 f_1: 12.999 f_2: 0
---
: fitness: -184.985 f_0: 15 f_1: 12.999 f_2: 0
---
: fitness: -184.985 f_0: 15 f_1: 12.999 f_2: 0
---
: fitness: -184.985 f_0: 15 f_1: 12.999 f_2: 0
---
: fitness: -184.985 f_0: 15 f_1: 12.999 f_2: 0
---
: fitness: -184.985 f_0: 15 f_1: 12.999 f_2: 0
---
: fitness: -184.985 f_0: 15 f_1: 12.999 f_2: 0
---
: fitness: -184.985 f_0: 15 f_1: 12.999 f_2: 0
---
: fitness: -184.985 f_0: 15 f_1: 12.999 f_2: 0
---
: fitness: -184.985 f_0: 15 f_1: 12.999 f_2: 0
---
: fitness: -184.985 f_0: 15 f_1: 12.999 f_2: 0
---
: fitness: -184.985 f_0: 15 f_1: 12.999 f_2: 0
---
FACTOR 0 : 15
FACTOR 1 : 12.999
FACTOR 2 : 0
#include <iostream>
#include <vector>
using std::vector;
public:
}
Double_t EstimatorFunction( std::vector<Double_t> & factors ){
return (10.- factors.at(0) *factors.at(1) + factors.at(2));
}
};
public:
}
};
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;
for( std::vector<Double_t>::iterator it = gvec.begin(); it<gvec.end(); it++ ){
std::cout <<
"FACTOR " <<
n <<
" : " << (*it) << std::endl;
}
}
int main(
int argc,
char** argv )
{
TMVAGAexample();
}
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