Skip to content

Bash Script to help statistical tests of Multi-Objective Evolutionary Algorithms.

License

Notifications You must be signed in to change notification settings

LucasLP/ExecuteJMetal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ExecuteJMetal

Bash Script to help statistical tests of Multi-Objective Evolutionary Algorithms.
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.
  1. Use the src in additional files to programming your JMetalMain
    Look at the end of this files for more informations.

  2. 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

  3. 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

  4. Execute
    sh Execute.sh

  5. 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"
Obs.: Run it before the run of other Experiment Components (generate of tables and scripts) because these components can modify the experiment algorithm, then you should have an exception;

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
  1. Clone this project;
  2. Copy src of JMetalMain, Configuration, ExecuteExperiment, MyRunner to your project and put your algorithm;
    1. copy MOEAD, MOEADDRA, MOEADBuilder, NSGAII and IBEA
  3. Configure the initialization of your algorithm in Configuration.java;
  4. Build your JMetal.jar, and put in this directory;
  5. Configure the algorithms and benchmark to run in Execute.sh
  6. Execute it!
  7. The Results are in "experiment/MyExperiments"