Skip to content

Differential Evolution library based on JSO algorithm, redesigned, | DE | JSO | C++

License

Notifications You must be signed in to change notification settings

justinjk007/JSO

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JSO

https://travis-ci.org/justinjk007/JSO.svg?branch=master#.svg https://ci.appveyor.com/api/projects/status/kuv6oxtq8hn6hr2t?svg=true#.svg https://img.shields.io/badge/License-GPLv3-blue.svg https://img.shields.io/badge/language-C++-blue.svg https://img.shields.io/badge/C%2B%2B-11-blue.svg

A differential evolution optimization library written in C++ 11.

Single Objective Real-Parameter Optimization algorithm with self-adaptive Cross-over rate and scaling factor.

JSO is improved version of iL-SHADE.

iL-SHADE: Improved L-SHADE Algorithm (L-SHADE was proposed by Ryoji Tanabe and Alex Fukunaga at CEC2014).

Usage

This is a header only library, include JSO.hpp from the include folder and you are done.

To optimize a function it should have the following signature

void your_fitness_function (double* ,double*)

here the first pointer will point towards a vector of the parameters you need for your fitness function and second double pointer should hold the fitness value you calculate when it returns.

Example, using a regular function

Say rastrigin_func(double*,double*) is defined, it can be optimized like this.

JSO::JSO algorithm(rastrigin_func, 2, -5.12, 5.12);
algorithm.run();
  • Here rastrigin_func is the name of the function.
  • 2 is the dimension of the problem/ no: of parameters needed for your fitness function.
  • -5.12 is the minimum value of the population.
  • -5.12 is the maximum value of the population.
  • The code will exit after maximum iterations or based on your exit criteria.

Example, using a member function

Say Foo::sphere_func(double*,double*) is defined, it can be optimized like this using a lambda

using namspace JSO;
Foo obj;
JSO algorithm([&obj](double* p1, double* p2) { obj.sphere_func(p1, p2); }, 2, -100, 100);
algorithm.run();

All original authors

Also, thanks to cpp-slack

About

Differential Evolution library based on JSO algorithm, redesigned, | DE | JSO | C++

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published