From 8f398a9102bd3fca9b7fff2561b53f979c795f26 Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 8 Feb 2023 19:50:40 +0100 Subject: [PATCH] cec2020: add Functions, FuncNames --- bench/cec2020/vars.go | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/bench/cec2020/vars.go b/bench/cec2020/vars.go index b008098..8fde5fb 100644 --- a/bench/cec2020/vars.go +++ b/bench/cec2020/vars.go @@ -10,7 +10,34 @@ extern double *OShift,*M,*y,*z,*x_bound; extern int ini_flag,n_flag,func_flag,*SS; */ -var Functions = map[string]func([]float64) float64{} +// Functions is a string-func map of function names and specific bench funcs +// for easier iterable access. +var Functions = map[string]func([]float64) float64{ + "Bent Cigar": BentCigar, + "Schwefel Modified": Schwefel, + "Lunacek Bi-Rastrigin": LunacekBiRastrigin, + "Rosenbrock-Griewank": RosenbrockGriewank, + "Hybrid1": Hybrid1, + "Hybrid2": Hybrid2, + "Hybrid3": Hybrid3, + "Composition1": Composition1, + "Composition2": Composition2, + "Composition3": Composition3, +} + +// FuncNames represents a numbered list of function name. +var FuncNames = map[int]string{ + 0: "Bent Cigar", + 1: "Schwefel Modified", + 2: "Lunacek Bi-Rastrigin", + 3: "Rosenbrock-Griewank", + 4: "Hybrid1", + 5: "Hybrid2", + 6: "Hybrid3", + 7: "Composition1", + 8: "Composition2", + 9: "Composition3", +} // SearchRange specifies the CEC2020 search range. var SearchRange = bench.NewfuncParams(searchRangeMin, searchRangeMax)