Changeset 955 for cpp/frams/_demos
- Timestamp:
- 06/25/20 00:34:29 (4 years ago)
- Location:
- cpp/frams/_demos
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/_demos/f0_variants_test.cpp
r720 r955 95 95 Geno g(gen); 96 96 printf("\nSource genotype: '%s'\n",g.getGenes().c_str()); 97 printf(" ( format % c%s)\n",98 g.getFormat() , g.getComment().c_str());97 printf(" ( format %s %s)\n", 98 g.getFormat().c_str(), g.getComment().c_str()); 99 99 100 100 Model m(g);//.getConverted('0')); -
cpp/frams/_demos/genoconv_test.cpp
r739 r955 66 66 { 67 67 name = "Test Converter #3"; 68 in_format = 'z';68 in_format = "multiply"; 69 69 out_format = '1'; 70 70 mapsupport = 1; … … 112 112 void printGen(Geno &g) 113 113 { 114 printf("Genotype:\n%s\nFormat: % c\nValid: %s\nComment: %s\n",115 g.getGenes().c_str(), g.getFormat(), g.isValid() ? "yes" : "no", g.getComment().c_str());116 } 117 118 static int goodWidthForFormat( intgenotype_format)119 { 120 return genotype_format == '0'? 45 : 15; // more space for long f0 lines114 printf("Genotype:\n%s\nFormat: %s\nValid: %s\nComment: %s\n", 115 g.getGenes().c_str(), g.getFormat().c_str(), g.isValid() ? "yes" : "no", g.getComment().c_str()); 116 } 117 118 static int goodWidthForFormat(const SString& genotype_format) 119 { 120 return genotype_format == "0" ? 45 : 15; // more space for long f0 lines 121 121 } 122 122 … … 154 154 else 155 155 src = "X"; 156 chardst = (argc > 2) ? *argv[2] : '0';156 SString dst = (argc > 2) ? *argv[2] : '0'; 157 157 bool using_checkpoints = (argc > 3) ? (strcmp(argv[3], "checkpoints") == 0) : false; 158 158 … … 162 162 MultiMap m; 163 163 Geno g2 = g1.getConverted(dst, &m, using_checkpoints); 164 printf("*** Converted to f% c:\n", dst);164 printf("*** Converted to f%s:\n", dst.c_str()); 165 165 printGen(g2); 166 166 … … 168 168 { // using Model with checkpoints 169 169 Model m1(g2, false, true);//true=using_checkpoints 170 printf("\nModel built from the converted f% c genotype has %d checkpoints\n", g2.getFormat(), m1.getCheckpointCount());170 printf("\nModel built from the converted f%s genotype has %d checkpoints\n", g2.getFormat().c_str(), m1.getCheckpointCount()); 171 171 Model m2(g1, false, true);//true=using_checkpoints 172 printf("Model built from the source f% c genotype has %d checkpoints\n", g1.getFormat(), m2.getCheckpointCount());172 printf("Model built from the source f%s genotype has %d checkpoints\n", g1.getFormat().c_str(), m2.getCheckpointCount()); 173 173 // accessing individual checkpoint models (if available) 174 174 if (m1.getCheckpointCount() > 0) … … 196 196 197 197 Model mod1(g1, 1); 198 printf("\nModel map for f% c genotype:\n", g1.getFormat());198 printf("\nModel map for f%s genotype:\n", g1.getFormat().c_str()); 199 199 ModelDisplayMap dm1(mod1); 200 200 dm1.print(goodWidthForFormat(g1.getFormat())); … … 203 203 mod1combined.print(); 204 204 Model mod2(g2, 1); 205 printf("\nModel map for f% c genotype:\n", g2.getFormat());205 printf("\nModel map for f%s genotype:\n", g2.getFormat().c_str()); 206 206 ModelDisplayMap dm2(mod2); 207 207 dm2.print(goodWidthForFormat(g2.getFormat())); -
cpp/frams/_demos/genomanipulation.cpp
r896 r955 258 258 if (gc) printf("found converter accepting f1: \"%s\"\n", gc->name); 259 259 SListTempl<GenoConverter*> found; 260 Geno::getConverters()->findConverters(&found, -1, '0');260 Geno::getConverters()->findConverters(&found, Geno::UNKNOWN_FORMAT, '0'); 261 261 printf("found %d converter(s) producing f0\n", found.size()); 262 262 } … … 281 281 Geno g(gen); 282 282 printf("\nSource genotype: '%s'\n", g.getGenes().c_str()); 283 printf(" ( format % c%s)\n",284 g.getFormat() , g.getComment().c_str());283 printf(" ( format %s %s)\n", 284 g.getFormat().c_str(), g.getComment().c_str()); 285 285 286 286 Model m(g);//.getConverted('0')); -
cpp/frams/_demos/genooper_test.cpp
r534 r955 8 8 void printGen(Geno &g) 9 9 { 10 printf("Genotype: %s\nFormat: % c\nValid: %s\nComment: %s\n",11 g.getGenes().c_str(), g.getFormat(), g.isValid() ? "yes" : "no", g.getComment().len() == 0 ? "(empty)" : g.getComment().c_str());10 printf("Genotype: %s\nFormat: %s\nValid: %s\nComment: %s\n", 11 g.getGenes().c_str(), g.getFormat().c_str(), g.isValid() ? "yes" : "no", g.getComment().len() == 0 ? "(empty)" : g.getComment().c_str()); 12 12 } 13 13 … … 30 30 Geno gsrc(src, -1, "First"); 31 31 printGenAndTitle(gsrc, "source genotype (gsrc)"); 32 charformat = gsrc.getFormat();32 SString format = gsrc.getFormat(); 33 33 34 34 Geno gmut = genetics.genman.mutate(gsrc); … … 41 41 printGenAndTitle(gsimplest, "simplest"); 42 42 43 Geno ginvalid("IT'S REALLY WRONG", format );43 Geno ginvalid("IT'S REALLY WRONG", format.c_str()); 44 44 printGenAndTitle(ginvalid, "invalid"); 45 45 -
cpp/frams/_demos/multiline_f0_test.cpp
r745 r955 27 27 Geno g(gen); 28 28 printf("\nSource genotype: '%s'\n",g.getGenes().c_str()); 29 printf(" ( format % c%s)\n",30 g.getFormat() , g.getComment().c_str());29 printf(" ( format %s %s)\n", 30 g.getFormat().c_str(), g.getComment().c_str()); 31 31 32 32 Model m(g);//.getConverted('0'));
Note: See TracChangeset
for help on using the changeset viewer.