Changeset 972 for cpp/frams/_demos/genoconv_test.cpp
- Timestamp:
- 07/03/20 00:32:23 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/_demos/genoconv_test.cpp
r955 r972 1 1 // This file is a part of Framsticks SDK. http://www.framsticks.com/ 2 // Copyright (C) 1999-20 18Maciej Komosinski and Szymon Ulatowski.2 // Copyright (C) 1999-2020 Maciej Komosinski and Szymon Ulatowski. 3 3 // See LICENSE.txt for details. 4 4 … … 16 16 */ 17 17 18 /// Sample Geno converter not using Model class.19 /// (This converter generates the same output for each input).20 /// Such a converter is responsible for doing valid f0 (or other format) output and storing temporary data.18 /// Sample Geno converter not using Model class. 19 /// (This converter generates the same output for each input). 20 /// Such a converter is responsible for doing valid f0 (or other format) output and storing temporary data. 21 21 class GenoConv_Test : public GenoConverter 22 22 { … … 84 84 for (t = src; *t; t++) 85 85 { 86 if (insideneuron &&*t == ']') insideneuron = 0;86 if (insideneuron && *t == ']') insideneuron = 0; 87 87 if (*t == '[') insideneuron = 1; 88 88 if ((!insideneuron) && isdigit(*t) && t[1]) … … 93 93 dst += *t; 94 94 if (map) // fill in the map only if requested 95 map->add(t - src, t - src, dst.len () - n, dst.len() - 1);95 map->add(t - src, t - src, dst.length() - n, dst.length() - 1); 96 96 // meaning: source character (t-src) becomes (dst.len()-n ... dst.len()-1) 97 97 } … … 100 100 dst += *t; 101 101 if (map) 102 map->add(t - src, t - src, dst.len () - 1, dst.len() - 1);102 map->add(t - src, t - src, dst.length() - 1, dst.length() - 1); 103 103 // meaning: map single to single character: (t-src) into (dst.len()-1) 104 104 } … … 113 113 { 114 114 printf("Genotype:\n%s\nFormat: %s\nValid: %s\nComment: %s\n", 115 115 g.getGenes().c_str(), g.getFormat().c_str(), g.isValid() ? "yes" : "no", g.getComment().c_str()); 116 116 } 117 117 … … 167 167 if (using_checkpoints) 168 168 { // using Model with checkpoints 169 Model m1(g2, false, true);//true=using_checkpoints169 Model m1(g2, Model::SHAPE_UNKNOWN, false, true);//true=using_checkpoints 170 170 printf("\nModel built from the converted f%s genotype has %d checkpoints\n", g2.getFormat().c_str(), m1.getCheckpointCount()); 171 Model m2(g1, false, true);//true=using_checkpoints171 Model m2(g1, Model::SHAPE_UNKNOWN, false, true);//true=using_checkpoints 172 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) … … 195 195 } 196 196 197 Model mod1(g1, 1);197 Model mod1(g1, Model::SHAPE_UNKNOWN, 1); 198 198 printf("\nModel map for f%s genotype:\n", g1.getFormat().c_str()); 199 199 ModelDisplayMap dm1(mod1); … … 202 202 mod1combined.addCombined(mod1.getMap(), dm1.getMap()); 203 203 mod1combined.print(); 204 Model mod2(g2, 1);204 Model mod2(g2, Model::SHAPE_UNKNOWN, 1); 205 205 printf("\nModel map for f%s genotype:\n", g2.getFormat().c_str()); 206 206 ModelDisplayMap dm2(mod2);
Note: See TracChangeset
for help on using the changeset viewer.