Implement a real-coded PSO algorithm using ParadisEO-EO

Introduction  /   Problem definition and objective function  /   Social neighborhood and topology /   Velocity and flight /   Compilation and execution /   Conclusion

Important: This tutorial is only compatible with ParadisEO-1.1 and later.
All the source code of this lesson is located in the paradiseo-eo/tutorial/Lesson6 directory and the executable files are located in the paradiseo-eo/build/tutorial/Lesson6 directory.

Introduction

First, be sure that the ParadisEO-EO module has been compiled correctly and that the documentation has been generated (see the README file in the ParadisEO-EO directory to know how to compile the package and to generate the documentation).

Open a terminal and go to the sixth ParadisEO-EO's lesson build directory:

> cd build/tutorial/Lesson6/

The source directory contains the main file (RealPSO.cpp).

A real-coded PSO algorithm has already been designed and compiled (during the install process) for this problem. You can run it using:

> ./RealPSO

Here is an example of what you should get:

INITIAL POPULATION:
         best fit=0.417126  2 0.259212 -0.326808
         best fit=0.619588  2 0.614224 -0.0813517
         best fit=0.706455  2 -0.626506 -0.326449
         best fit=0.726146  2 0.714693 -0.12846
         best fit=0.849508  2 -0.656558 -0.539069
         best fit=1.09634  2 1.03781 -0.353412
         best fit=1.12832  2 -1.03509 0.449108
         best fit=1.28994  2 -1.2025 -0.466847
         best fit=1.39735  2 1.15823 0.781731
         best fit=1.47176  2 -0.264312 -1.44783
         best fit=1.48117  2 1.01176 -1.08175
         best fit=1.62206  2 1.58212 0.3577
         best fit=1.69764  2 -1.69267 0.129839
         best fit=1.69888  2 -1.58327 0.615981
         best fit=1.71621  2 1.15335 1.27089
         best fit=1.7392  2 0.892907 1.49249
         best fit=1.8719  2 0.178042 1.86342
         best fit=1.88095  2 -1.84812 0.34988
         best fit=2.47533  2 -1.77798 1.72222
         best fit=2.52572  2 1.94544 1.61076
STOP in eoGenContinue: Reached maximum number of generations [100/100]
FINAL POPULATION:
         best fit=0.00854728  2 0.00732468 0.00440512
         best fit=0.0194064  2 -0.0188956 -0.00442298
         best fit=0.0256507  2 0.00511249 0.025136
         best fit=0.0264635  2 0.0170685 -0.0202233
         best fit=0.0319583  2 -0.0219035 0.0232717
         best fit=0.0340766  2 -0.0278976 -0.0195688
         best fit=0.0386992  2 0.0357023 0.0149322
         best fit=0.0402803  2 -0.000987538 0.0402682
         best fit=0.0496343  2 0.0469563 0.0160833
         best fit=0.0498335  2 0.0294652 -0.0401893
         best fit=0.0651451  2 0.0472527 0.0448449
         best fit=0.0693173  2 -0.0251468 0.0645951
         best fit=0.0740747  2 -0.0455672 0.0584012
         best fit=0.0741351  2 -0.0292292 0.0681298
         best fit=0.0840262  2 -0.00581521 -0.0838247
         best fit=0.107411  2 0.0918796 0.0556349
         best fit=0.127972  2 0.0570204 0.114567
         best fit=0.16313  2 -0.160315 -0.0301709
         best fit=0.173228  2 -0.148945 0.0884487
         best fit=0.173364  2 -0.124476 0.120669

You have launched a PSO algorithm for a norm optimization problem. We will see later what this output means in details.