ACTIVE_FUNCTIONS_IN_DATA = set(runs_df["funcion"].dropna().astype(str).unique())
FUNCTION_VISUAL_CONFIGS = {
"rosenbrock": {
"display_name": "Rosenbrock",
"function": rosenbrock,
"x1_range": (-2.0, 2.0),
"x2_range": (-1.0, 3.0),
"point": (1.0, 1.0),
"active_in_data": "rosenbrock" in ACTIVE_FUNCTIONS_IN_DATA,
"notes": "Activa cuando existan archivos en gradiente/datos/rosenbrock/.",
},
"schwefel": {
"display_name": "Schwefel",
"function": schwefel,
"x1_range": (-500.0, 500.0),
"x2_range": (-500.0, 500.0),
"point": (420.9687, 420.9687),
"active_in_data": "schwefel" in ACTIVE_FUNCTIONS_IN_DATA,
"notes": "Activa cuando existan archivos en gradiente/datos/schwefel/.",
},
"rastrigin": {
"display_name": "Rastrigin",
"function": rastrigin,
"x1_range": (-5.12, 5.12),
"x2_range": (-5.12, 5.12),
"point": (0.0, 0.0),
"active_in_data": "rastrigin" in ACTIVE_FUNCTIONS_IN_DATA,
"notes": "Activa cuando existan archivos en gradiente/datos/rastrigin/.",
},
"griewank": {
"display_name": "Griewank",
"function": griewank,
"x1_range": (-10.0, 10.0),
"x2_range": (-10.0, 10.0),
"point": (0.0, 0.0),
"active_in_data": "griewank" in ACTIVE_FUNCTIONS_IN_DATA,
"notes": "Activa cuando existan archivos en gradiente/datos/griewank/.",
},
"goldstein_price": {
"display_name": "Goldstein-Price",
"function": goldstein_price,
"x1_range": (-2.0, 2.0),
"x2_range": (-2.0, 2.0),
"point": (0.0, -1.0),
"active_in_data": "goldstein_price" in ACTIVE_FUNCTIONS_IN_DATA,
"notes": "Visualizacion 2D clasica. Activa cuando existan archivos en gradiente/datos/goldstein_price/.",
},
"six_hump_camel": {
"display_name": "Six-Hump Camel",
"function": six_hump_camel,
"x1_range": (-2.0, 2.0),
"x2_range": (-1.5, 1.5),
"point": (0.0898, -0.7126),
"active_in_data": "six_hump_camel" in ACTIVE_FUNCTIONS_IN_DATA,
"notes": "Visualizacion 2D clasica. Activa cuando existan archivos en gradiente/datos/six_hump_camel/.",
},
}
pd.DataFrame(
[
{
"funcion": key,
"nombre": value["display_name"],
"activa_en_datos": value["active_in_data"],
"nota": value["notes"],
}
for key, value in FUNCTION_VISUAL_CONFIGS.items()
]
)