Closed chrisdembia closed 10 years ago
Unfortunately, I don't think this works. readpara_SupplementDefaults
is supposed to be called only once, because it checks for unset values to be set. It is not designed to "reset" values. In your particular case damps
would be set depending on the "correct" value of damps
which must be considered a bug.
For the time being you could just set evo.sp.stopMaxIter
without calling to readpara_SupplementDefaults
, as the dependency of damps
on stopMaxIter
is rather minor and of lesser importance.
Otherwise we would need to have (1) readpara_init
not calling SupplementDefaults
itself and (2) a version of cmaes_init
that does not finalize the settings such that
cmaes_t evo;
cmaes_init_para(&evo, ...); /* complement the same parameters as for cmaes_init */
evo.sp.stopMaxIter = ...
cmaes_init_finalize(&evo);
or
cmaes_t evo;
readpara_init(&evo.sp, ...); /* complement the same parameters as for cmaes_init */
evo.sp.stopMaxIter = ...
cmaes_init_finalize(&evo);
would be working usecases.
I implemented the use case
cmaes_t evo;
cmaes_init_para(&evo, ...); /* complement with the same parameters as for cmaes_init */
evo.sp.stopMaxIter = ...
cmaes_init_final(&evo);
I see that the parameters are stored in
evo->sp
. What is the best and safest way to modify these parameters programmatically instead of via input files?My hunch is that the following sequence of calls would be safe:
I want to modify the readpara_t entries but I don't want to put the parameters in an inconsistent state, and I still want to benefit from the supplemented defaults. It seems that
readpara_t.damps
is set based on the value ofstopMaxIter
. If I updatestopMaxIter
, I must callreadpara_SupplementDefaults
to have a consistent value ofdamps
. Are there other additional steps I must take?Thanks!