def run_hartmann6_benchmarks()

in benchmarks/run_smac_benchmarks.py [0:0]


def run_hartmann6_benchmarks(D, rep, random_subspace=False):
    if D == 100:
        problem = hartmann6_100
    elif D == 1000 and not random_subspace:
        problem = hartmann6_1000
    elif D == 1000 and random_subspace:
        problem = hartmann6_random_subspace_1000

    experiment, f = benchmark_minimize_callable(
        problem=problem,
        num_trials=200,
        method_name='smac',
        replication_index=rep,
    )

    fmin_smac_nopynisher(
        func=f,
        x0=[0.5] * D,
        bounds=[[0, 1]] * D,
        maxfun=200,
        rng=rep + 1,
    )

    rs_str = 'random_subspace_' if random_subspace else ''
    with open(f'results/hartmann6_{rs_str}{D}_smac_rep_{rep}.json', "w") as fout:
       json.dump(object_to_json(experiment), fout)