library: libTMVA
#include "GeneticBase.h"

TMVA::GeneticBase


class description - header file - source file - inheritance tree (.pdf)

class TMVA::GeneticBase

Inheritance Chart:
TMVA::GeneticBase
<-
TMVA::GeneticCuts

    public:
GeneticBase() GeneticBase(Int_t populationSize, vector<TMVA::LowHigh_t*> ranges) GeneticBase(const TMVA::GeneticBase&) virtual ~GeneticBase() Double_t Calc() virtual Double_t CalculateFitness() static TClass* Class() Double_t DoRenewFitness() virtual void Evolution() void Finalize() virtual Double_t FitnessFunction(const vector<Double_t>& factors) TMVA::GeneticPopulation& GetGeneticPopulation() Double_t GetSpread() const virtual Bool_t HasConverged(Int_t steps = 10, Double_t ratio = 0.1) void Init() virtual TClass* IsA() const virtual Double_t NewFitness(Double_t oldValue, Double_t newValue) TMVA::GeneticBase& operator=(const TMVA::GeneticBase&) virtual Double_t RenewFitness(vector<Double_t> factors, vector<Double_t> results) void SetSpread(Double_t s) virtual void ShowMembers(TMemberInspector& insp, char* parent) virtual Double_t SpreadControl(Int_t steps, Int_t ofSteps, Double_t factor) virtual void Streamer(TBuffer& b) void StreamerNVirtual(TBuffer& b)

Data Members


    protected:
TMVA::GeneticPopulation fPopulation Int_t fConvCounter Double_t fConvValue deque<Int_t> fSuccessList Double_t fLastResult Double_t fSpread regulates the spread of the value change at mutation (sigma) Bool_t fMirror new values for mutation are mirror-mapped if outside of constraints Bool_t fSexual allow sexual recombination of individual Bool_t fFirstTime if true its the first time, so no evolution yet

Class Description

_______________________________________________________________________

 Base definition for genetic algorithm
_______________________________________________________________________
GeneticBase( Int_t populationSize, vector<LowHigh_t*> ranges )
 Constructor
 Parameters:
     int populationSize : defines the number of "Individuals" which are created and tested
                          within one Generation (Iteration of the Evolution)
     vector<LowHigh_t*> ranges : LowHigh_t is a pair of doubles, where the first entry
                          is the low and the second entry the high constraint of the variable
                          the size of "ranges" is the number of coefficients which are optimised
 Purpose:
     Creates a random population with individuals of the size ranges.size()
void Init()
 calls evolution, but if it is not the first time.
 If it's the first time, the random population created by the
 constructor is still not evaluated, .. therefore we wait for the
 second time init is called.
Double_t Calc()
 calls calculateFitness
Double_t CalculateFitness()
 starts the evaluation of the fitness of all different individuals of
 the population.

 this function calls implicitly (many times) the "fitnessFunction" which
 has been overridden by the user.
Double_t DoRenewFitness()
 the fitness values of every individual is stored ..
 if the fitness has been evaluated for many events, all the results are
 internally stored.

 this function allows to loop through all results of all individuals.
 it calls implicitly the function "renewFitness"

 the right place to call this function would be at the end of one "Generation"
 to set the fitness of every individual new depending on all the results it obtained
 in this generation.
void Evolution()
 this function is called from "init" and controls the evolution of the
 individuals.
 the function can be overridden to change the parameters for mutation rate
 sexual reproduction and so on.
Double_t SpreadControl( Int_t ofSteps, Int_t successSteps, Double_t factor )
 this function provides the ability to change the stepSize of a mutation according to
 the success of the last generations.

 Parameters:
      int ofSteps :  = if OF the number of STEPS given in this variable (ofSteps)
      int successSteps : >sucessSteps Generations could improve the result
      double factor : than multiply the stepSize ( spread ) by this factor
 (if ofSteps == successSteps nothing is changed, if ofSteps < successSteps, the spread
 is divided by the factor)

 using this function one can increase the stepSize of the mutation when we have
 good success (to pass fast through the easy phase-space) and reduce the stepSize
 if we are in a difficult "territory" of the phase-space.

Bool_t HasConverged( Int_t steps, Double_t improvement )
 gives back true if the last "steps" steps have lead to an improvement of the
 "fitness" of the "individuals" of at least "improvement"

 this gives a simple measure of if the fitness of the individuals is
 converging and no major improvement is to be expected soon.

void Finalize()
GeneticBase()
GeneticBase(Int_t populationSize, std::vector < TMVA::LowHigh_t * > ranges)
virtual ~GeneticBase()
Double_t FitnessFunction(const std::vector < Double_t > & factors)
Double_t NewFitness(Double_t oldValue, Double_t newValue)
Double_t RenewFitness(std::vector < Double_t > factors, std::vector < Double_t > results)
GeneticPopulation& GetGeneticPopulation()
Double_t GetSpread()
void SetSpread(Double_t s)

Author: Peter Speckmayer
Last update: root/tmva $Id: GeneticBase.cxx,v 1.4 2006/05/31 14:01:33 rdm Exp $
Copyright (c) 2005: *


ROOT page - Class index - Class Hierarchy - Top of the page

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.