@@ -481,10 +481,13 @@ def evaluate_bbob(
481481 # This speeds up the import, this import is quite slow, so import it lazy here
482482 # pylint: disable=import-outside-toplevel
483483 import ioh
484+ from modcma .c_maes import Settings , parameters , options , constants , utils
485+ from modcma .c_maes import ModularCMAES as cModularCMAES
484486
485487 evals , fopts = np .array ([]), np .array ([])
486488 if seed :
487489 np .random .seed (seed )
490+ utils .set_seed (seed )
488491 fitness_func = ioh .get_problem (
489492 fid , dimension = dim , instance = instance
490493 )
@@ -516,13 +519,11 @@ def evaluate_bbob(
516519 hs = []
517520
518521 if cpp :
519- from modcma .c_maes import Settings , parameters , options
520- from modcma .c_maes import ModularCMAES as cModularCMAES
521522
522523 modules = parameters .Modules ()
523524 modules .matrix_adaptation = options .COVARIANCE
524525 modules .ssa = options .StepSizeAdaptation .CSA
525- modules .restart_strategy = options .RestartStrategy .STOP
526+ modules .restart_strategy = options .RestartStrategy .NONE
526527
527528 settings = Settings (
528529 fitness_func .meta_data .n_variables ,
@@ -534,10 +535,9 @@ def evaluate_bbob(
534535 sigma0 = 2.0 ,
535536 target = fitness_func .optimum .y + 1e-8 ,
536537 budget = fitness_func .meta_data .n_variables * 10_000 ,
537- cs = 0.4149090010980616 ,
538- cmu = 0.0512430870135861 ,
539538 )
540539 optimizer = cModularCMAES (settings )
540+
541541 while not optimizer .break_conditions ():
542542 optimizer .step (fitness_func )
543543 ps_norm .append (np .linalg .norm (optimizer .p .adaptation .ps ))
@@ -549,6 +549,7 @@ def evaluate_bbob(
549549 f_values .append (optimizer .p .pop .f .mean ())
550550 dm .append (optimizer .p .adaptation .dm .copy ())
551551 hs .append (optimizer .p .adaptation .hs )
552+ # print(optimizer)
552553 title = "modcmacpp"
553554 else :
554555 optimizer = ModularCMAES (fitness_func , dim , x0 = np .zeros (dim ), target = target , ** kwargs )
@@ -602,7 +603,7 @@ def evaluate_bbob(
602603
603604 for ax in ax0 , ax1 , ax2 , ax3 , ax4 :
604605 ax .grid ()
605- ax .set_xlim (0 , 300 )
606+ ax .set_xlim (0 , 500 )
606607 ax .set_yscale ("log" , base = 10 )
607608 plt .show ()
608609
0 commit comments