source: cpp/frams/genetics/preconfigured.h @ 145

Last change on this file since 145 was 145, checked in by sz, 8 years ago

Genetics reorganization (affects ALL applications!):

  • Converters/Validators? are now configured/initialized in a more verbose but also less confusing way
  • At the same time, the PreconfiguredGenetics? object will help you avoid the increased complexity by creating the ready-to-use environment that is sufficient in 99% of cases (see the demos)
  • Format F genetics updated (work in progress)
  • Property svn:eol-style set to native
File size: 1.4 KB
4#include "genman.h"
5#include "defgenoconv.h"
7/** This class handles a typical initialization procedure and configuration of genetics:
8- adds converters between genetic formats as configured by gen-config.h,
9- validation of genotypes by dedicated genetic operators, or by conversion to f0 if no genetic operator is found that can validate a genotype.
11class PreconfiguredGenetics
13  public:
14DefaultGenoConvManager gcm;
15GenMan genman;
16ModelGenoValidator model_validator; //validation through conversion
19        {
20        gcm.addDefaultConverters(); //without converters, the application would only handle "format 0" genotypes
21        Geno::useConverters(gcm);
23        Geno::addValidator(&genman); //primary validation: use the extended validity checking (through dedicated genetic operators)
24        Geno::addValidator(&model_validator); //secondary validation: this simple validator handles all cases when there is no dedicated genetic validation operator, but a converter for a particular format is available. Converters may be less strict in detecting invalid genotypes but using them and checking whether they produced a valid f0 genotype is also some way to tell whether the initial genotype was valid. Otherwise, without dedicated genetic validation operator, we would have no validity check at all.
25        }
Note: See TracBrowser for help on using the repository browser.