Ignore:
Timestamp:
02/26/14 20:21:22 (10 years ago)
Author:
sz
Message:

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)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/_demos/f0_variants_test.cpp

    r121 r145  
    88#include <frams/virtfile/stdiofile.h>
    99
     10#include <frams/genetics/defgenoconv.h>
    1011#include <frams/model/model.h>
    11 #include <frams/genetics/defgenoconv.h>
    1212#include <frams/errmgr/stdouterr.h>
    13 
    14 StdoutErrorHandler err; //redirect model-related errors to stdout
    15 DefaultGenoConvManager gcm; //without this object the application would only handle "format 0" genotypes
    1613
    1714void save_as_f0(SString &gen,Model &m,bool omit_default_values)
     
    7774int main(int argc,char*argv[])
    7875{
     76StdoutErrorHandler err;//the default ErrorHandler constructor automatically registers this object to receive framsg messages (and in this case, redirect them to standard output)
     77
     78//without converters the application would only handle "format 0" genotypes
     79DefaultGenoConvManager gcm;
     80gcm.addDefaultConverters();
     81Geno::useConverters(gcm);
     82
     83ModelGenoValidator model_validator;
     84Geno::addValidator(&model_validator); //This simple validator handles all cases where a converter for a particular format is available but there is no genetic operator. Converters may be less strict in detecting invalid genotypes but it is better than nothing
     85
    7986SString gen(argc>1?argv[1]:"X[|G:1.23]");
    8087if (!strcmp(gen,"-"))
Note: See TracChangeset for help on using the changeset viewer.