Ignore:
Timestamp:
02/18/18 02:54:36 (6 years ago)
Author:
Maciej Komosinski
Message:

Unlimited number of model Parts/Joints/Neurons? when displaying the genotype-to-phenotype mapping

File:
1 edited

Legend:

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

    r732 r739  
    116116}
    117117
     118static int goodWidthForFormat(int genotype_format)
     119{
     120        return genotype_format == '0' ? 45 : 15; // more space for long f0 lines
     121}
     122
    118123// arguments:
    119124//     genotype (or - meaning "read from stdin") [default: X]
     
    182187                        printf("Conversion map:\n");
    183188                        m.print();
    184                         printConvMap(g1.getGenes(), g2.getGenes(), m);
     189                        printConvMap(g1.getGenes(), g2.getGenes(), m, goodWidthForFormat(g1.getFormat()));
    185190                        printf("Reverse conversion map:\n");
    186191                        MultiMap rm;
    187192                        rm.addReversed(m);
    188193                        rm.print();
    189                         printConvMap(g2.getGenes(), g1.getGenes(), rm);
     194                        printConvMap(g2.getGenes(), g1.getGenes(), rm, goodWidthForFormat(g2.getFormat()));
    190195                }
    191196
    192197                Model mod1(g1, 1);
    193198                printf("\nModel map for f%c genotype:\n", g1.getFormat());
    194                 printModelMap(g1.getGenes(), mod1.getMap());
     199                ModelDisplayMap dm1(mod1);
     200                dm1.print(goodWidthForFormat(g1.getFormat()));
    195201                MultiMap mod1combined;
    196                 mod1combined.addCombined(mod1.getMap(), getModelDisplayMap());
     202                mod1combined.addCombined(mod1.getMap(), dm1.getMap());
    197203                mod1combined.print();
    198204                Model mod2(g2, 1);
    199205                printf("\nModel map for f%c genotype:\n", g2.getFormat());
    200                 printModelMap(g2.getGenes(), mod2.getMap());
     206                ModelDisplayMap dm2(mod2);
     207                dm2.print(goodWidthForFormat(g2.getFormat()));
    201208                MultiMap mod2combined;
    202                 mod2combined.addCombined(mod2.getMap(), getModelDisplayMap());
     209                mod2combined.addCombined(mod2.getMap(), dm2.getMap());
    203210                mod2combined.print();
    204211        }
Note: See TracChangeset for help on using the changeset viewer.