When benchmarking the same suite several times like
### prepare
suite = cocoex.Suite(suite_name, "", "") # see https://numbbo.github.io/coco-doc/C/#suite-parameters
observer = cocoex.Observer(suite_name, "result_folder: " + output_folder)
minimal_print = cocoex.utilities.MiniPrint()
### go
for sweep in range(2):
for problem in suite: # this loop will take 2-3 minutes x budget_multiplier
problem.observe_with(observer) # generates the data for cocopp
problem(problem.dimension * [0]) # improve comparability to existing data
xopt = fmin(problem, problem.initial_solution_proposal(), disp=False)
problem(xopt) # make sure the returned solution is evaluated
minimal_print(problem, final=problem.index == len(suite) - 1)
The problem now is that the last entry invokes the reading-in of the very same five recorded data as the first entry because it points to the very same file.
It looks like the observer should never write to the same data file for any two different entry lines of any .info file, because it is virtually impossible to detangle the information after this is done, in particular as different.info files could point to the same data file when its name is only and fully determined via the meta data. Additionally, the processing of .info line entries should preferably not depend on their order.
Asking the user to create each time a new observer with a unique result folder name seems error prone and putting the burden on the wrong place, hence it does not look like a viable option to me.
In other words, each .info file line entry must create a new/unique set of *dat files. IIRC, the *info and *dat filename convention were only meant for simpler debugging and never meant to guarantee the suggested semantics or meta data. All meta data are provided in the *.info files. To prevent the abuse of the *dat filename as meta information, it may be preferable to use entirely random names.
When benchmarking the same suite several times like
one of the info files looks like this
The problem now is that the last entry invokes the reading-in of the very same five recorded data as the first entry because it points to the very same file.
It looks like the
observer
should never write to the same data file for any two different entry lines of any.info
file, because it is virtually impossible to detangle the information after this is done, in particular as different.info
files could point to the same data file when its name is only and fully determined via the meta data. Additionally, the processing of.info
line entries should preferably not depend on their order.Asking the user to create each time a new observer with a unique result folder name seems error prone and putting the burden on the wrong place, hence it does not look like a viable option to me.
In other words, each
.info
file line entry must create a new/unique set of*dat
files. IIRC, the*info
and*dat
filename convention were only meant for simpler debugging and never meant to guarantee the suggested semantics or meta data. All meta data are provided in the*.info
files. To prevent the abuse of the*dat
filename as meta information, it may be preferable to use entirely random names.