esa / pagmo2

A C++ platform to perform parallel computations of optimisation tasks (global and local) via the asynchronous generalized island model.
https://esa.github.io/pagmo2/
GNU General Public License v3.0
823 stars 161 forks source link

Confusing about archipelago::evolve() #430

Closed sc1101 closed 4 years ago

sc1101 commented 4 years ago

Hello! When I read the 'Quick Start' of the document, I am confused with the step 4:

// 4 - Run the evolution in parallel on the 16 separate islands 10 times. archi.evolve(10);

When I want to set only a group of individuals (meaning that there is no multi-population), then how to set the 'n' in the step 4? For example: image

If I let the 'n' be equal to 1 in the step 4: archi.evolve(1); the optimal result I finally get would be very bad.

I have tried to read the source code of ' archipelago::evolve()', however, I am still confusing with it.

I am looking forward to your reply, thanks!

darioizzo commented 4 years ago

Please do not open issues on questions about the code use. We have the gitter chat where you can find some support for the correct use of pagmo.

On your question, if you only have one population, then you do not need an archipelago. Just use the evolve method of the algorithm directly. If you then want the single individual fitness to be evaluated in parallel you need to use a batch fitness evaluator. See docs.