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)
This commit is contained in:
parent
1e0717859d
commit
25a4894853
1 changed files with 1 additions and 12 deletions
|
|
@ -61,19 +61,8 @@ template <class EOT>
|
|||
eoInit<EOT> & 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<unsigned>* ptChromSize = dynamic_cast<eoValueParam<unsigned>*>(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)
|
||||
|
|
|
|||
Reference in a new issue