numbbo / coco

Numerical Black-Box Optimization Benchmarking Framework
https://numbbo.github.io/coco
Other
254 stars 85 forks source link

[Bug report] recommendations cause crash on unobserved problems #2310

Open brockho opened 1 week ago

brockho commented 1 week ago

Describe the bug When calling recommend on an unobserved problem, I see a crash (COCO FATAL ERROR):

In [1]: import cocoex
In [2]: mysuite = cocoex.Suite('bbob-noisy','','')
In [3]: fun = mysuite.get_problem_by_function_dimension_instance(109,2,1)
In [4]: fun.recommend([0,0])
COCO FATAL ERROR: coco_recommend_solutions(): No recommend solution function implemented for problem sphere_d02
PS C:\Users\dimo\Desktop\coco\code-postprocessing\testnoisyJUNE2024\bbob.v15.03\python>

The bug is not observed when wrapping an observer around the problem, i.e. in the actual usecase of the recommend call.

Your System (please complete the following information when it seems relevant):

nikohansen commented 1 week ago

The error is not necessarily a bug, but I wonder if, from the users perspective, a warning would be better than an error? For example, one might want to run a code which usually takes an observed problem for some reason also on an unobserved problem.