/PSO

Particle Swarm Optimization in C++

Primary LanguageC++

PSO

Particle Swarm Optimization algorithm implemented in C++. Input parameter values are read in from a text file. Objective and constraint functions are to be written by user. Folder /References contains materials studied in order to write the implementation.

The second and final version can found in the file pso.h while examples of using it can be found in ex_box.cpp and ex_benchmark.cpp. It allows optimization using PSO for discrete or continuous parameter ranges. In both cases objective function and constraints have to be implemented by deriving from __interface IFitness. Both discrete and continuous PSO can be accessed through class Pso which includes all necessary functions for carrying out optimization. Input formats differ somewhat however:

  • Discrete: all possible values for a parameter on each line.
  • Continuous: minimum and maximum value for a parameter on each line.

In both cases the number of lines has to be equal to the number of parameters so that no newline should be present at the end of the file. Resulting output parameters will be in the same sequence as their are in the input file. Examples of input and / or output files can be generated by running the examples.