5"""Run a seeded search on normalised Rastrigin."""
15 """Run either search with the same evaluator and seed."""
16 parser = argparse.ArgumentParser(description=__doc__)
17 parser.add_argument(
"algorithm", choices=(
"map-elites",
"nslc"))
18 parser.add_argument(
"--output-dir", help=
"Directory for the run manifest")
19 args = parser.parse_args()
22 dimension=3, budget=24, batch_size=6,
23 fitness_domain=((0, 1),), features_domain=((0, 1), (0, 1)),
25 if args.algorithm ==
"map-elites":
26 search = map_elites(shape=(4, 4), **settings)
28 search = nslc(k=3, threshold_novelty=0.15, **settings)
30 search, illumination_rastrigin_normalised, seed=42,
31 batch_mode=args.algorithm ==
"map-elites", output_dir=args.output_dir,
33 print(
"Evaluations", result.evaluations)
34 print(
"Retained candidates", len(result.archive))
35 print(
"Best fitness", result.best.fitness.values[0])
36 if result.manifest_path
is not None:
37 print(
"Run manifest", result.manifest_path)
40if __name__ ==
"__main__":