Changeset 348 for cpp/frams/_demos/f0_variants_test.cpp
- Timestamp:
- 04/09/15 23:51:28 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/_demos/f0_variants_test.cpp
r286 r348 79 79 DefaultGenoConvManager gcm; 80 80 gcm.addDefaultConverters(); 81 Geno::useConverters( gcm);81 Geno::useConverters(&gcm); 82 82 83 Geno::Validators validators; 84 Geno::useValidators(&validators); 83 85 ModelGenoValidator model_validator; 84 Geno::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 nothing86 validators+=&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 87 86 88 SString gen(argc>1?argv[1]:"X[|G:1.23]"); 87 if (!strcmp(gen ,"-"))89 if (!strcmp(gen.c_str(),"-")) 88 90 { 89 91 gen=0; … … 92 94 } 93 95 Geno g(gen); 94 printf("\nSource genotype: '%s'\n", (const char*)g.getGene());96 printf("\nSource genotype: '%s'\n",g.getGene().c_str()); 95 97 printf(" ( format %c %s)\n", 96 g.getFormat(), (const char*)g.getComment());98 g.getFormat(), g.getComment().c_str()); 97 99 98 100 Model m(g);//.getConverted('0')); … … 112 114 save_as_f0(f0_no_skipping_defaults,m,false); 113 115 114 printf("\n==== with defdata (skips default values) ======\n%s\n", (const char*)f0_skipping_defaults);115 printf("\n==== without defdata (saves all fields) ======\n%s\n", (const char*)f0_no_skipping_defaults);116 printf("\n==== with defdata (skips default values) ======\n%s\n",f0_skipping_defaults.c_str()); 117 printf("\n==== without defdata (saves all fields) ======\n%s\n",f0_no_skipping_defaults.c_str()); 116 118 117 119 return 0;
Note: See TracChangeset
for help on using the changeset viewer.