esa / pygmo2

A Python platform to perform parallel computations of optimisation tasks (global and local) via the asynchronous generalized island model.
https://esa.github.io/pygmo2/
Mozilla Public License 2.0
442 stars 56 forks source link

The Returns of archipelago.get_champions_x() [BUG] #166

Closed Vincent-zcm closed 2 months ago

Vincent-zcm commented 2 months ago

Describe the bug The Returns of archipelago.get_champions_x() are the values of the first [float]*N rather than the real champions_x(). More specifically, in the return values of each island when using archipelago, the returned x on each dimension has become the returned result on the first dimension.

To Reproduce [env params] OS: Ubuntu 22 python = "3.10" numpy = "2.0.0" pygmo-plugins-nonfree = "^0.24" pygmo = "2.19.5"

[my running code] archi = pygmo.archipelago(n=2, algo=algo, prob=prob, pop_size=5, seed=10) archi.evolve() archi.wait() best_x = archi.get_champions_x()

Expected behavior The correct best_x is 2 arrays consisting the returned champion x of each island, but the now the returned best_x is like
[ array([6.15449866, 6.15449866, 6.15449866, 6.15449866, 6.15449866, 6.15449866, 6.15449866, 6.15449866, 6.15449866, 6.15449866, 6.15449866, 6.15449866]), array([-0.83298348, -0.83298348, -0.83298348, -0.83298348, -0.83298348, -0.83298348, -0.83298348, -0.83298348, -0.83298348, -0.83298348, -0.83298348, -0.83298348]) ]

Vincent-zcm commented 2 months ago

This bug can be resolved by installing from Conda; I previously installed it using Poetry.