From d40ef9a053de0fab910bd3716e19d16030fdca28 Mon Sep 17 00:00:00 2001 From: evomarc Date: Fri, 26 Apr 2002 02:28:19 +0000 Subject: [PATCH] Turned the createParam into getORcreateParam so that you can more easily define them before (e.g. from the problem at hand). This is useful specially for vecSize as some problems have predefined values --- eo/src/es/make_genotype_real.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/eo/src/es/make_genotype_real.h b/eo/src/es/make_genotype_real.h index e6d8bdbc..eb9128ac 100644 --- a/eo/src/es/make_genotype_real.h +++ b/eo/src/es/make_genotype_real.h @@ -59,20 +59,20 @@ */ template -eoEsChromInit & do_make_genotype(eoParameterLoader& _parser, eoState& _state, EOT) +eoEsChromInit & do_make_genotype(eoParser& _parser, eoState& _state, EOT) { // the fitness type typedef typename EOT::Fitness FitT; - // for eoReal, only thing needed is the size - eoValueParam& vecSize = _parser.createParam(unsigned(10), "vecSize", "The number of variables ", 'n',"Genotype Initialization"); + // for eoReal, only thing needed is the size - but might have been created elswhere ... + eoValueParam& vecSize = _parser.getORcreateParam(unsigned(10), "vecSize", "The number of variables ", 'n',"Genotype Initialization"); // to build an eoReal Initializer, we need bounds: [-1,1] by default - eoValueParam& boundsParam = _parser.createParam(eoRealVectorBounds(vecSize.value(),-1,1), "initBounds", "Bounds for initialization (MUST be bounded)", 'B', "Genotype Initialization"); + eoValueParam& boundsParam = _parser.getORcreateParam(eoRealVectorBounds(vecSize.value(),-1,1), "initBounds", "Bounds for initialization (MUST be bounded)", 'B', "Genotype Initialization"); // now some initial value for sigmas - even if useless? // shoudl be used in Normal mutation - eoValueParam& sigmaParam = _parser.createParam(0.3, "sigmaInit", "Initial value for Sigma(s)", 's',"Genotype Initialization"); + eoValueParam& sigmaParam = _parser.getORcreateParam(0.3, "sigmaInit", "Initial value for Sigma(s)", 's',"Genotype Initialization"); // minimum check if ( (sigmaParam.value() < 0) )