SkillAgentSearch skills...

JMetalCpp

A C++ version of jMetal, a Java framework aimed at multi-objective optimization with metaheuristics.

Install / Use

/learn @jMetal/JMetalCpp
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

jMetalCpp project Web site

jMetalCpp is a C++ based framework for multi-objective optimization. It is a fork of the jMetal project.

TABLE OF CONTENTS

  1. Updates
  2. Requirements
  3. Installing jMetalCpp
  4. Executing jMetalCpp
  5. Choosing a problem
  6. Configuring a problem
  7. Calculating quality indicators
  8. Advanced: Building a Experiment 7.1. Executing a experiment 7.2. Generating reports from a experiment
  9. Installation

0. Updates

Version 1.11:

  • Added support for CMake and successfully build on Windows with MSCV 2019. Contributor: Dimitar Stanev (https://github.com/mitkof6)

Version 1.10:

  • Added new algorithm: Moth-Flame Optimization Algorithm (MFO). Contributor: Ahmad Dajani (https://github.com/adajani)

Version 1.9:

  • Added new algorithm: Whale Optimizer Algorithm (WOA). Contributor: Ahmad Dajani (https://github.com/adajani)

Version 1.8:

  • Added new algorithm: GWO. Contributor: Ahmad Dajani (https://github.com/adajani)
  • Enhance input parameter with default value.

Version 1.7:

  • Added a new algorithm: MOCH Expect new algorithms soon

Version 1.6:

  • Added new algorithms: OMOPSO, PAES, SMPSOhv, StandardPSO2007 and StandardPSO2011
  • Added CEC 2005 problems

Version 1.5:

  • Added new algorithms: SMS-EMOA, ssNSGA-II, MOEA/D and CMA-ES.
  • Added new problems: Srinivas, Tanaka, Rastrigin and Rosenbrock.
  • Changed POSIX threads to C++11 built-in threads.

Version 1.0.1:

  • Fixed a bug that prevented the last Wilcoxon table being generated correctly.
  • Changed FIT quality indicator to be minimized instead of being maximized.

Version 1.0:

  • Added quality indicators.
  • Added experiments.

Version 0.1:

  • First version.

1. Requirements

jMetalCpp has been developed in Unix machines (Ubuntu and MacOS X) as well as in Windows making use of Cygwin. The make utility has been used to compile the software package.

From version 1.5, it is mandatory to use a C++ compilator with C++11 support. This is needed to use the C++11 threads library.

2. Installing jMetalCpp

Copy the compressed file to the location where you want to install jMetal and unzip it.

Then, compile the code with the following command:

% make

One can also use the CMake building system to compile the project independently of the OS. Example for building on Linux can be found below:

mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=../install
make

3. Executing jMetal

All the main binaries are in the subfolder main included in the bin folder. Enter this folder to execute jMetal.

% cd bin
% cd main

The following multi-objective metaheuristics are provided in this version of jMetal:

  Algorithm                                   Command
  ---------------------------------------------------------
  NSGA-II                                     NSGAII_main
  ssNSGA-II                                   ssNSGAII_main
  GDE3                                        GDE3_main
  SMPSO                                       SMPSO_main
  SMPSOhv (NEW)                               SMPSOhv_main
  OMOPSO (NEW)                                OMOPSO_main
  PAES (NEW)                                  PAES_main
  SMS-EMOA                                    SMSEMOA_main
  MOEA/D                                      MOEAD_main

Additionally, we include single-objective variants of these techniques:

  Algorithm                                   Command
  ---------------------------------------------------------
  DE (Differential Evolution)                 DE_main
  gGA (Generational Genetic Algorithm)        gGA_main
  PSO (Particle Swarm Optimization)           PSO_main
  PSO (Standard 2007) (NEW)                   StandardPSO2007_main
  PSO (Standard 2011) (NEW)                   StandardPSO2011_main
  ssGA (Steady-state Genetic Algorithm)       ssGA_main
  CMA-ES                                      CMAES_main
  GWO (Grey Wolf Optimizer)                   GWO_main
  WOA (Whale Optimizer Algorithm)             WOA_main
  MFO (Moth-Flame Optimization Algorithm)     MFO_main

To execute one metaheuristic just use its associated command. For example, to execute GDE3 simply type the following command:

% ./GDE3_main

4. Choosing a problem

If you execute an algorithm like before, a default problem will be used for each algorithm. You can specify what problem to solve by passing it as a parameter. For example, if you desire to execute the Generational Genetic Algorithm to solve the Sphere problem, you need to execute the following command:

% ./gGA_main Sphere

The following multi-objective problems are currently included:

  • Fonseca
  • Kursawe
  • OneMax
  • Schaffer
  • Sphere
  • Srinivas
  • Tanaka
  • DTLZ1
  • DTLZ2
  • DTLZ3
  • DTLZ4
  • DTLZ5
  • DTLZ6
  • DTLZ7
  • ZDT1
  • ZDT2
  • ZDT3
  • ZDT4
  • ZDT5
  • ZDT6
  • LZ09_F1
  • LZ09_F2
  • LZ09_F3
  • LZ09_F4
  • LZ09_F5
  • LZ09_F6
  • LZ09_F7
  • LZ09_F8
  • LZ09_F9

The list of single-objective problems currently is composed of:

  • Griewank
  • OneMax
  • Rastrigin
  • Rosenbrock
  • Sphere
  • CEC2005

5. Configuring a problem

When you select a problem to solve, you can configure some problem parameters passing them as parameters. If a problem has three parameters, you can choose to specify one, two or the three of them.

The following parameters can be configured when going to solve a problem:

 Problem        Parameter 1         Parameter 2             Parameter 3
--------------------------------------------------------------------------------------
 Fonseca        Solution type
 Griewank       Solution type       Number of variables
 Kursawe        Solution type       Number of variables
 OneMax         Number of bits      Number of strings
 Rastrigin      Solution type       Number of variables
 Rosenbrock     Solution type       Number of variables
 Shaffer        Solution type
 Sphere         Solution type       Number of variables
 Srinivas       Solution type
 Tanaka         Solution type
 DTLZ1          Solution type       Number of variables     Number of objectives
 DTLZ2          Solution type       Number of variables     Number of objectives
 DTLZ3          Solution type       Number of variables     Number of objectives
 DTLZ4          Solution type       Number of variables     Number of objectives
 DTLZ5          Solution type       Number of variables     Number of objectives
 DTLZ6          Solution type       Number of variables     Number of objectives
 DTLZ7          Solution type       Number of variables     Number of objectives
 LZ09_F1        Solution type
 LZ09_F2        Solution type
 LZ09_F3        Solution type
 LZ09_F4        Solution type
 LZ09_F5        Solution type
 LZ09_F6        Solution type
 LZ09_F7        Solution type
 LZ09_F8        Solution type
 LZ09_F9        Solution type
 ZDT1           Solution type       Number of variables
 ZDT2           Solution type       Number of variables
 ZDT3           Solution type       Number of variables
 ZDT4           Solution type       Number of variables
 ZDT5           Solution type       Number of variables
 ZDT6           Solution type       Number of variables

The following values are allowed for the 'Solution type' parameter: - Real - Binary

For example, if you want to solve the DTLZ5 problem using SMPSO using 'Real" as solution type, you would need to execute the following command:

% ./SMPSO_main DTLZ5 Real

In the future, a binary-real encoding will be available.

If you intend to modify the default parameters of the DTLZ5 problem with ten variables and two objectives, the following command must be executed:

%./SMPSO_main DTLZ5 Real 10 2

The CEC 2005 problems are an exception, as the order of the parameters change if you are setting one, two or the three of them.

 Problem        Parameter 1         Parameter 2             Parameter 3
--------------------------------------------------------------------------------------
 CEC2005        Problem number
 CEC2005        Solution type       Problem number
 CEC2005        Solution type       Problem number          Number of variables

The <problem number> variable accepts values from 1 to 25. The default values for Solution type and Number of variables are Real and 10. Examples:

% ./gGA_main CEC2005 1
% ./gGA_main CEC2005 Real 1
% ./gGA_main CEC2005 Real 1 20

6. Calculating quality indicators

To assess the performance of multi-objective metaheuristics, quality indicators are needed to evaluate the quality of the obtained Pareto front approximations.

The following quality indicators are provided in this version of jMetal:

  Quality Indicator                     Command
  ---------------------------------------------------------------------
  Hypervolume                           Hypervolume
  Spread                                Spread
  Epsilon                               Epsilon
  Generational Distance                 GenerationalDistance
  Inverted Generational Distance        InvertedGenerationalDistance

This quality indicators require to know the true Pareto front of the problems. In the case of the included benchmark problems, their Pareto fronts can be downloaded from http://jmetal.sourceforge.net/problems.html

The quality indicator binaries are included in bin/qualityIndicator/main. Enter this folder to execute any indicator.

% cd bin
% cd qualityIndicator
% cd main

To calculate a quality indicator you have to execute the following command:

% ./<QualityIndicatorCommand> <SolutionFrontFile> <TrueFrontFile> <numberOfObjectives>

For example, if you need to calculate the hypervolume indicator on the `FUN file obtained by a metaheuristic when trying to solve the ZDT1 problem, you have to execute the following command:

% ./Hypervolume /home/user
View on GitHub
GitHub Stars72
CategoryDevelopment
Updated3d ago
Forks34

Languages

C++

Security Score

80/100

Audited on Mar 24, 2026

No findings