This Scripts use JMetal Framework 5.2.
Only for Linux Users.
Include another two experiment components for JMetal, see in source code in java.
Another component included in this project is the statistical comparisons, look at: "experiment/MyExperiments/comparison/examples"
But this component can be old, please see this repository.
-
Use the src in additional files to programming your JMetalMain
Look at the end of this files for more informations. -
Install some programs
2.1. You need LaTeX - For .tex files
sudo apt-get install texlive-full
sudo apt install texlive-latex-base
sudo apt install texlive-generic-extra
sudo apt-get install texlive-latex-extra
sudo apt-get install texlive-science
2.2. You need R Language - for .R files
sudo apt-get update
sudo apt-get install r-base
sudo apt-get install r-base-dev
2.3. Install Irace:
R
install.packages("irace")
2.4. Install Scatterplot3D, used in new experiment components:
R
install.packages("scatterplot3d", repos="http://R-Forge.R-project.org")
2.5. Install PMCMR
install.packages("PMCMR")
2.6. (optional) Install pdftk, used to merge PDFs
sudo apt-get install pdftk
-
Configure Execute.sh
3.1. Set Benchmark
3.2. Set Algorithm and its Tag (tag is the name of data files)
3.3. Set Execution line
3.4. Set Comparative Line -
Execute
sh Execute.sh
-
Analyse the results in folder: experiment/MyExperiments/Result_$experimentName_$benchmark/
In Additional Folder
Script: renameAll.sh
Call the renameScript.sh for rename data files
It be useful if you had old versions of JMetal and update, then,
all of your data files will be for example "FUN.0", and the new versions use "FUN0.tsv"
If you have this problem, set in this script algorithm and instance to rename.
Script: renameScript.sh
Rename All files in ".0 .1 .2 ... .max" to ".tsv".
Source: How to read input parameters to execute JMetal with this scripts.
"MyRunner.java" is a single runner of algorithm configured by "Configuration.java"
"ExecuteExperiment.java" can execute several runs and get all data for statistical test
"Configuration.java" configure all tests, algorithms and benchmark
"JMetalMain.java" read first argument to configure how it will execute
Example of execution:
$ java -jar JMetal.java --statistic ZDT --algorithm NSGAII --algorithm MOEAD --tag test
It will execute NSGAII and MOEAD algorithm in benchmark ZDT, and MOEAD will save its data in "test" folder.
$ java -jar JMetal.java --single-run ZDT1 --algorithm MOEAD
It will execute MOEAD in ZDT1 instance and print the quality indicator at console.
$ java -jar JMetal.jar --comparative UF --algorithm MOEAD --algorithm MOEADDRA
It will generate latex and R files of statistical comparisons using existing data files.
$ java -jar JMetal.jar --indicators UF --algorithm MOEAD
It will execute the indicators of existing data files.
Structure of tests
- Execute.sh
- QualityIndicator.sh
- JMetal.jar Put You'r compilation here
- Additional/
- renameAll.sh
- renameScript.sh
- src/
- Configuration.java
- ExecuteExperiment.java
- JMetalMain.java
- MyRunner.java
- lib/ Lib of you'r project
- irace/ Irace example using you compilation
- experiment/
- MyExperiments/
- data/
The "GenerateEvolutionChart.java" and "HistoryData.java" are the classes to generate this type of plot:
For use this module, you need follow this steps:
- In your algorithm: implement "HistoricAlgorithm", for example look MOEADDRA in this src files;
- Add an Map of "String" to "HistoryData" and add the classes for each indicators;
- At each evaluation test and calculate the quality indicator;
- You can use the static methods of "HistoricAlgorithm", only call this methos like the implementation in MOEADDRA in this src;
- At final, Print Historic data, for example look "ExecuteExperiment"
- Generate Rscript with "GenerateEvolutionChart"
The Scatter Plot of point can be found at "experiment/MyExperiments/comparison/functions.R".
You can import the scripts and use, like:
R
source("functions.R")
algorithms = c("MOEADDRA","NSGAII","IBEA")
objectivePoints("UF7", algorithms)
objectivePoints3D("UF8", algorithms)
Step by Step: How to use
- Clone this project;
- Copy src of JMetalMain, Configuration, ExecuteExperiment, MyRunner to your project and put your algorithm;
- copy MOEAD, MOEADDRA, MOEADBuilder, NSGAII and IBEA
- Configure the initialization of your algorithm in Configuration.java;
- Build your JMetal.jar, and put in this directory;
- Configure the algorithms and benchmark to run in Execute.sh
- Execute it!
- The Results are in "experiment/MyExperiments"