From 25a48948535878c5af054eb31f5cedcf927f22d5 Mon Sep 17 00:00:00 2001 From: evomarc Date: Fri, 26 Apr 2002 02:39:10 +0000 Subject: [PATCH] Turned the code that was testing for the existence of the size parameter in to the call to getORcreateParam (actually, this was where this code has been tested the first time) --- eo/src/ga/make_genotype_ga.h | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) 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)