diff --git a/eo/src/ga/make_genotype_ga.h b/eo/src/ga/make_genotype_ga.h index f162328b..1ea3e110 100644 --- a/eo/src/ga/make_genotype_ga.h +++ b/eo/src/ga/make_genotype_ga.h @@ -61,19 +61,8 @@ template eoInit & do_make_genotype(eoParser& _parser, eoState& _state, EOT) { // for bitstring, only thing needed is the size - unsigned theSize; // but it might have been already read in the definition fo the performance - eoParam* ptParam = _parser.getParamWithLongName(string("chromSize")); - - if (!ptParam) // not already defined: read it here - { - theSize = _parser.createParam(unsigned(10), "chromSize", "The length of the bitstrings", 'n',"Problem").value(); - } - else // it was read before, get its value - { - eoValueParam* ptChromSize = dynamic_cast*>(ptParam); - theSize = ptChromSize->value(); - } + unsigned theSize = _parser.getORcreateParam(unsigned(10), "chromSize", "The length of the bitstrings", 'n',"Problem").value(); // Then we can built a bitstring random initializer // based on boolean_generator class (see utils/rnd_generator.h)