In using the simulated_annealing algorithm in an archipelago, I found that only the initial champion seems to be evolved and all the other islands stay the same.
Consider the following test case:
archi=pg.archipelago(n=1,algo=pg.de(),pop_size=10,prob=pg.rosenbrock(10),seed=32)
archi[0].get_population().get_f()
array([[ 1119502.9304024 ], [ 1887060.79044021], [ 881859.7076029 ], [ 1103797.48649139], [ 758181.03305512], [ 1747402.51182214], [ 1030352.91487772], [ 416032.91483984], [ 1836179.29729704], [ 609598.37469839]])
archi.evolve(); archi.wait()
archi[0].get_population().get_f()
array([[ 216007.47204985], [ 1270458.58395363], [ 881859.7076029 ], [ 276188.16879124], [ 555552.67057929], [ 1265020.82538769], [ 384033.30916346], [ 360803.18304403], [ 1798444.20627363], [ 230837.65916308]])
But if I run the same using algo=pg.simulated_annealing()
, then the evolved population_f after one call to archi.evolve()
becomes,
array([[ 1.11950293e+06], [ 1.88706079e+06], [ 8.81859708e+05], [ 1.10379749e+06], [ 7.58181033e+05], [ 1.74740251e+06], [ 1.03035291e+06], [ 6.23189001e+00], [ 1.83617930e+06], [ 6.09598375e+05]])
Notice that only the island with the smallest fitness at the start has been evolved. But most of the fitness vectors change using pg.de()
. This happens with different problems, different algorithms, and different numbers of islands. Seems like a bug?
So far the workaround I've found is to call
archi = pg.archipelago(n = 10, algo = pg.simulated_annealing(), prob = pg.rosenbrock(10), pop_size = 1, seed = 32)
instead. However, if I do this using pg.de()
as the algo, I receive "error occurred" for each thread. Very odd, all of it...