From 4eb0b035088fb4b04d712ae36a0a60e5dcbb9bd8 Mon Sep 17 00:00:00 2001 From: Thomas Weise Date: Sun, 5 Jun 2022 04:04:46 +0800 Subject: [PATCH] hopefully fixed ert_fes/ert_time_millis upper bound error --- moptipy/evaluation/end_statistics.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/moptipy/evaluation/end_statistics.py b/moptipy/evaluation/end_statistics.py index ca1c19e0a..f79ccf288 100644 --- a/moptipy/evaluation/end_statistics.py +++ b/moptipy/evaluation/end_statistics.py @@ -2,7 +2,7 @@ import os.path import sys from dataclasses import dataclass -from math import inf +from math import inf, ceil from typing import Optional, Union, Iterable, List, Dict, Final, Callable, Any import moptipy.api.logging as log @@ -364,7 +364,7 @@ def __init__(self, raise ValueError( "ert_fes must be >= " f"{success_fes.minimum}, but is {ert_fes}.") - ert_fe_max = total_fes.mean_arith * n + ert_fe_max = ceil(total_fes.mean_arith * n) if ert_fes > ert_fe_max: raise ValueError( "ert_fes must be <= " @@ -376,10 +376,10 @@ def __init__(self, "ert_time_millis must be >= " f"{success_time_millis.minimum}, but " f"is {ert_time_millis}.") - ert_time_max = total_time_millis.mean_arith * n + ert_time_max = ceil(total_time_millis.mean_arith * n) if ert_time_millis > ert_time_max: raise ValueError( - "ert_fes must be <= " + "ert_time_millis must be <= " f"{ert_time_max}, but is {ert_time_millis}.") else: if success_fes is not None: