Skip to content

Commit 64f270a

Browse files
committed
bugfix for restart logging
1 parent 43c9054 commit 64f270a

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

moptipy/algorithms/so/vector/cmaes_lib.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def solve(self, process: Process) -> None:
142142

143143
# we create and directly run the CMA-ES algorithm
144144
_run_cma(CMA(mean=mean, sigma=sigma, bounds=bounds,
145-
seed=process.get_random().integers(0, 4294967296)),
145+
seed=int(process.get_random().integers(0, 4294967296))),
146146
f, should_terminate, [])
147147

148148
def log_parameters_to(self, logger: KeyValueLogSection) -> None:
@@ -212,7 +212,8 @@ def solve(self, process: Process) -> None:
212212

213213
# we create and directly run the CMA-ES algorithm
214214
_run_cma(SepCMA(mean=mean, sigma=sigma, bounds=bounds,
215-
seed=process.get_random().integers(0, 4294967296)),
215+
seed=int(process.get_random().integers(
216+
0, 4294967296))),
216217
f, should_terminate, [])
217218

218219
def __str__(self):
@@ -292,7 +293,7 @@ def solve(self, process: Process) -> None:
292293
random: Generator = process.get_random()
293294

294295
# create the initial CMA-ES setup
295-
seed: int = random.integers(0, 4294967296)
296+
seed: int = int(random.integers(0, 4294967296))
296297
cma = CMA(mean=mean, sigma=sigma, bounds=bounds, seed=seed)
297298

298299
solutions: list[tuple[np.ndarray, int | float]] = []
@@ -334,7 +335,7 @@ def solve(self, process: Process) -> None:
334335
pop_size = initial_pop_size * (2 ** large_pop_restarts)
335336

336337
# Create the new CMA-ES instance.
337-
seed = random.integers(0, 4294967296)
338+
seed = int(random.integers(0, 4294967296))
338339
cma = CMA(mean=mean, sigma=sigma, bounds=bounds,
339340
population_size=pop_size,
340341
seed=seed)

moptipy/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
from typing import Final
33

44
#: the version string of `moptipy`
5-
__version__: Final[str] = "0.9.138"
5+
__version__: Final[str] = "0.9.139"

0 commit comments

Comments
 (0)