latest version v1.9 - last update 10 Apr 2010 |
The Pareto Front Tester functor is a simple example of an evaluation framework using the Pareto Front class. More...
#include <ltiParetoFrontTester.h>
Public Member Functions | |
paretoFrontTester () | |
paretoFrontTester (const parameters &par) | |
paretoFrontTester (const paretoFrontTester &other) | |
virtual | ~paretoFrontTester () |
virtual const char * | getTypeName () const |
virtual functor * | clone () const |
Public methods to be reimplemented | |
virtual bool | chromosomeToPhenotype (const chromosome &genotype, functor::parameters &phenotype) const |
virtual functor::parameters * | chromosomeToPhenotype (const chromosome &genotype) const |
virtual bool | phenotypeToChromosome (const functor::parameters &phenotype, chromosome &genotype) const |
virtual int | getChromosomeSize () const |
virtual bool | evaluateChromosome (const chromosome &individual, dvector &fitness) |
Protected Member Functions | |
Methods to be reimplemented | |
virtual bool | randomIndividual (chromosome &genotype) |
virtual bool | mutate (const chromosome &parent, chromosome &mutant) |
virtual bool | crossover (const chromosome &parent1, const chromosome &parent2, chromosome &child) |
The Pareto Front Tester functor is a simple example of an evaluation framework using the Pareto Front class.
lti::paretoFrontTester::paretoFrontTester | ( | ) |
Default constructor.
lti::paretoFrontTester::paretoFrontTester | ( | const parameters & | par | ) |
Construct a functor using the given parameters.
lti::paretoFrontTester::paretoFrontTester | ( | const paretoFrontTester & | other | ) |
Copy constructor.
other | the object to be copied |
virtual lti::paretoFrontTester::~paretoFrontTester | ( | ) | [virtual] |
Destructor.
virtual functor::parameters* lti::paretoFrontTester::chromosomeToPhenotype | ( | const chromosome & | genotype | ) | const [virtual] |
Return a fresh allocated parameters for the evaluated functor, which is equivalent to the given genotype.
Implements lti::paretoFront.
virtual bool lti::paretoFrontTester::chromosomeToPhenotype | ( | const chromosome & | genotype, | |
functor::parameters & | phenotype | |||
) | const [virtual] |
Convert a binary-chain representation of a chromosome to a valid parameter object.
Implements lti::paretoFront.
virtual functor* lti::paretoFrontTester::clone | ( | ) | const [virtual] |
Returns a pointer to a clone of this functor.
Implements lti::paretoFront.
virtual bool lti::paretoFrontTester::crossover | ( | const chromosome & | parent1, | |
const chromosome & | parent2, | |||
chromosome & | child | |||
) | [protected, virtual] |
Crossover between two chromosomes.
This should be reimplemented to ensure that the crossover produces a valid phenotype.
The default implementation does a so called uniform crossover, in which each pair of corresponding bits are exchanged with a probability of 0.5.
Reimplemented from lti::paretoFront.
virtual bool lti::paretoFrontTester::evaluateChromosome | ( | const chromosome & | individual, | |
dvector & | fitness | |||
) | [virtual] |
Evaluate Chromosome.
This method is one of the most important ones for the pareto evaluation. Its task is to produce a multidimensional fitness measure for a given chromosome.
It returns true if the evaluation was successful, of false if the phenotype represents some invalid parameterization. It is highly recomended that the mutation and crossover methods are reimplemented to avoid invalid parameterizations.
There are mainly two types of fitness measures that can be analyzed with this functor of this kind: empirical goodness and empirical discrepancy (Zhang). The empirical goodness computes some measure using exclusively the test data, without requiring any ground truth. The empirical discrepancy assumes the existency of ground truth and provides as measure some distance between the result of an algorithm and the ground truth. Each class derived from paretoFrontTester should specify clearly which kind of fitness measures it provides.
Implements lti::paretoFront.
virtual int lti::paretoFrontTester::getChromosomeSize | ( | ) | const [virtual] |
Return the length in bits for a chromosome.
This method needs to be reimplemented, in order to get some default implementations to work.
Implements lti::paretoFront.
virtual const char* lti::paretoFrontTester::getTypeName | ( | ) | const [virtual] |
Returns the name of this type ("paretoFrontTester").
Reimplemented from lti::paretoFront.
virtual bool lti::paretoFrontTester::mutate | ( | const chromosome & | parent, | |
chromosome & | mutant | |||
) | [protected, virtual] |
Mutate the given chromosome.
This should be reimplemented to ensure that the mutation is a valid phenotype.
The default implementation flips the bits with the probability given in the parameters.
Reimplemented from lti::paretoFront.
virtual bool lti::paretoFrontTester::phenotypeToChromosome | ( | const functor::parameters & | phenotype, | |
chromosome & | genotype | |||
) | const [virtual] |
Convert a valid parameters object (phenotype) into binary-chain representation of a chromosome.
Implements lti::paretoFront.
virtual bool lti::paretoFrontTester::randomIndividual | ( | chromosome & | genotype | ) | [protected, virtual] |
Generate a random individual.
You usually will need to reimplement this method to ensure that the generated random individuals have a valid phenotype, i.e. that the chromosome binary representation in "genotype" has an equivalent parameter object for the class you are using.
Return true if successful, false otherwise.
Reimplemented from lti::paretoFront.