diff --git a/.github/workflows/build_ubuntu_debug.yml b/.github/workflows/build_ubuntu_debug.yml
new file mode 100644
index 000000000..58aac6a42
--- /dev/null
+++ b/.github/workflows/build_ubuntu_debug.yml
@@ -0,0 +1,47 @@
+name: Build Debug (Ubuntu)
+on: [push, pull_request]
+
+env:
+ # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
+ BUILD_TYPE: Debug
+
+jobs:
+ build:
+ # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
+ # You can convert this to a matrix build if you need cross-platform coverage.
+ # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ compiler: [g++-10, g++-9, g++-8, g++-7, clang-6, clang-7, clang-8, clang-9, clang-10, clang-11, clang-12]
+
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Caching objects
+ id: cache-objects
+ uses: actions/cache@v4
+ with:
+ path: ~/.cache/ccache
+ key: ${{ runner.os }}-${{env.BUILD_TYPE}}-${{ matrix.compiler }}-objects
+
+ - name: Install Dependencies
+ shell: bash
+ run: |
+ sudo apt-get install libeigen3-dev libboost-dev
+
+ - name: Configure
+ # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
+ # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
+ run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DEDO=ON -DEDO_USE_LIB=Eigen3 -DENABLE_CMAKE_EXAMPLE=ON -DENABLE_CMAKE_TESTING=ON
+
+ - name: Build
+ # Build your program with the given configuration
+ run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
+
+ - name: Test
+ working-directory: ${{github.workspace}}/build
+ # Execute tests defined by the CMake configuration.
+ # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
+ run: ctest -C ${{env.BUILD_TYPE}}
+
diff --git a/.gitignore b/.gitignore
index 5de8ffbd3..ef1e87e20 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,11 +1,20 @@
-# ignore html files
+# ignore generated files
*.html
+*.pdf
# ignore all textual files
*.txt
+*.swp
+*.swo
+.kak_history
+*.log
+*.csv
+*.ods
# ignore object and archive files
*.[oa]
+*.bak
+*.tar*
tags
# ignore auto-saved files
@@ -29,4 +38,7 @@ debug/*
build/*
website/EO_star.png
website/paradiseo_logo.png
+Release/*
+Debug/*
+Build/*
diff --git a/AUTHORS b/AUTHORS
index 604157f80..47e9ce4b9 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -1,41 +1,52 @@
Current maintainers
===================
-Arnaud Liefooghe
-Clive Canape
-Johann Dreo
-Sébastien Verel
-Active developpers
-==================
-Alexandre Quemy
-Benjamin Bouvier
-Caner Candan
-Pierre Savéant
+Johann Dreo
+
Past contributors
=================
+
atantar
+Alesandro Sidero
+Alexandre Quemy
+Alix Zheng
+Amine Aziz-Alaoui
+Arnaud Liefooghe
+Benjamin Bouvier
+Bahri
+Caner Candan
+Clive Canape
fatene
Gustavo Romero Lopez
jboisson
Jeroen Eggermont
Jochen Küpper
-Joost
+Joost
Juan Julian Merelo Guervos
Jérémie Humeau
+Jxtopher
Karima Boufaras
-legillon
+legillono
+Leo Bertheas
Louis Da Costa
Loïc Jean David Arjanen
Maarten Keijzer
+Mammar Amara
+Manu
Marc Schoenauer
Marie-Éleonore
Mostepha Khouadjia
Olivier König
+Pierre Savéant
Pedro Angel Castillo Valdivieso
+Potalas
+Ronald Pinho
Steve Madere
Sébastien Cahon
+Sébastien Verel
Thomas Legrand
+Thibault Lasnier
Victor Manuel Rivas Santos
wcancino
xohm
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 835847770..52c1fa4a5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,5 +1,6 @@
# ParadiseO
+
######################################################################################
### 0) Check the CMake version
######################################################################################
@@ -12,13 +13,24 @@ cmake_minimum_required(VERSION 3.10 FATAL_ERROR)
## Name
project("ParadisEO"
- VERSION 3.0.0
+ VERSION 3.1.3
DESCRIPTION "Evolutionary optimization framework"
LANGUAGES C CXX)
## Language
set(CMAKE_CXX_STANDARD 17)
+## ccache
+find_program(CCACHE_PROGRAM ccache)
+
+if (CCACHE_PROGRAM)
+ message(NOTICE "-- ccache is enabled (found here: ${CCACHE_PROGRAM})")
+ set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "\"${CCACHE_PROGRAM}\"")
+ set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK "\"${CCACHE_PROGRAM}\"")
+else ()
+ message(NOTICE "-- ccache has not been found")
+endif ()
+
######################################################################################
### 2) Check dependencies
@@ -51,16 +63,16 @@ include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Target.cmake)
######################################################################################
## Paths to sources of modules
-set( EO_SRC_DIR "${CMAKE_SOURCE_DIR}/eo" CACHE INTERNAL "ParadisEO-EO source directory" FORCE)
-set( EDO_SRC_DIR "${CMAKE_SOURCE_DIR}/edo" CACHE INTERNAL "ParadisEO-EDO source directory" FORCE)
-set( MO_SRC_DIR "${CMAKE_SOURCE_DIR}/mo" CACHE INTERNAL "ParadisEO-MO source directory" FORCE)
-set(MOEO_SRC_DIR "${CMAKE_SOURCE_DIR}/moeo" CACHE INTERNAL "ParadisEO-MOEO source directory" FORCE)
-set( SMP_SRC_DIR "${CMAKE_SOURCE_DIR}/smp" CACHE INTERNAL "ParadisEO-SMP source directory" FORCE)
-set( MPI_SRC_DIR "${CMAKE_SOURCE_DIR}/eo/src/mpi" CACHE INTERNAL "ParadisEO-MPI source directory" FORCE)
+set( EO_SRC_DIR "${PROJECT_SOURCE_DIR}/eo" CACHE INTERNAL "ParadisEO-EO source directory" FORCE)
+set( EDO_SRC_DIR "${PROJECT_SOURCE_DIR}/edo" CACHE INTERNAL "ParadisEO-EDO source directory" FORCE)
+set( MO_SRC_DIR "${PROJECT_SOURCE_DIR}/mo" CACHE INTERNAL "ParadisEO-MO source directory" FORCE)
+set(MOEO_SRC_DIR "${PROJECT_SOURCE_DIR}/moeo" CACHE INTERNAL "ParadisEO-MOEO source directory" FORCE)
+set( SMP_SRC_DIR "${PROJECT_SOURCE_DIR}/smp" CACHE INTERNAL "ParadisEO-SMP source directory" FORCE)
+set( MPI_SRC_DIR "${PROJECT_SOURCE_DIR}/eo/src/mpi" CACHE INTERNAL "ParadisEO-MPI source directory" FORCE)
-set(PROBLEMS_SRC_DIR "${CMAKE_SOURCE_DIR}/problems" CACHE INTERNAL "Problems dependant source directory" FORCE)
+set(PROBLEMS_SRC_DIR "${PROJECT_SOURCE_DIR}/problems" CACHE INTERNAL "Problems dependant source directory" FORCE)
-set(CMAKE_BASE_SOURCE_DIR ${CMAKE_SOURCE_DIR})
+set(CMAKE_BASE_SOURCE_DIR ${PROJECT_SOURCE_DIR})
# All libraries are built in /lib/
set( EO_BIN_DIR "${CMAKE_BINARY_DIR}" CACHE INTERNAL "ParadisEO-EO binary directory" FORCE)
@@ -80,31 +92,34 @@ set(SMP "false" CACHE BOOL "Build the SMP module")
set(MPI "false" CACHE BOOL "Build the MPI module")
## EO Module
-set(EO_MODULE_NAME "Evolving Object")
+set(MODULE_NAME "Paradiseo")
+set(DOXYGEN_CONFIG_DIR ${CMAKE_CURRENT_SOURCE_DIR}/doxygen)
+# set(EO_MODULE_NAME "Evolving Objects")
set(CMAKE_SOURCE_DIR ${EO_SRC_DIR})
add_subdirectory(${EO_SRC_DIR})
if(NOT EO_ONLY)
## MO Module
- set(MO_MODULE_NAME "Moving objects")
+ # set(MO_MODULE_NAME "Moving Objects")
+ # set(MODULE_NAME "Moving Objects")
set(CMAKE_SOURCE_DIR ${MO_SRC_DIR})
add_subdirectory(${MO_SRC_DIR})
## EDO Module
if(EDO)
- set(EDO_MODULE_NAME "Evolving Distribution Objects")
+ # set(EDO_MODULE_NAME "Evolving Distribution Objects")
set(CMAKE_SOURCE_DIR ${EDO_SRC_DIR})
add_subdirectory(${EDO_SRC_DIR})
endif()
## MOEO Module
- set(MOEO_MODULE_NAME "Multi-Objectives EO")
+ # set(MOEO_MODULE_NAME "Multi-Objectives EO")
set(CMAKE_SOURCE_DIR ${MOEO_SRC_DIR})
add_subdirectory(${MOEO_SRC_DIR})
## SMP Module
if(SMP)
- set(SMP_MODULE_NAME "Symmetric Multi-Processing")
+ # set(SMP_MODULE_NAME "Symmetric Multi-Processing")
set(CMAKE_SOURCE_DIR ${SMP_SRC_DIR})
add_subdirectory(${SMP_SRC_DIR})
endif()
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 000000000..6eff1e82f
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,84 @@
+
+Licenses
+========
+
+ParadisEO modules are using free software licenses,
+any contribution should be licensed under the same license.
+
+| Module | License | Version | Copyleft | Patent-left |
+|--------|---------|---------|----------|-------------|
+| EO | LGPL | 2 | Lib only | No |
+| EDO | LGPL | 2 | Lib only | No |
+| MO | CeCILL | 2.1 | Yes | No |
+| MOEO | CeCILL | 2.1 | Yes | No |
+| SMP | CeCILL | 2.1 | Yes | No |
+
+
+Contribution Workflow
+=====================
+
+The maintainer(s) will try to answer under a couple of weeks, if not, do not hesitate to send an e-mail.
+
+If you're not familiar with Git and merge requests, start by cloning one of the main repository:
+- `git clone https://github.com/nojhan/paradiseo.git`
+- `git clone https://scm.gforge.inria.fr/anonscm/git/paradiseo/paradiseo.git`
+
+
+Git workflow
+------------
+
+ParadisEO follows a classical Git workflow using merge requests.
+In order to fix a bug or add a feature yourself, you would follow this process.
+
+```bash
+cd paradiseo
+git pull origin master # Always start with an up-to-date version.
+git checkout -b # Always work on a dedicated branch.
+# [ make some modifications… ]
+git commit
+mkdir build
+cd build
+cmake -DCMAKE_BUILD_TYPE=Debug -BUILD_TESTING=ON -DENABLE_CMAKE_TESTING=ON .. && make && ctest # Always test.
+cd ..
+git pull origin master # Always check that your modification still merges.
+```
+
+If everything went without error, you can either send the patch or submit a merge request.
+To do so, you can either:
+- submit a "pull request" on Github: [nojhan/paradiseo](https://github.com/nojhan/paradiseo),
+- or send a patch on the [ParadisEO mailing list](https://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/paradiseo-users).
+
+See below for the details.
+
+
+Github pull request
+-------------------
+
+Once logged in Github, go to the [maintainer repository](https://github.com/nojhan/paradiseo) and click the "fork" button.
+You should have your own copy of the ParadisEO project under your own name.
+Then add it as an additional "remote" to your ParadisEO Git tree: `git remote add me `.
+Then, checkout the branch holding the modifications you want to propose, check that it merges with the main repository
+and push it on your own repository:
+```bash
+git checkout
+git pull origin master
+git push me
+```
+
+Then go to the maintainer's repository page, click on the "Pull request" tab, and on the "New pull request" button.
+You should then select the maintainer's master branch on the left dropdown list, and your own `my_feature` on the right one.
+Explain why the maintainer should merge your modifications and click the "Submit" button.
+
+
+E-mail your patch
+-----------------
+
+Generate a patch file from the difference between your branch and a fresh master:
+```bash
+git pull origin master
+git diff master > my_feature.patch
+```
+
+Then send the `my_feature.patch` (along with your explanations about why the maintainer should merge your modifications)
+to the [mailing list](https://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/paradiseo-users).
+
diff --git a/INSTALL b/INSTALL
deleted file mode 100644
index 6f1d121a7..000000000
--- a/INSTALL
+++ /dev/null
@@ -1,200 +0,0 @@
-
-==========================================================================================
- INSTALLING PARADISEO
-==========================================================================================
-
-There is several ways to install ParadisEO, according to your needs.
-
-==========================================================================================
- WINDOWS
-==========================================================================================
-
-On Windows, and for compatibility reason, ParadisEO supply support only for MinGW.
-Feel free to test with another compiler and to send us you report.
-
-------------------------------------------------------------------------------------------
-1) WITH EXE
-------------------------------------------------------------------------------------------
-
-The simpliest way ton install ParadisEO on Windows is to use the NSIS installer.
-We would like to draw your attention on the fact that the PATH variable will not
-be affected by the installation in order to allow anybody to install ParadisEO
-without administration right. To have further information about how to use ParadisEO
-in your project, see the tutorial on ParadisEO website (http://paradiseo.gforge.inria.fr/).
-
-------------------------------------------------------------------------------------------
-2) WITH CMAKE
-------------------------------------------------------------------------------------------
-
-You can also install ParadisEO using CMake. For that you must have a compiler installed,
-and obviously cmake.
-Then, follow UNIX instructions.
-
-==========================================================================================
- UNIX
-==========================================================================================
-------------------------------------------------------------------------------------------
-1. WITH CMAKE
-------------------------------------------------------------------------------------------
-1.0 DEPENDENCIES
-------------------------------------------------------------------------------------------
-Optionnal
-- Doxygen for documentation
-- lcov for coverage
-
-------------------------------------------------------------------------------------------
-1.1 FAST INSTALLATION
-------------------------------------------------------------------------------------------
-
-After getting ParadisEO sources from repository, you have to create a build directory in order to keep your file tree clean.
-
-> mkdir build
-> cd build
-
-To make the installation easier, ParadisEO propose you two installation types which are "Full" and "Min".
-Full corresponds examples / lessons, tests and obviously libraries.
-Min corresponds to libraries and headers and it is the standard behavior.
-
-You can specified an installation type by adding the following declaration to cmake :
-
-> cmake .. -DINSTALL_TYPE=full
-> cmake .. -DINSTALL_TYPE=min
-which is equivalent to
-> cmake ..
-
-Actually, by default the generator will be "Unix Makefiles" and cmake will try to look for a C++ compiler.
-Be sure you have make installed, or choose an alternative according to your configuration.
-To know available generators on your computer, type cmake -help. If you are on Windows and you use MinGW, you have to specify it explicitly by adding -G "MinGW Makefiles".
-
-To compile ParadisEO simply compile sources using your generator. For instance, if you are using Unix Makefiles, type make.
-
-------------------------------------------------------------------------------------------
-1.2 BUILD TYPE
-------------------------------------------------------------------------------------------
-
-There are 2 types of build : Release or Debug.
-To explicitly change the type, add -DDEBUG=true, otherwise, it will be the Release type.
-
-------------------------------------------------------------------------------------------
-1.3 COMPILERS
-------------------------------------------------------------------------------------------
-
-You can change the compiler used by CMake with the following options :
-
->-DCMAKE_C_COMPILER=/path/to/your/c/compiler
-
->-DCMAKE_CXX_COMPILER=/path/to/your/c++/compiler
-
-------------------------------------------------------------------------------------------
-1.4 INSTALLATION
-------------------------------------------------------------------------------------------
-
-WARNING : This require administration rights.
-
-To install ParadisEO in standard paths (such as /usr/lib for lib and /usr/include for headers on UNIX-like) :
-
-> make install
-
-------------------------------------------------------------------------------------------
-2. SPECIFIC MODULE
-------------------------------------------------------------------------------------------
-2.1 EO MODULE ONLY
-------------------------------------------------------------------------------------------
-
-If you want to compile and install only the Evolving Objects module, you can add to CMake the following option :
-
-> cmake .. -DEO_ONLY
-
-------------------------------------------------------------------------------------------
-2.1 SMP MODULE
-------------------------------------------------------------------------------------------
-
-WARNING : The SMP module requires gcc 4.7 or higher. This is due to the fact that it uses the new C++ standard.
-
-WARNING : At the moment, the SMP module does not work on Windows or Mac OS X since MinGW does not provide support for std::thread
- and Apple does not supply a recent version of gcc (but you can try to compile gcc 4.7 by yourself).
-
-To enable the compilation of the SMP module, just add -DSMP=true to CMake :
-
-> cmake .. -DSMP=true
-
-Depending on your distribution, you might have to give to CMake the path of gcc and g++ 4.7.
-This is the case for Ubuntu 12.04 LTS for instance. Please, check installation guide on ParadisEO website for more details.
-
-If you are in that case and assuming you have a standard path for gcc et g++ 4.7 :
-
-> cmake .. -DSMP=true -DCMAKE_C_COMPILER=/usr/bin/gcc-4.7 -DCMAKE_CXX_COMPILER=/usr/bin/g++-4.7
-
-------------------------------------------------------------------------------------------
-2.2 PEO MODULE
-------------------------------------------------------------------------------------------
-
-WARNING : The PEO module requires libXML 2 and a MPI implementation such as MPICH2.
-
-To enable the compilation of the PEO module, just add -DPEO=true to CMake :
-
-> cmake .. -DPEO=true
-
-------------------------------------------------------------------------------------------
-2.3 EDO MODULE
-------------------------------------------------------------------------------------------
-
-WARNING : The EDO module requires either the Boost::ublas or the Eigen3 library.
-
-To enable the compilation of the EDO module, just add -DEDO=true to CMake :
-
-> cmake .. -DEDO=true
-
-
-------------------------------------------------------------------------------------------
-3. DOCUMENTATION
-------------------------------------------------------------------------------------------
-
-There is 2 ways to build ParadisEO documentation : module by module, or all the documentation.
-
-Targets are :
-doc for all documentations
-doc-eo for building EO documentation
-doc-mo for MO
-doc-edo for MO
-doc-moeo for MOEO
-doc-smp for SMP
-
-Each documentation are generated separatly in the module build folder.
-For instance, after the generation of the MO documentation, you will find it in build/paradise-mo/doc.
-
-------------------------------------------------------------------------------------------
-4. LESSONS / EXAMPLES
-------------------------------------------------------------------------------------------
-
-Examples and lessons are generated by default.
-If you want to disable lessons manually, you have to specify -DENABLE_CMAKE_TESTING=false to CMake.
-If you want to build a specific lesson or example, you can check the list of available targets with make help.
-
-All lessons are build on the same pattern : Lesson.
-For instance, make moLesson4 will build the Lesson 4 from the MO module.
-Easy, isn't it ?
-
-------------------------------------------------------------------------------------------
-5. TESTS
-------------------------------------------------------------------------------------------
-5.1 CTESTS
-------------------------------------------------------------------------------------------
-
-By performing tests, you can check your installation.
-Testing is disable by default, except if you build with the full install type.
-To enable testing, define -DENABLE_CMAKE_TESTING=true when you launch cmake.
-
-To perform tests simply type ctest or make test.
-
-------------------------------------------------------------------------------------------
-5.2 REPORTING
-------------------------------------------------------------------------------------------
-
-Feel free to send us reports about building, installation, tests and profiling in order to help us to improve compatibilty and installation process. Sending reports is very simple :
-
-> ctest -D Experimental
-
-WARNING : Reports are anonymous. CTest will also send informations about your configuration such as OS, CPU frequency, etc.
-
-
diff --git a/INSTALL.md b/INSTALL.md
new file mode 100644
index 000000000..a3fb4e1b7
--- /dev/null
+++ b/INSTALL.md
@@ -0,0 +1,217 @@
+
+Summary
+=======
+
+As Paradiseo is a development framework, you do not really need to install it on all your systems.
+Just put it somewhere on your development computer, compile it from here and indicate where to find it to your favorite build system.
+
+
+Build
+-----
+
+Paradiseo is mainly developed for Linux, on which it is straightforward to install a C++ build chain. For example, on Ubuntu 18.04:
+```bash
+sudo apt install g++-8 cmake make libeigen3-dev libopenmpi-dev doxygen graphviz libgnuplot-iostream-dev
+```
+
+Paradiseo use the CMake build system, so building it should be as simple as:
+```bash
+mkdir build ; cd build ; cmake -DEDO=ON .. && make -j
+```
+
+The file `howto_build_paradiseo.apptainer.def` shows you how to install and build from scratch.
+It is a definition file for the [Apptainer](https://apptainer.org/) container system,
+which is often used on HPC clusters.
+
+
+Develop
+-------
+
+Download the quick start project template, edit the `CMakeLists.txt` file to indicate where to find Paradiseo and start developing your own solver.
+
+If you don't know CMake or a modern build system, you should still be able to build a stand-alone code from a `paradiseo/build` directory with something like:
+```bash
+ c++ ../solver.cpp -I../eo/src -I../edo/src -DWITH_EIGEN=1 -I/usr/include/eigen3 -std=c++17 -L./lib/ -leo -leoutils -les -lga -o solver
+```
+
+
+Install
+-------
+
+If you want to install ParadisEO system-wide anyway:
+```bash
+cmake -D CMAKE_BUILD_TYPE=Release .. && sudo make install
+```
+
+
+More details
+============
+
+As a templated framework, most of the ParadisEO code rely within headers and is thus compiled
+by you when you build your own solver.
+
+However, in order to save some compilation time,
+the EO and EDO modules are compiled within static libraries by the default build system.
+
+If you believe you have a working build chain and want to test if it works with ParadisEO,
+you can try to build the tests and the examples.
+Note that if some of them failed (but not all), you may still be able to build your own solver,
+as you will most probably not use all ParadisEO features anyway.
+
+
+Windows
+-------
+
+Last time we checked, ParadisEO could only be built with MinGW.
+Feel free to test with another compiler and to send us your report.
+
+As of today, we cannot guarantee that it will be easy to
+install ParadisEO under Windows if you're a beginner.
+There is still some (possibly outdated) help about oldest version on the [Website](http://paradiseo.gforge.inria.fr/).
+
+If you know how to install a working compiler and the dependencies,
+you may follow the same steps than the Linux process below.
+
+If you are a beginner, we strongly suggest you install a Linux distribution
+(either as an OS, as a virtual machine or using the Windows 10 compatibility layer).
+
+
+Linux
+-----
+
+### Dependencies
+
+In order to build the latest version of Paradiseo, you will need a C++ compiler supporting C++17.
+So far, GCC and CLANG gave good results under Linux. You will also need the CMake and make build tools.
+
+Some features are only available if some dependencies are installed:
+- Most of the EDO module depends on either uBlas or Eigen3. The recommended package is Eigen3, which enables the adaptive algorithms.
+- Doxygen is needed to build the API documentation, and you should also install graphviz if you want the class relationship diagrams.
+- GNUplot is needed to have the… GNUplot graphs at checkpoints.
+
+To install all those dependencies at once under Ubuntu (18.04), just type:
+```bash
+sudo apt install g++-8 cmake make libeigen3-dev libopenmpi-dev doxygen graphviz libgnuplot-iostream-dev.
+```
+
+
+### Build
+
+The build chain uses the classical workflow of CMake.
+The recommended method is to build in a specific, separated directory and call `cmake ..` from here.
+CMake will prepare the compilation script for your system of choice which you can change with the `-G ` option (see your CMake doc for the list of available generators).
+
+Under Linux, the default is `make`, and a build command is straitghtforward:
+```bash
+mkdir build ; cd build ; cmake .. && make -j
+```
+
+There is, however, several build options which you may want to switch.
+To see them, we recommend the use of a CMake gui, like ccmake or cmake-gui.
+On the command line, you can see the available options with: `cmake -LH ..`.
+Those options can be set with the `-D
There is, however, several build options which you may want to switch.
- To see them, we recommend the use of a CMake gui, like ccmake or cmake-gui.
+ To see them, we recommend the use of a CMake gui, like ccmake (available through the cmake-curses-gui package in Debian/Ubuntu) or cmake-gui.
On the command line, you can see the available options with: cmake -LH ...
Those options can be set with the -D<option>=<value> argument to cmake.
@@ -1191,7 +1252,7 @@ undiscovered knowledge.
Contribute
Paradiseo development is open and contributions are welcomed.
@@ -1261,7 +1323,7 @@ undiscovered knowledge.
worked a lot on the multi-objective module and
on the local-search one along with Sébastien Verel
and Jeremy Humeau.
- In the same team, Clive Canape and J. Boisson made significant contributions.
+ In the same team, C. C. and J. Boisson made significant contributions.
Karima Boufaras specifically worked on (now deprecated) GPU tools.
The (then) EO project was then taken over by Johann Dreo,
diff --git a/doxygen/DoxygenLayout.xml b/doxygen/DoxygenLayout.xml
new file mode 100644
index 000000000..562b5f2b8
--- /dev/null
+++ b/doxygen/DoxygenLayout.xml
@@ -0,0 +1,226 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/eo/doc/eo.doxyfile.cmake b/doxygen/doxyfile.cmake
similarity index 96%
rename from eo/doc/eo.doxyfile.cmake
rename to doxygen/doxyfile.cmake
index 934114d8f..301b36f6b 100644
--- a/eo/doc/eo.doxyfile.cmake
+++ b/doxygen/doxyfile.cmake
@@ -25,13 +25,21 @@ DOXYFILE_ENCODING = UTF-8
# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
# by quotes) that should identify the project.
-PROJECT_NAME = @PACKAGE_NAME@
+PROJECT_NAME = @MODULE_NAME@
+
+# With the PROJECT_LOGO tag one can specify a logo or an icon
+# that is included in the documentation.
+# The maximum height of the logo should not exceed 55 pixels
+# and the maximum width should not exceed 200 pixels.
+# Doxygen will copy the logo to the output directory.
+
+PROJECT_LOGO = @CMAKE_SOURCE_DIR@/docs/img/paradiseo_logo.svg
# The PROJECT_NUMBER tag can be used to enter a project or revision number.
# This could be handy for archiving the generated documentation or
# if some version control system is used.
-PROJECT_NUMBER = @PACKAGE_VERSION@
+PROJECT_NUMBER = @PROJECT_VERSION@
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
# base path where the generated documentation will be put.
@@ -272,22 +280,6 @@ SUBGROUPING = YES
TYPEDEF_HIDES_STRUCT = NO
-# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
-# determine which symbols to keep in memory and which to flush to disk.
-# When the cache is full, less often used symbols will be written to disk.
-# For small to medium size projects (<1000 input files) the default value is
-# probably good enough. For larger projects a too small cache size can cause
-# doxygen to be busy swapping symbols to and from disk most of the time
-# causing a significant performance penality.
-# If the system has enough physical memory increasing the cache will improve the
-# performance by keeping more symbols in memory. Note that the value works on
-# a logarithmic scale so increasing the size by one will rougly double the
-# memory usage. The cache size is given by this formula:
-# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
-# corresponding to a cache size of 2^16 = 65536 symbols
-
-SYMBOL_CACHE_SIZE = 0
-
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
@@ -500,7 +492,7 @@ FILE_VERSION_FILTER =
# file name after the option, if omitted DoxygenLayout.xml will be used as the name
# of the layout file.
-LAYOUT_FILE =
+LAYOUT_FILE = @CMAKE_SOURCE_DIR@/doxygen/DoxygenLayout.xml
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
@@ -594,7 +586,7 @@ RECURSIVE = YES
# excluded from the INPUT source files. This way you can easily exclude a
# subdirectory from a directory tree whose root is specified with the INPUT tag.
-EXCLUDE = @CMAKE_SOURCE_DIR@/src/obsolete @CMAKE_SOURCE_DIR@/test @CMAKE_SOURCE_DIR@/tutorial @CMAKE_SOURCE_DIR@/contrib @CMAKE_SOURCE_DIR@/app
+EXCLUDE = @CMAKE_SOURCE_DIR@/deprecated @CMAKE_SOURCE_DIR@/eo/contrib @CMAKE_SOURCE_DIR@/eo/app @CMAKE_SOURCE_DIR@/eo/tutorial @CMAKE_SOURCE_DIR@/mo/tutorial @CMAKE_SOURCE_DIR@/moeo/tutorial @CMAKE_SOURCE_DIR@/smp/tutorial
# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
# directories that are symbolic links (a Unix filesystem feature) are excluded
@@ -608,7 +600,7 @@ EXCLUDE_SYMLINKS = NO
# against the file with absolute path, so to exclude all test directories
# for example use the pattern */test/*
-EXCLUDE_PATTERNS =
+EXCLUDE_PATTERNS = *.sif/*
# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
# (namespaces, classes, functions, etc.) that should be excluded from the
@@ -622,7 +614,7 @@ EXCLUDE_SYMBOLS =
# directories that contain example code fragments that are included (see
# the \include command).
-EXAMPLE_PATH = @CMAKE_SOURCE_DIR@/test
+EXAMPLE_PATH = @CMAKE_SOURCE_DIR@/eo/test @CMAKE_SOURCE_DIR@/edo/test @CMAKE_SOURCE_DIR@/mo/test @CMAKE_SOURCE_DIR@/moeo/test @CMAKE_SOURCE_DIR@/smp/test
# If the value of the EXAMPLE_PATH tag contains directories, you can use the
# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
@@ -784,14 +776,14 @@ HTML_HEADER =
HTML_FOOTER =
-# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# The HTML_EXTRA_STYLESHEET tag can be used to specify a user-defined cascading
# style sheet that is used by each HTML page. It can be used to
# fine-tune the look of the HTML output. If the tag is left blank doxygen
# will generate a default style sheet. Note that doxygen will try to copy
# the style sheet file to the HTML output directory, so don't put your own
# stylesheet in the HTML output directory as well, or it will be erased!
-HTML_STYLESHEET =
+HTML_EXTRA_STYLESHEET = @CMAKE_SOURCE_DIR@/doxygen/doxygen-style.css
# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
@@ -800,7 +792,7 @@ HTML_STYLESHEET =
# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
-HTML_DYNAMIC_SECTIONS = NO
+HTML_DYNAMIC_SECTIONS = YES
# If the GENERATE_DOCSET tag is set to YES, additional index files
# will be generated that can be used as input for Apple's Xcode 3
@@ -970,7 +962,7 @@ SEARCHENGINE = YES
# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
# generate Latex output.
-GENERATE_LATEX = YES
+GENERATE_LATEX = NO
# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
@@ -1129,18 +1121,6 @@ GENERATE_XML = NO
XML_OUTPUT = xml
-# The XML_SCHEMA tag can be used to specify an XML schema,
-# which can be used by a validating XML parser to check the
-# syntax of the XML files.
-
-XML_SCHEMA =
-
-# The XML_DTD tag can be used to specify an XML DTD,
-# which can be used by a validating XML parser to check the
-# syntax of the XML files.
-
-XML_DTD =
-
# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
# dump the program listings (including syntax highlighting
# and cross-referencing information) to the XML output. Note that
@@ -1301,11 +1281,6 @@ ALLEXTERNALS = NO
EXTERNAL_GROUPS = YES
-# The PERL_PATH should be the absolute path and name of the perl script
-# interpreter (i.e. the result of `which perl').
-
-PERL_PATH = /usr/bin/perl
-
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
@@ -1319,15 +1294,6 @@ PERL_PATH = /usr/bin/perl
CLASS_DIAGRAMS = YES
-# You can define message sequence charts within doxygen comments using the \msc
-# command. Doxygen will then run the mscgen tool (see
-# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
-# documentation. The MSCGEN_PATH tag allows you to specify the directory where
-# the mscgen tool resides. If left empty the tool is assumed to be found in the
-# default search path.
-
-MSCGEN_PATH =
-
# If set to YES, the inheritance and collaboration graphs will hide
# inheritance and usage relations if the target is undocumented
# or is not a class.
@@ -1350,7 +1316,7 @@ HAVE_DOT = YES
# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
# containing the font.
-DOT_FONTNAME = FreeSans
+DOT_FONTNAME =
# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
# The default size is 10pt.
@@ -1392,7 +1358,7 @@ UML_LOOK = NO
# If set to YES, the inheritance and collaboration graphs will show the
# relations between templates and their instances.
-TEMPLATE_RELATIONS = NO
+TEMPLATE_RELATIONS = YES
# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
# tags are set to YES then doxygen will generate a graph for each documented
@@ -1440,7 +1406,18 @@ DIRECTORY_GRAPH = YES
# generated by dot. Possible values are png, jpg, or gif
# If left blank png will be used.
-DOT_IMAGE_FORMAT = png
+DOT_IMAGE_FORMAT = svg
+
+# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES
+# to enable generation of interactive SVG images that allow zooming and panning.
+# Note that this requires a modern browser other than Internet Explorer.
+# Tested and working are Firefox, Chrome, Safari, and Opera.
+# Note: For IE 9+ you need to set HTML_FILE_EXTENSION to xhtml
+# in order to make the SVG files visible.
+# Older versions of IE do not have SVG support.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+INTERACTIVE_SVG = YES
# The tag DOT_PATH can be used to specify the path where the dot tool can be
# found. If left blank, it is assumed the dot tool can be found in the path.
@@ -1486,7 +1463,7 @@ DOT_TRANSPARENT = NO
# makes dot run faster, but since only newer versions of dot (>1.8.10)
# support this, this feature is disabled by default.
-DOT_MULTI_TARGETS = NO
+DOT_MULTI_TARGETS = YES
# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
# generate a legend page explaining the meaning of the various boxes and
diff --git a/doxygen/doxygen-style.css b/doxygen/doxygen-style.css
new file mode 100644
index 000000000..94825f8c3
--- /dev/null
+++ b/doxygen/doxygen-style.css
@@ -0,0 +1,791 @@
+/* This doxygen theme is free to use. If you like this, please Star https://github.com/kcwongjoe/doxygen_theme_flat_design */
+
+/* Color Pattern. You can change this pattern to design your theme. */
+
+:root {
+ /* Content */
+ --bgcolor: #ffffff;
+ --bgfont: #303030;
+ --bgfont2: #3771c8;
+ --bgfont-hover: #3771c8;
+ --bgfont-hover-text-decoration: underline solid #3771c8;
+ --bgborder: #7d7d7d;
+ --bgborder2: #f6f6f6;
+ --bgfont-link:#1751a8;
+ /* Main Header */
+ --bg1color: #303030;
+ --bg1font: #ffffff;
+ --bg1font2: #3771c8;
+ /* Second header */
+ --bg2color: #E2E2E2;
+ --bg2font: #7D7D7D;
+ --bg2-hover-bg: #ffffff;
+ --bg2-hover-font: #303030;
+ --bg2-hover-topborder: #3771c8;
+ /* Third header */
+ --bg3color: #f6f6f6;
+ --bg3font: #303030;
+ --bg3font2: #7D7D7D;
+ /* Code */
+ --code-bg: #232323;
+ --code-comment: #a5c261;
+ --code-keyword: #db4939;
+ --code-preprocessor: #efcd45;
+ --code-keywordtype: #87bbff;
+ --code-text: #b1cfb1;
+ --code-code: #d3d0cc;
+ --code-line: #73707c;
+ --code-line-bg: #232323;
+ --code-link: #b7dbff;
+ /* Namespace List, Class List icon */
+ --icon-bg: #303030
+ --icon-font: #3771c8;
+ /* Class Index */
+ --qindex-menu-bg: #303030;
+ --qindex-menu-font: #ffffff;
+ --qindex-menu-font-hover: #3771c8;
+ --qindex-icon-bg: #3771c8;
+ --qindex-icon-font: #303030;
+ /* Member table */
+ --mem-title-bg: #3771c8;
+ --mem-title-font: #ffffff;
+ --mem-subtitle-bg: #77b1f8;
+ --mem-subtitle-font: #303030;
+ --mem-subtitle-font-hover: #303030;
+ --mem-content-bg: #ffffff;
+ --mem-content-font: #303030;
+ --mem-content-border: grey;
+ --mem-content-highlighted:#3771c8;
+ /* Nav Tree */
+ --nav-tree-bg: #E2E2E2;
+ --nav-tree-bg-hover: #ffffff;
+ --nav-tree-font: #7D7D7D;
+ --nav-tree-font-hover: #303030;
+ --nav-tree-bg-selected: #3771c8;
+ --nav-tree-font-selected: white;
+}
+
+body, table, div, p, dl {
+ color: var(--bgfont);
+ background-color: var(--bgcolor);
+ line-height: 150%;
+ font: 14px/22px, Roboto, Arial;
+}
+
+div.contents {
+ margin: 20px 40px;
+}
+
+div.contents ul {
+ line-height: 200%;
+}
+
+/***********************************/
+
+/********** Project header *********/
+
+/***********************************/
+
+#titlearea {
+ border-bottom: none;
+ padding-bottom: 20px;
+ padding-top: 20px;
+}
+
+#titlearea, #titlearea * {
+ color: var(--bg1font);
+ background-color: var(--bg1color);
+}
+
+#projectname {
+ padding: 0px 40px !important;
+}
+
+#projectbrief {
+ padding: 0px 40px !important;
+}
+
+#projectalign {
+ padding: 0px !important;
+ vertical-align: bottom;
+}
+
+/***********************************/
+
+/************ Main Menu ************/
+
+/***********************************/
+
+/* Margin */
+
+#main-menu {
+ padding: 0px 30px;
+}
+
+#main-menu a, #main-menu a:hover {
+ padding-top: 10px;
+ padding-bottom: 10px;
+}
+
+/* Menu button */
+
+#main-menu li a {
+ background-image: none;
+ font-family: Arial;
+ text-shadow: none;
+ font-size: 14px;
+ font-weight: 700;
+}
+
+#main-menu, #main-menu>li>a {
+ background-image: none;
+ background-color: var(--bg2color);
+ color: var(--bg2font);
+ transition: 0.2s;
+}
+
+/* hover Effect */
+
+#main-menu>li {
+ border-top: 5px solid var(--bg2color);
+}
+
+#main-menu>li:hover {
+ color: var(--bg2-hover-font);
+ background-color: var(--bg2-hover-bg);
+ border-top: 5px solid var(--bg2-hover-topborder);
+ font-width: bold;
+}
+
+#main-menu>li:hover, #main-menu>li>a:hover, #main-menu>li>a.highlighted {
+ color: var(--bg2-hover-font);
+ background-color: var(--bg2-hover-bg);
+ font-width: bold;
+}
+
+/* Search Bar */
+
+#MSearchBox {
+ border-radius: 0;
+ box-shadow: none;
+}
+
+#MSearchBox>span {
+ margin: 10px;
+}
+
+#main-menu>li:last-child {
+ padding: 25px 0px;
+}
+
+/* Reset search hover color*/
+
+#main-menu>li:last-child:hover {
+ color: var(--bg2font);
+ background-color: var(--bg2color);
+ border-top: 5px solid var(--bg2color);
+}
+
+#MSearchResultsWindow {
+ border: 1px solid var(--bg3font2);
+ background-color: var(--bg3color);
+ padding: 10px;
+}
+
+body.SRPage, body.SRPage * {
+ font-family: Arial;
+}
+
+/* Sub Menu */
+
+#main-menu>li ul {
+ transition: max-height 0.2s ease-in-out;
+ padding: 0px;
+ border-radius: 0px !important;
+}
+
+#main-menu>li ul:before, #main-menu>li ul:after {
+ border-width: 0px;
+}
+
+#main-menu>li>ul li a, #main-menu>li>ul li {
+ background-color: var(--bgcolor);
+ color: var(--bgfont);
+ background-image: none;
+}
+
+#main-menu>li>ul li a:hover, #main-menu>li>ul li:hover {
+ background-color: var(--bgfont2);
+ /*color: var(--bgfont);*/
+ color: white;
+ font-width: bold;
+}
+
+/***********************************/
+
+/************** Header *************/
+
+/***********************************/
+
+div.headertitle {
+ padding: 5px 40px;
+}
+
+div.header, div.header * {
+ color: var(--bg3font);
+ background-color: var(--bg3color);
+ border-bottom: none;
+}
+
+div.summary {
+ padding-right: 40px;
+}
+
+/***********************************/
+
+/************** Link *************/
+
+/***********************************/
+
+a, a:visited, a:active, .contents a:visited, body.SRPage a, body.SRPage a:visited, body.SRPage a:active {
+ color: var(--bgfont-link);
+ text-decoration: none;
+}
+
+a:hover, .contents a:hover, body.SRPage a:hover {
+ color: var(--bgfont-hover);
+ text-decoration: var(--bgfont-hover-text-decoration);
+
+}
+
+.dynheader {
+ color: var(--bgfont-link);
+ text-decoration: none;
+}
+
+.dynheader:hover {
+ color: var(--bgfont-hover);
+ text-decoration: var(--bgfont-hover-text-decoration);
+}
+
+/***********************************/
+
+/************ Nav-path ************/
+
+/***********************************/
+
+#nav-path, #nav-path ul {
+ background-image: none;
+}
+
+#nav-path ul {
+ padding: 5px 30px;
+}
+
+#nav-path, #nav-path * {
+ color: var(--bg3font2);
+ background-color: var(--bg3color);
+ border: none;
+ font-family: Arial;
+}
+
+li.navelem {
+ background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHhtbG5zOnN2Z2pzPSJodHRwOi8vc3ZnanMuY29tL3N2Z2pzIiB3aWR0aD0iNTEyIiBoZWlnaHQ9IjUxMiIgeD0iMCIgeT0iMCIgdmlld0JveD0iMCAwIDI5Mi4zNTkgMjkyLjM1OSIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgNTEyIDUxMiIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSIgY2xhc3M9IiI+PGc+CjxnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+Cgk8cGF0aCBkPSJNMjIyLjk3OSwxMzMuMzMxTDk1LjA3Myw1LjQyNEM5MS40NTYsMS44MDcsODcuMTc4LDAsODIuMjI2LDBjLTQuOTUyLDAtOS4yMzMsMS44MDctMTIuODUsNS40MjQgICBjLTMuNjE3LDMuNjE3LTUuNDI0LDcuODk4LTUuNDI0LDEyLjg0N3YyNTUuODEzYzAsNC45NDgsMS44MDcsOS4yMzIsNS40MjQsMTIuODQ3YzMuNjIxLDMuNjE3LDcuOTAyLDUuNDI4LDEyLjg1LDUuNDI4ICAgYzQuOTQ5LDAsOS4yMy0xLjgxMSwxMi44NDctNS40MjhsMTI3LjkwNi0xMjcuOTA3YzMuNjE0LTMuNjEzLDUuNDI4LTcuODk3LDUuNDI4LTEyLjg0NyAgIEMyMjguNDA3LDE0MS4yMjksMjI2LjU5NCwxMzYuOTQ4LDIyMi45NzksMTMzLjMzMXoiIGZpbGw9IiM3ZDdkN2QiIGRhdGEtb3JpZ2luYWw9IiMwMDAwMDAiIHN0eWxlPSIiIGNsYXNzPSIiPjwvcGF0aD4KPC9nPgo8ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8L2c+CjxnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjwvZz4KPGcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPC9nPgo8ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8L2c+CjxnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjwvZz4KPGcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPC9nPgo8ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8L2c+CjxnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjwvZz4KPGcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPC9nPgo8ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8L2c+CjxnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjwvZz4KPGcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPC9nPgo8ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8L2c+CjxnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjwvZz4KPGcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPC9nPgo8L2c+PC9zdmc+);
+ background-size: 9px;
+}
+
+li.navelem a {
+ margin-right: 20px;
+}
+
+/***********************************/
+
+/*************** mem ***************/
+
+/***********************************/
+
+.memtitle {
+ padding: 15px;
+ margin-top: 30px;
+ border-top-left-radius: 0px;
+ border-top-right-radius: 0px;
+}
+
+.memtitle, .memtitle *, .memtitle a:visited {
+ border: none;
+ background-image: none;
+ color: var(--mem-title-font);
+ background-color: var(--mem-title-bg);
+}
+
+.memproto {
+ padding: 2em;
+ text-shadow: none;
+ border-top-right-radius: 0px;
+ -moz-border-radius-topright: 0px;
+ -webkit-border-top-right-radius: 0px;
+}
+
+.memproto, .memproto *, .memproto a:visited {
+ border: none;
+ background-image: none;
+ background-color: var(--mem-subtitle-bg);
+ color: var(--mem-subtitle-font);
+ font-size: inherit;
+ line-height: 100%
+}
+
+.memproto a:hover {
+ color: var(--mem-subtitle-font-hover);
+}
+
+.memdoc {
+ border-bottom: 1px solid var(--mem-content-border);
+ border-left: 1px solid var(--mem-content-border);
+ border-right: 1px solid var(--mem-content-border);
+ background-color: var(--mem-content-bg);
+ color: var(--mem-content-font);
+ border-bottom-left-radius: 0px;
+ border-bottom-right-radius: 0px;
+ -moz-border-radius-bottomleft: 0px;
+ -moz-border-radius-bottomright: 0px;
+ -webkit-border-bottom-left-radius: 0px;
+ -webkit-border-bottom-right-radius: 0px;
+ padding:1em;
+}
+
+.memdoc p, .memdoc dt {
+ /*padding: 0px 20px;*/
+}
+
+.memdoc > p {
+ font-size:1em;
+}
+
+.paramname {
+ color:black;
+}
+
+td.memItemRight > a:first-of-type {
+ font-size:1.3em;
+}
+
+/***********************************/
+
+/************* Contents ************/
+
+/***********************************/
+
+a.anchor {
+ padding-top: 20px;
+}
+
+dl {
+ border-left: 5px solid;
+ padding:1em;
+}
+
+dt {
+ font-variant-caps: small-caps;
+}
+
+dl.warning {
+ border-top: thin solid red;
+ border-right: thin solid red;
+ border-bottom: thin solid red;
+ border-left-color: red;
+ background-color: #fee;
+}
+
+dl.warning > dt {
+ color: #500;
+}
+
+dl.note {
+ border-top:thin solid green;
+ border-right:thin solid green;
+ border-bottom:thin solid green;
+ border-left-color:green;
+ background-color: #efe;
+}
+
+dl.note > dt {
+ color: #050;
+}
+
+div.textblock {
+ padding:2em;
+ border: 2px solid var(--bgfont2);
+ box-shadow:0.5em 0.5em 0.5em var(--bgfont);
+ background-color: #fafaff;
+}
+
+div.textblock > p {
+ font-size:1.2em;
+}
+
+div.textblock > p.definition {
+ font-size:0.8em;
+}
+
+p.definition {
+ font-size: 0.8em;
+}
+
+p.reference {
+ font-size: 0.8em;
+}
+
+p {
+ background-color: transparent;
+}
+
+table {
+ margin-top:4em;
+}
+
+table.memname {
+ margin-top:0.1em;
+}
+
+table.mlabels {
+ margin-top:0.1em;
+}
+
+/***********************************/
+
+/************* fragment ************/
+
+/***********************************/
+
+h2.groupheader {
+ color: #303030;
+ font-size: 200%;
+ font-weight: bold;
+ border-bottom: thin solid var(--bgfont2);
+ padding-bottom:1px;
+ margin-top:3em;
+}
+
+h3 {
+ background-color:var(--bgfont2);
+ color: var(--bgcolor);
+ font-size: 1.5em;
+ margin:0px;
+ padding:1em;
+ margin-bottom:2em;
+ border: 2px solid var(--bgfont2);
+ box-shadow:0.5em 0.5em 0.5em var(--bgfont);
+ font-family:monospace;
+}
+
+div.fragment, pre.fragment {
+ border: none;
+ padding: 1em;
+ margin-left: 1em;
+ margin-right: 1em;
+ background-color: var(--code-bg);
+ border-left: 2px solid black;
+ border-top: 2px solid black;
+ border-right: 2px solid grey;
+ border-bottom: 2px solid grey;
+}
+
+div.fragment > div.line {
+ font-size:1em;
+ line-height:150%;
+ color: var(--code-code);
+}
+
+.textblock > div.fragment {
+ font-size: 1em;
+}
+
+.textblock > dl.section {
+ font-size: 1.2em;
+}
+
+div.line {
+ background-color: var(--code-bg);
+}
+
+span.comment {
+ color: var(--code-comment);
+}
+
+span.keyword {
+ color: var(--code-keyword);
+}
+
+span.preprocessor {
+ color: var(--code-preprocessor);
+}
+
+span.keywordtype {
+ color: var(--code-keywordtype);
+}
+
+span.stringliteral {
+ color: var(--code-text);
+}
+
+span.mlabel {
+ background-color: var(--code-text);
+ color: var(--code-bg);
+ border-top: none;
+ border-left: none;
+ border-right: none;
+ border-bottom: none;
+ padding: 10px;
+ border-radius: 0px;
+}
+
+div.fragment > div.line > a.code {
+ color: var(--code-link);
+}
+
+span.lineno, span.lineno>* {
+ color: var(--code-line);
+ border-right: none;
+ background-color: var(--code-bg);
+}
+
+span.lineno a {
+ background-color: var(--code-line-bg);
+}
+
+span.lineno a:hover {
+ color: var(--bg3font);
+ background-color: var(--code-line-bg);
+}
+
+code {
+ color:black;
+}
+
+/***********************************/
+
+/************* directory ***********/
+
+/***********************************/
+
+.directory tr.even {
+ background-color: inherit;
+}
+
+.iconfclosed {
+ background-image: url(closed-folder.png);
+ margin-right: 10px;
+}
+
+.iconfopen {
+ background-image: url(opened-folder.png);
+ margin-right: 10px;
+}
+
+.icondoc {
+ background-image: url(document.png);
+ margin-right: 10px;
+}
+
+.arrow {
+ color: #7d7d7d;
+}
+
+.icona {
+ vertical-align: middle;
+ margin-right: 5px;
+}
+
+.icon {
+ background-color: var(--icon-bg);
+ color: var(--icon-font);
+ display: table-cell;
+ vertical-align: middle;
+ height: 20px;
+ width: 20px;
+}
+
+div.ah {
+ background-color: var(--qindex-icon-bg);
+ color: var(--qindex-icon-font);
+ text-align: center;
+ background-image: none;
+ -webkit-box-shadow: none;
+ box-shadow: none;
+ -webkit-border-radius: 0px;
+ border-radius: 0px;
+ border: none;
+}
+
+div.qindex {
+ background-color: var(--qindex-menu-bg);
+ border: none;
+ padding: 20px;
+}
+
+a.qindex {
+ color: var(--qindex-menu-font);
+ font-weight: normal;
+ font-size: 20px;
+}
+
+a:hover.qindex {
+ color: var(--qindex-menu-font-hover);
+}
+
+a:visited.qindex {
+ color: var(--qindex-menu-font);
+}
+
+table.classindex {
+ margin-top: 30px;
+ margin-bottom: 30px;
+}
+
+table.classindex a.el {
+ font-weight: normal;
+}
+
+table.params {
+ margin-top:1em;
+}
+
+#titlearea > table {
+ margin-top:0px;
+}
+
+table.directory > tbody > tr {
+ border-top: thin solid var(--nav-tree-bg);
+ border-bottom: thin solid var(--nav-tree-bg);
+}
+
+/***********************************/
+
+/************** footer *************/
+
+/***********************************/
+
+div.directory {
+ border-top: 1px solid var(--bgborder);
+ border-bottom: none;
+ margin: 20px 0px;
+}
+
+div.directory a.el {
+ font-weight: normal;
+}
+
+div.directory>table {
+ margin: 20px 0px;
+}
+
+hr.footer {
+ border: none;
+}
+
+.contents>hr {
+ border-top: 0px;
+}
+
+/***********************************/
+
+/*********** memberdecls ***********/
+
+/***********************************/
+
+.memItemLeft, .memItemRight {
+ padding: 15px 30px;
+ background-color: inherit;
+}
+
+.mdescRight {
+ padding: 0px 30px 10px 30px;
+}
+
+.memberdecls * {
+ background-color: inherit;
+}
+
+.memSeparator {
+ border-bottom: 1px solid var(--bgborder2);
+}
+
+.memTemplParams {
+ color: var(--bgfont);
+}
+
+/***********************************/
+
+/*********** nav-tree ***********/
+
+/***********************************/
+
+#nav-tree-contents {
+ background-color: var(--nav-tree-bg);
+ margin: 0px;
+}
+
+#side-nav, #nav-tree {
+ background-image: none;
+ background-color: var(--nav-tree-bg);
+}
+
+#nav-tree .item {
+ background-color: var(--nav-tree-bg);
+ font-family: Arial;
+ text-shadow: none;
+ font-size: 14px;
+ font-weight: 700;
+ padding: 10px;
+ color: var(--nav-tree-font);
+}
+
+#nav-tree .arrow {
+ color: var(--nav-tree-font);
+}
+
+#nav-tree .selected {
+ background-image: none;
+ background-color: var(--nav-tree-bg-selected);
+}
+
+#nav-tree .selected a {
+ color: var(--nav-tree-font-selected);
+}
+
+#nav-tree .item:hover {
+ background-color: var(--nav-tree-bg-hover);
+ color: var(--nav-tree-font-hover);
+}
+
+#nav-tree .item a:hover {
+ color: var(--nav-tree-font-hover);
+}
+
+#side-nav .ui-resizable-e {
+ background-image: none;
+ background-color: var(--nav-tree-bg);
+}
+
+#nav-sync {
+ background-color: transparent;
+}
+
+#nav-sync>img {
+ content: url(off_sync.png);
+}
+
+#nav-sync.sync>img {
+ content: url(on_sync.png);
+}
+
+/***********************************/
+
+/*********** Plant UML ***********/
+
+/***********************************/
+
+.plantumlgraph > img {
+ width: 80%;
+}
diff --git a/edo/LICENSE b/edo/LICENSE
new file mode 100644
index 000000000..b8df7fd44
--- /dev/null
+++ b/edo/LICENSE
@@ -0,0 +1,502 @@
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL. It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+ This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it. You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+ When we speak of free software, we are referring to freedom of use,
+not price. Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+ To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights. These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+ For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you. You must make sure that they, too, receive or can get the source
+code. If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it. And you must show them these terms so they know their rights.
+
+ We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+ To protect each distributor, we want to make it very clear that
+there is no warranty for the free library. Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+ Finally, software patents pose a constant threat to the existence of
+any free program. We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder. Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+ Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License. This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License. We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+ When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library. The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom. The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+ We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License. It also provides other free software developers Less
+of an advantage over competing non-free programs. These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries. However, the Lesser license provides advantages in certain
+special circumstances.
+
+ For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard. To achieve this, non-free programs must be
+allowed to use the library. A more frequent case is that a free
+library does the same job as widely used non-free libraries. In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+ In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software. For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+ Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+ The precise terms and conditions for copying, distribution and
+modification follow. Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library". The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+ GNU LESSER GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+ A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+ The "Library", below, refers to any such software library or work
+which has been distributed under these terms. A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language. (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+ "Source code" for a work means the preferred form of the work for
+making modifications to it. For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+ Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it). Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+ 1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+ You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+ 2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) The modified work must itself be a software library.
+
+ b) You must cause the files modified to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ c) You must cause the whole of the work to be licensed at no
+ charge to all third parties under the terms of this License.
+
+ d) If a facility in the modified Library refers to a function or a
+ table of data to be supplied by an application program that uses
+ the facility, other than as an argument passed when the facility
+ is invoked, then you must make a good faith effort to ensure that,
+ in the event an application does not supply such function or
+ table, the facility still operates, and performs whatever part of
+ its purpose remains meaningful.
+
+ (For example, a function in a library to compute square roots has
+ a purpose that is entirely well-defined independent of the
+ application. Therefore, Subsection 2d requires that any
+ application-supplied function or table used by this function must
+ be optional: if the application does not supply it, the square
+ root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library. To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License. (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.) Do not make any other change in
+these notices.
+
+ Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+ This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+ 4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+ If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library". Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+ However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library". The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+ When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library. The
+threshold for this to be true is not precisely defined by law.
+
+ If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work. (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+ Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+ 6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+ You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License. You must supply a copy of this License. If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License. Also, you must do one
+of these things:
+
+ a) Accompany the work with the complete corresponding
+ machine-readable source code for the Library including whatever
+ changes were used in the work (which must be distributed under
+ Sections 1 and 2 above); and, if the work is an executable linked
+ with the Library, with the complete machine-readable "work that
+ uses the Library", as object code and/or source code, so that the
+ user can modify the Library and then relink to produce a modified
+ executable containing the modified Library. (It is understood
+ that the user who changes the contents of definitions files in the
+ Library will not necessarily be able to recompile the application
+ to use the modified definitions.)
+
+ b) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (1) uses at run time a
+ copy of the library already present on the user's computer system,
+ rather than copying library functions into the executable, and (2)
+ will operate properly with a modified version of the library, if
+ the user installs one, as long as the modified version is
+ interface-compatible with the version that the work was made with.
+
+ c) Accompany the work with a written offer, valid for at
+ least three years, to give the same user the materials
+ specified in Subsection 6a, above, for a charge no more
+ than the cost of performing this distribution.
+
+ d) If distribution of the work is made by offering access to copy
+ from a designated place, offer equivalent access to copy the above
+ specified materials from the same place.
+
+ e) Verify that the user has already received a copy of these
+ materials or that you have already sent this user a copy.
+
+ For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it. However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+ It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system. Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+ 7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+ a) Accompany the combined library with a copy of the same work
+ based on the Library, uncombined with any other library
+ facilities. This must be distributed under the terms of the
+ Sections above.
+
+ b) Give prominent notice with the combined library of the fact
+ that part of it is a work based on the Library, and explaining
+ where to find the accompanying uncombined form of the same work.
+
+ 8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License. Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License. However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+ 9. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Library or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+ 10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+ 11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all. For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded. In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+ 13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation. If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+ 14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission. For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this. Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+ NO WARRANTY
+
+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Libraries
+
+ If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change. You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+ To apply these terms, attach the following notices to the library. It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+
+ Copyright (C)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the
+ library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+ , 1 April 1990
+ Ty Coon, President of Vice
+
+That's all there is to it!
diff --git a/edo/doc/CMakeLists.txt b/edo/doc/CMakeLists.txt
index 435b71f75..e2aed7810 100644
--- a/edo/doc/CMakeLists.txt
+++ b/edo/doc/CMakeLists.txt
@@ -22,7 +22,8 @@ if(DOXYGEN_FOUND)
)
endif(UNIX AND NOT ${CMAKE_VERBOSE_MAKEFILE})
endif(DOXYGEN_EXECUTABLE)
- configure_file("${CMAKE_CURRENT_SOURCE_DIR}/${EDO_DOC_CONFIG_FILE}.cmake"
+ # configure_file("${CMAKE_CURRENT_SOURCE_DIR}/${EDO_DOC_CONFIG_FILE}.cmake"
+ configure_file("${DOXYGEN_CONFIG_DIR}/doxyfile.cmake"
"${EDO_DOC_DIR}/${EDO_DOC_CONFIG_FILE}")
install(
DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
diff --git a/edo/doc/edo.doxyfile.cmake b/edo/doc/edo.doxyfile.cmake
index e3eef6602..252be5232 100644
--- a/edo/doc/edo.doxyfile.cmake
+++ b/edo/doc/edo.doxyfile.cmake
@@ -25,13 +25,13 @@ DOXYFILE_ENCODING = UTF-8
# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
# by quotes) that should identify the project.
-PROJECT_NAME = @PACKAGE_NAME@
+PROJECT_NAME = @EDO_MODULE_NAME@
# The PROJECT_NUMBER tag can be used to enter a project or revision number.
# This could be handy for archiving the generated documentation or
# if some version control system is used.
-PROJECT_NUMBER = @PACKAGE_VERSION@
+PROJECT_NUMBER = @PROJECT_VERSION@
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
# base path where the generated documentation will be put.
@@ -1030,7 +1030,7 @@ SERVER_BASED_SEARCH = NO
# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
# generate Latex output.
-GENERATE_LATEX = YES
+GENERATE_LATEX = NO
# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
diff --git a/edo/src/edoEstimatorAdaptive.h b/edo/src/edoEstimatorAdaptive.h
index dfd9eb53a..01bb9c83c 100644
--- a/edo/src/edoEstimatorAdaptive.h
+++ b/edo/src/edoEstimatorAdaptive.h
@@ -45,7 +45,7 @@ class edoEstimatorAdaptive : public edoEstimator
public:
typedef typename D::EOType EOType;
- edoEstimatorAdaptive( D& distrib ) : _distrib(distrib) {}
+ edoEstimatorAdaptive( D& distrib ) : _distrib(distrib) {}
// virtual D operator() ( eoPop< EOT >& )=0 (provided by eoUF< A1, R >)
diff --git a/edo/src/edoEstimatorAdaptiveReset.h b/edo/src/edoEstimatorAdaptiveReset.h
index c7dfd4939..b3d518dca 100644
--- a/edo/src/edoEstimatorAdaptiveReset.h
+++ b/edo/src/edoEstimatorAdaptiveReset.h
@@ -41,12 +41,12 @@ class edoEstimatorAdaptiveReset : public edoEstimatorAdaptive
public:
typedef typename D::EOType EOType;
- edoEstimatorAdaptiveReset( D& distrib ) :
+ edoEstimatorAdaptiveReset( D& distrib ) :
edoEstimatorAdaptive(distrib),
_dim(0)
{ }
- edoEstimatorAdaptiveReset( D& distrib, size_t dim ) :
+ edoEstimatorAdaptiveReset( D& distrib, size_t dim ) :
edoEstimatorAdaptive(distrib),
_dim(dim)
{ }
diff --git a/edo/src/edoEstimatorCombined.h b/edo/src/edoEstimatorCombined.h
index f884f38f1..3c546bd6a 100644
--- a/edo/src/edoEstimatorCombined.h
+++ b/edo/src/edoEstimatorCombined.h
@@ -43,12 +43,12 @@ class edoEstimatorCombinedAdaptive : public edoEstimatorAdaptive, public std:
public:
typedef typename D::EOType EOType;
- edoEstimatorCombinedAdaptive( D& distrib, edoEstimator& estim) :
+ edoEstimatorCombinedAdaptive( D& distrib, edoEstimator& estim) :
edoEstimatorAdaptive(distrib),
std::vector*>(1,&estim)
{}
- edoEstimatorCombinedAdaptive( D& distrib, std::vector*> estims) :
+ edoEstimatorCombinedAdaptive( D& distrib, std::vector*> estims) :
edoEstimatorAdaptive(distrib),
std::vector*>(estims)
{}
@@ -78,11 +78,11 @@ class edoEstimatorCombinedStateless : public edoEstimatorCombinedAdaptive
public:
typedef typename D::EOType EOType;
- edoEstimatorCombinedStateless( edoEstimator& estim ) :
+ edoEstimatorCombinedStateless( edoEstimator& estim ) :
edoEstimatorCombinedAdaptive(*(new D), estim)
{}
- edoEstimatorCombinedStateless( std::vector*> estims) :
+ edoEstimatorCombinedStateless( std::vector*> estims) :
edoEstimatorCombinedAdaptive(*(new D), estims)
{}
diff --git a/edo/src/edoEstimatorNormalAdaptive.h b/edo/src/edoEstimatorNormalAdaptive.h
index 8dd03af1f..a19e14b91 100644
--- a/edo/src/edoEstimatorNormalAdaptive.h
+++ b/edo/src/edoEstimatorNormalAdaptive.h
@@ -233,7 +233,7 @@ public:
Matrix mD = eigensolver.eigenvalues().asDiagonal();
// from variance to standard deviations
- mD.cwiseSqrt();
+ mD=mD.cwiseSqrt();
d.scaling( mD.diagonal() );
d.coord_sys( eigensolver.eigenvectors() );
diff --git a/edo/src/edoRepairerModulo.h b/edo/src/edoRepairerModulo.h
index 1bc7e7682..54b823de7 100644
--- a/edo/src/edoRepairerModulo.h
+++ b/edo/src/edoRepairerModulo.h
@@ -39,7 +39,7 @@ template < typename EOT >
class edoRepairerModulo: public edoRepairerApplyBinary
{
public:
- edoRepairerModulo( double denominator ) : edoRepairerApplyBinary( std::fmod, denominator ) {}
+ edoRepairerModulo( double denominator ) : edoRepairerApplyBinary( std::fmod, denominator ) {}
};
diff --git a/edo/src/utils/edoFileSnapshot.cpp b/edo/src/utils/edoFileSnapshot.cpp
index 32107b409..7628f934c 100644
--- a/edo/src/utils/edoFileSnapshot.cpp
+++ b/edo/src/utils/edoFileSnapshot.cpp
@@ -76,8 +76,7 @@ edoFileSnapshot::edoFileSnapshot(std::string dirname,
s = " ";
}
- int dummy;
- dummy = system(s.c_str());
+ (void)/*ignore returned*/ system(s.c_str());
// all done
_descOfFiles = new std::ofstream( std::string(dirname + "/list_of_files.txt").c_str() );
diff --git a/eo/contrib/MGE/eoVirus.h b/eo/contrib/MGE/eoVirus.h
index a7c6aaeea..37b1daf4d 100644
--- a/eo/contrib/MGE/eoVirus.h
+++ b/eo/contrib/MGE/eoVirus.h
@@ -108,7 +108,12 @@ public:
if (is) {
virus.resize(bits.size());
std::transform(bits.begin(), bits.end(), virus.begin(),
+#if __cplusplus >= 201103L
+ std::bind(std::equal_to(), std::placeholders::_1, '1'));
+#else
+ // Deprecated since C++11.
std::bind2nd(std::equal_to(), '1'));
+#endif
}
}
diff --git a/eo/contrib/irace/CMakeLists.txt b/eo/contrib/irace/CMakeLists.txt
index 37c82187e..bee473be7 100644
--- a/eo/contrib/irace/CMakeLists.txt
+++ b/eo/contrib/irace/CMakeLists.txt
@@ -45,46 +45,23 @@ set(PARADISEO_LIBRARIES ga eoutils eo)
# IOH
set(IOH_ROOT "~/code/IOHexperimenter/" CACHE PATH "Where to find IOHexperimenter")
-find_path(IOH_PROBLEM_H "IOHprofiler_problem.h" PATHS ${IOH_ROOT}/src/Template/)
-find_library(IOH_LIBRARY "IOH" PATHS ${IOH_ROOT} PATH_SUFFIXES release Release debug Debug build Build)
+find_path(IOH_HPP "ioh.hpp" PATHS ${IOH_ROOT}/include/)
+# find_library(IOH_LIBRARY "IOH" PATHS ${IOH_ROOT} PATH_SUFFIXES release Release debug Debug build Build)
-if(EXISTS ${IOH_PROBLEM_H} AND EXISTS ${IOH_LIBRARY})
+if(EXISTS ${IOH_HPP}) # AND EXISTS ${IOH_LIBRARY})
message(STATUS "Found IOH in ${IOH_ROOT}")
- include_directories(${IOH_ROOT}/build/Cpp/src/)
- link_directories(${IOH_ROOT}/build/Cpp/bin/)
-
- # Workaround IOH's poorly designed headers inclusion scheme.
- SET(PROBLEMS_BBOB_DIR "src/Problems/BBOB")
- SET(PROBLEMS_BBOB_COMMON_DIR "src/Problems/BBOB/bbob_common_used_functions")
- SET(PROBLEMS_COMMON_DIR "src/Problems/common_used_functions")
- SET(PROBLEMS_PBO_DIR "src/Problems/PBO")
- SET(PROBLEMS_WMODEL_DIR "src/Problems/WModel")
- SET(PROBLEMS_PYTHON_DIR "src/Problems/Python")
- SET(SUITES_DIR "src/Suites")
- SET(TEMPLATE_DIR "src/Template")
- SET(TEMPLATE_EXPERIMENTS_DIR "src/Template/Experiments")
- SET(TEMPLATE_LOGGERS_DIR "src/Template/Loggers")
- SET(IOHEXPERIMENTER_DIR
- "${IOH_ROOT}/${PROBLEMS_COMMON_DIR}"
- "${IOH_ROOT}/${PROBLEMS_BBOB_DIR}"
- "${IOH_ROOT}/${PROBLEMS_BBOB_COMMON_DIR}"
- "${IOH_ROOT}/${PROBLEMS_PBO_DIR}"
- "${IOH_ROOT}/${PROBLEMS_WMODEL_DIR}"
- "${IOH_ROOT}/${PROBLEMS_PYTHON_DIR}"
- "${IOH_ROOT}/${SUITES_DIR}"
- "${IOH_ROOT}/${TEMPLATE_DIR}"
- "${IOH_ROOT}/${TEMPLATE_EXPERIMENTS_DIR}"
- "${IOH_ROOT}/${TEMPLATE_LOGGERS_DIR}"
- )
- include_directories(${IOHEXPERIMENTER_DIR})
+ include_directories(${IOH_ROOT}/include/)
+ include_directories(${IOH_ROOT}/external/fmt/include/)
+ include_directories(${IOH_ROOT}/external/clutchlog/)
+ link_directories(${IOH_ROOT}/release/external/fmt/)
else()
- if(NOT EXISTS ${IOH_PROBLEM_H})
- message(FATAL_ERROR "Could not find `IOHprofiler_problem.h` in: ${IOH_ROOT}/src/Template/ (did you forget to compile it?)")
- endif()
- if(NOT EXISTS ${IOH_LIBRARIES})
- message(FATAL_ERROR "Could not find `libIOH` in: ${IOH_ROOT}/[release|debug|build] (did you forget to compile it?)")
+ if(NOT EXISTS ${IOH_HPP})
+ message(FATAL_ERROR "Could not find `ioh.hpp` in: ${IOH_ROOT}/include/")
endif()
+ # if(NOT EXISTS ${IOH_LIBRARIES})
+ # message(FATAL_ERROR "Could not find `libIOH` in: ${IOH_ROOT}/[release|debug|build] (did you forget to compile it?)")
+ # endif()
endif()
@@ -93,5 +70,9 @@ endif()
######################################################################################
add_executable(fastga fastga.cpp)
-target_link_libraries(fastga ${PARADISEO_LIBRARIES} ${IOH_LIBRARY})
+# Link to stdc++fs at the end because of an Ubuntu bug, see: https://stackoverflow.com/a/57760267
+target_link_libraries(fastga ${PARADISEO_LIBRARIES} fmt stdc++fs)
+
+add_executable(onlymutga onlymutga.cpp)
+target_link_libraries(onlymutga ${PARADISEO_LIBRARIES} fmt)
diff --git a/eo/contrib/irace/build_fastga.sh b/eo/contrib/irace/build_fastga.sh
new file mode 100755
index 000000000..abaac4a20
--- /dev/null
+++ b/eo/contrib/irace/build_fastga.sh
@@ -0,0 +1,80 @@
+#!/bin/sh
+
+########################################################################
+# This is an example of how to deal with complex builds,
+# for instance on clusters with compilers provided as side modules.
+########################################################################
+
+# Run this script in a separate dir, e.g.
+# mkdir -p code ; cd code ; ../build_fastga.sh
+
+# exit when any command fails
+set -e
+
+# We need recent clang and cmake
+module load LLVM/clang-llvm-10.0
+module load cmake/3.18
+
+# We are going to use a specific compiler, different from the system's one.
+# Path toward the compiler:
+C="/opt/dev/Compilers/LLVM/10.0.1/bin"
+# Path toward the include for the std lib:
+I="/opt/dev/Compilers/LLVM/10.0.1/include/c++/v1/"
+# Path toward the compiled std lib:
+L="/opt/dev/Compilers/LLVM/10.0.1/lib"
+
+# As we use clang, we use its std lib (instead of gcc's "libstdc++")
+S="libc++"
+
+# Gather all those into a set of flags:
+flags="-I${I} -stdlib=${S} -L${L}"
+
+# Current dir, for further reference.
+here=$(pwd)
+
+# Compiler selection
+export CC=${C}/clang
+export CXX=${C}/clang++
+
+# If the dir already exists
+if cd IOHexperimenter ; then
+ # Just update the code
+ git pull
+else
+ # Clone the repo
+ git clone --branch feat+EAF --single-branch --recurse-submodules https://github.com/jdreo/IOHexperimenter.git
+ cd IOHexperimenter
+fi
+# Clean build from scratch
+rm -rf release
+mkdir -p release
+cd release
+cmake -DCMAKE_CXX_FLAGS="${flags}" -D CMAKE_BUILD_TYPE=Release -D BUILD_TESTS=OFF -D BUILD_EXAMPLE=OFF ..
+make -j
+# Get back to the root dir
+cd ${here}
+
+
+if cd paradiseo ; then
+ git pull
+else
+ git clone --branch feat+num_foundry --single-branch --recurse-submodules https://github.com/jdreo/paradiseo.git
+ cd paradiseo
+ touch LICENSE
+fi
+rm -rf release
+mkdir -p release
+cd release
+cmake -DCMAKE_CXX_FLAGS="${flags}" -D CMAKE_BUILD_TYPE=Release ..
+make -j
+cd ${here}
+
+
+cd paradiseo/eo/contrib/irace
+rm -rf release
+mkdir -p release
+cd release
+cmake -DCMAKE_CXX_FLAGS="${flags}" -D CMAKE_BUILD_TYPE=Release -D IOH_ROOT=${here}/IOHexperimenter/ -D PARADISEO_ROOT=${here}/paradiseo/ -D PARADISEO_BUILD=${here}/paradiseo/release/ ..
+make -j
+cd ${here}
+
diff --git a/eo/contrib/irace/expe/alpha/parse_baseline.py b/eo/contrib/irace/expe/alpha/parse_baseline.py
new file mode 100755
index 000000000..8f0193910
--- /dev/null
+++ b/eo/contrib/irace/expe/alpha/parse_baseline.py
@@ -0,0 +1,28 @@
+#!/usr/bin/env python3
+
+import sys
+
+print("algo,problem,seed,ECDF_AUC")
+
+algos_names = {
+ str({"crossover-rate":0, "cross-selector":0, "crossover":0, "mutation-rate":0, "mut-selector":0, "mutation":1, "replacement":0}) : "EA",
+ str({"crossover-rate":0, "cross-selector":0, "crossover":0, "mutation-rate":0, "mut-selector":0, "mutation":5, "replacement":0}) : "fEA",
+ str({"crossover-rate":2, "cross-selector":2, "crossover":2, "mutation-rate":2, "mut-selector":2, "mutation":1, "replacement":0}) : "xGA",
+ str({"crossover-rate":2, "cross-selector":2, "crossover":5, "mutation-rate":2, "mut-selector":2, "mutation":1, "replacement":0}) : "1ptGA",
+}
+
+for fname in sys.argv[1:]:
+
+ run = {}
+ for f in fname.strip(".dat").split("_"):
+ kv = f.split("=")
+ assert(len(kv)==2),str(kv)+" "+str(len(kv))
+ key,idx = kv[0], int(kv[1])
+ run[key] = idx
+
+ with open(fname) as fd:
+ auc = int(fd.readlines()[0]) * -1
+
+ algo = str({"crossover-rate":run["crossover-rate"], "cross-selector":run["cross-selector"], "crossover":run["crossover"], "mutation-rate":run["mutation-rate"], "mut-selector":run["mut-selector"], "mutation":run["mutation"], "replacement":run["replacement"]})
+
+ print(algos_names[algo], run["pb"], run["seed"], auc, sep=",")
diff --git a/eo/contrib/irace/expe/alpha/parse_baseline_average.py b/eo/contrib/irace/expe/alpha/parse_baseline_average.py
new file mode 100755
index 000000000..2b71f7c4a
--- /dev/null
+++ b/eo/contrib/irace/expe/alpha/parse_baseline_average.py
@@ -0,0 +1,49 @@
+#!/usr/bin/env python3
+
+import sys
+
+print("problem,EA,fEA,xGA,1ptGA")
+
+algos_names = {
+ str({"crossover-rate":0, "cross-selector":0, "crossover":0, "mutation-rate":0, "mut-selector":0, "mutation":1, "replacement":0}) : "EA",
+ str({"crossover-rate":0, "cross-selector":0, "crossover":0, "mutation-rate":0, "mut-selector":0, "mutation":5, "replacement":0}) : "fEA",
+ str({"crossover-rate":2, "cross-selector":2, "crossover":2, "mutation-rate":2, "mut-selector":2, "mutation":1, "replacement":0}) : "xGA",
+ str({"crossover-rate":2, "cross-selector":2, "crossover":5, "mutation-rate":2, "mut-selector":2, "mutation":1, "replacement":0}) : "1ptGA",
+}
+
+data = {}
+
+# Parse
+for fname in sys.argv[1:]:
+
+ run = {}
+ for f in fname.strip(".dat").split("_"):
+ kv = f.split("=")
+ assert(len(kv)==2),str(kv)+" "+str(len(kv))
+ key,idx = kv[0], int(kv[1])
+ run[key] = idx
+
+ with open(fname) as fd:
+ auc = int(fd.readlines()[0]) * -1
+
+ algo = str({"crossover-rate":run["crossover-rate"], "cross-selector":run["cross-selector"], "crossover":run["crossover"], "mutation-rate":run["mutation-rate"], "mut-selector":run["mut-selector"], "mutation":run["mutation"], "replacement":run["replacement"]})
+
+ if run["pb"] in data:
+ data[run["pb"]][algos_names[algo]].append(auc)
+ else:
+ data[run["pb"]] = {
+ "EA" : [],
+ "fEA" : [],
+ "xGA" : [],
+ "1ptGA": [],
+ }
+ data[run["pb"]][algos_names[algo]].append(auc)
+
+
+# Print CSV
+for pb in sorted(data.keys()):
+ print(pb, end="")
+ for algo in ["EA","fEA","xGA","1ptGA"]:
+ res = data[pb][algo]
+ print(",", sum(res)/len(res), end="", sep="")
+ print()
diff --git a/eo/contrib/irace/expe/alpha/parse_elites.py b/eo/contrib/irace/expe/alpha/parse_elites.py
new file mode 100755
index 000000000..518bc7245
--- /dev/null
+++ b/eo/contrib/irace/expe/alpha/parse_elites.py
@@ -0,0 +1,21 @@
+#!/usr/bin/env python3
+
+import sys
+
+print("algo,problem,seed,ECDF_AUC")
+
+for fname in sys.argv[1:]:
+
+ run = {}
+ for f in fname.strip(".dat").split("_"):
+ kv = f.split("=")
+ assert(len(kv)==2),str(kv)+" "+str(len(kv))
+ key,idx = kv[0], int(kv[1])
+ run[key] = idx
+
+ with open(fname) as fd:
+ auc = int(fd.readlines()[0]) * -1
+
+ algo = "pc={}_c={}_C={}_pm={}_m={}_M={}_R={}".format(run["crossover-rate"],run["cross-selector"],run["crossover"],run["mutation-rate"],run["mut-selector"],run["mutation"],run["replacement"])
+
+ print(algo, run["pb"], run["seed"], auc, sep=",")
diff --git a/eo/contrib/irace/expe/alpha/parse_irace_bests.py b/eo/contrib/irace/expe/alpha/parse_irace_bests.py
new file mode 100755
index 000000000..d7bce959d
--- /dev/null
+++ b/eo/contrib/irace/expe/alpha/parse_irace_bests.py
@@ -0,0 +1,30 @@
+#!/usr/bin/env python3
+
+import os
+import re
+import sys
+
+print("pb,ecdf,id,crossover-rate,cross-selector,crossover,mutation-rate,mut-selector,mutation,replacement")
+for datadir in sys.argv[1:]:
+
+ for pb_dir in os.listdir(datadir):
+ if "results_problem" in pb_dir:
+ pb_id=pb_dir.replace("results_problem_","")
+ with open(os.path.join("./",datadir,pb_dir,"irace.log")) as fd:
+ data = fd.readlines()
+
+ # Find the last best configuration
+ bests = [line.strip() for line in data if "Best-so-far" in line]
+ best = bests[-1].split()
+ best_id, best_perf = best[2], best[5]
+ # print(best_id,best_perf)
+
+ # Filter the config detail
+ configs = [line.strip() for line in data if "--crossover-rate=" in line and best_id in line]
+ # print(configs)
+
+ # Format as CSV
+ for config in configs:
+ algo = re.sub("\-\-\S*=", ",", config)
+ csv_line = pb_id + "," + best_perf + "," + algo
+ print(csv_line.replace(" ",""))
diff --git a/eo/contrib/irace/expe/alpha/plot_attain_mat.py b/eo/contrib/irace/expe/alpha/plot_attain_mat.py
new file mode 100755
index 000000000..8a0b45bde
--- /dev/null
+++ b/eo/contrib/irace/expe/alpha/plot_attain_mat.py
@@ -0,0 +1,44 @@
+#!/usr/bin/env python3
+
+import os
+import numpy as np
+import matplotlib.pyplot as plt
+
+for p in range(18):
+
+ print("Pb",p,end=": ")
+ datadir="attain_mat_{pb}".format(pb=p)
+
+ try:
+ os.mkdir(datadir)
+ except FileExistsError:
+ pass
+
+ for i in range(50):
+ cmd="./release/fastga --seed={i} \
+ --crossover-rate=2 --cross-selector=2 --crossover=5 --mutation-rate=2 --mut-selector=2 --mutation=1 --replacement=0 \
+ --problem={pb} --buckets=20 --output-mat 2>/dev/null > {dir}/output_mat_{i}.csv"\
+ .format(dir=datadir, i=i, pb=p)
+ # print(cmd)
+ print(i,end=" ",flush=True)
+ os.system(cmd)
+
+
+ matrices=[]
+ for root, dirs, files in os.walk(datadir):
+ for filename in files:
+ matrices.append( np.genfromtxt(datadir+"/"+filename,delimiter=',') )
+
+ agg = matrices[0]
+ for mat in matrices[1:]:
+ agg += mat
+
+ # print(agg)
+
+ plt.rcParams["figure.figsize"] = (3,3)
+ plt.gca().pcolor(agg, edgecolors='grey', cmap="Blues")
+ plt.gca().set_xlabel("Time budget")
+ plt.gca().set_ylabel("Target")
+ plt.savefig("aittain_map_{pb}.png".format(pb=p), bbox_inches='tight')
+
+ print(".")
diff --git a/eo/contrib/irace/expe/alpha/run_algo.sh b/eo/contrib/irace/expe/alpha/run_algo.sh
new file mode 100755
index 000000000..3dcd0da07
--- /dev/null
+++ b/eo/contrib/irace/expe/alpha/run_algo.sh
@@ -0,0 +1,43 @@
+#!/bin/bash
+
+# Number of runs (=seeds).
+runs=50
+
+# Array of problems.
+# You may set something like: (0 2 5 17)
+problems=($(seq 0 18))
+
+# Capture anything passed to the script
+outdir="$1"
+algo="${@:2}"
+
+# You most probably want to run on release builds.
+exe="./release/fastga"
+
+i=1 # Loop counter.
+for pb in "${problems[@]}" ; do # Iterate over the problems array.
+ for seed in $(seq ${runs}) ; do # Iterates over runs/seeds.
+ # Forge a directory/log file name
+ # (remove double dashs and replace spaces with underscore).
+ name="pb=${pb}_seed=${seed}_$(echo "${algo}" | sed 's/--//g' | sed 's/ /_/g')"
+
+ # This is the command to be ran.
+ cmd="${exe} --problem=${pb} --seed=${seed} ${algo}"
+ echo ${cmd} # Print the command.
+
+ # Progress print.
+ echo -n "problem ${pb}, run ${seed}"
+
+ # Actually start the command.
+ ${cmd} > "${outdir}/${name}.dat" 2> "${outdir}/${name}.log"
+
+ # Check for the most common problem in the log file.
+ cat "${outdir}/${name}.log" | grep "illogical performance"
+
+ perc=$(echo "scale=2;${i}/(${#problems[@]}*${runs})*100" | bc)
+ echo -e " -- ${perc}%"
+ i=$((i+1))
+ done
+done
+
+echo "Done $((${#problems[@]}*${runs})) runs, results in ${outdir}"
diff --git a/eo/contrib/irace/expe/alpha/run_baseline.sh b/eo/contrib/irace/expe/alpha/run_baseline.sh
new file mode 100755
index 000000000..5ff274181
--- /dev/null
+++ b/eo/contrib/irace/expe/alpha/run_baseline.sh
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+outdir="$(date --iso-8601=minutes)_results_baselines"
+mkdir ${outdir}
+
+algos=(
+# (λ+λ)EA
+"--full-log=1 --crossover-rate=0 --cross-selector=0 --crossover=0 --mutation-rate=0 --mut-selector=0 --mutation=1 --replacement=0"
+# (λ+λ)fEA
+"--full-log=1 --crossover-rate=0 --cross-selector=0 --crossover=0 --mutation-rate=0 --mut-selector=0 --mutation=5 --replacement=0"
+# (λ+λ)xGA
+"--full-log=1 --crossover-rate=2 --cross-selector=2 --crossover=2 --mutation-rate=2 --mut-selector=2 --mutation=1 --replacement=0"
+# (λ+λ)1ptGA
+"--full-log=1 --crossover-rate=2 --cross-selector=2 --crossover=5 --mutation-rate=2 --mut-selector=2 --mutation=1 --replacement=0"
+)
+
+
+i=1 # Loop counter.
+for algo in "${algos[@]}" ; do
+ echo "${algo}"
+
+ name="$(echo "${algo}" | sed 's/--//g' | sed 's/ /_/g')"
+ ./run_algo.sh ${outdir} ${algo} &> "expe_${name}.log"
+
+ perc=$(echo "scale=2;${i}/${#algos[@]}*100" | bc)
+ echo -e "${perc}%\n"
+ i=$((i+1))
+done
+
+echo "Done"
diff --git a/eo/contrib/irace/expe/alpha/run_elite.sh b/eo/contrib/irace/expe/alpha/run_elite.sh
new file mode 100755
index 000000000..61a074640
--- /dev/null
+++ b/eo/contrib/irace/expe/alpha/run_elite.sh
@@ -0,0 +1,67 @@
+#!/bin/bash
+
+# Number of runs (=seeds).
+runs=50
+
+# You most probably want to run on release builds.
+exe="./release/fastga"
+
+outdir="$(date --iso-8601=minutes)_results_elites"
+mkdir ${outdir}
+
+# FIXME
+algos=(
+"--crossover-rate=1 --cross-selector=2 --crossover=1 --mutation-rate=2 --mut-selector=2 --mutation=8 --replacement=8"
+"--crossover-rate=4 --cross-selector=5 --crossover=2 --mutation-rate=3 --mut-selector=4 --mutation=9 --replacement=9"
+"--crossover-rate=1 --cross-selector=3 --crossover=8 --mutation-rate=2 --mut-selector=6 --mutation=3 --replacement=2"
+"--crossover-rate=2 --cross-selector=1 --crossover=1 --mutation-rate=2 --mut-selector=6 --mutation=9 --replacement=0"
+"--crossover-rate=4 --cross-selector=2 --crossover=2 --mutation-rate=4 --mut-selector=3 --mutation=7 --replacement=0"
+"--crossover-rate=0 --cross-selector=3 --crossover=2 --mutation-rate=4 --mut-selector=2 --mutation=6 --replacement=0"
+"--crossover-rate=3 --cross-selector=0 --crossover=3 --mutation-rate=4 --mut-selector=3 --mutation=10 --replacement=0"
+"--crossover-rate=0 --cross-selector=1 --crossover=0 --mutation-rate=3 --mut-selector=2 --mutation=10 --replacement=0"
+"--crossover-rate=2 --cross-selector=2 --crossover=2 --mutation-rate=4 --mut-selector=5 --mutation=10 --replacement=0"
+"--crossover-rate=4 --cross-selector=2 --crossover=2 --mutation-rate=4 --mut-selector=5 --mutation=9 --replacement=0"
+"--crossover-rate=3 --cross-selector=2 --crossover=10 --mutation-rate=4 --mut-selector=2 --mutation=10 --replacement=0"
+"--crossover-rate=2 --cross-selector=2 --crossover=5 --mutation-rate=4 --mut-selector=3 --mutation=9 --replacement=0"
+"--crossover-rate=3 --cross-selector=6 --crossover=2 --mutation-rate=4 --mut-selector=1 --mutation=10 --replacement=0"
+"--crossover-rate=1 --cross-selector=5 --crossover=9 --mutation-rate=4 --mut-selector=2 --mutation=8 --replacement=0"
+"--crossover-rate=2 --cross-selector=5 --crossover=2 --mutation-rate=4 --mut-selector=6 --mutation=8 --replacement=0"
+"--crossover-rate=2 --cross-selector=2 --crossover=10 --mutation-rate=4 --mut-selector=6 --mutation=10 --replacement=0"
+"--crossover-rate=3 --cross-selector=2 --crossover=2 --mutation-rate=4 --mut-selector=5 --mutation=10 --replacement=0"
+"--crossover-rate=4 --cross-selector=2 --crossover=2 --mutation-rate=4 --mut-selector=1 --mutation=8 --replacement=0"
+"--crossover-rate=4 --cross-selector=2 --crossover=2 --mutation-rate=4 --mut-selector=6 --mutation=9 --replacement=0"
+)
+
+pb=0 # Loop counter.
+for algo in "${algos[@]}" ; do
+ echo "Problem ${pb}"
+ echo -n "Runs: "
+
+ for seed in $(seq ${runs}) ; do # Iterates over runs/seeds.
+ # This is the command to be ran.
+ cmd="${exe} --full-log=1 --problem=${pb} --seed=${seed} ${algo}"
+ # echo ${cmd} # Print the command.
+
+ # Forge a directory/log file name
+ # (remove double dashs and replace spaces with underscore).
+ name_run="pb=${pb}_seed=${seed}_$(echo "${algo}" | sed 's/--//g' | sed 's/ /_/g')"
+ # echo $name_run
+
+ # Progress print.
+ echo -n "${seed} "
+
+ # Actually start the command.
+ ${cmd} > "${outdir}/${name_run}.dat" 2> "${outdir}/${name_run}.log"
+
+ # Check for the most common problem in the log file.
+ cat "${outdir}/${name_run}.log" | grep "illogical performance"
+ done
+
+ echo ""
+ perc=$(echo "scale=2;${pb}/${#algos[@]}*100" | bc)
+ echo -e "${perc}%\n"
+ pb=$((pb+1))
+
+done
+
+echo "Done"
diff --git a/eo/contrib/irace/expe/alpha/run_elites_all.sh b/eo/contrib/irace/expe/alpha/run_elites_all.sh
new file mode 100755
index 000000000..1423239d1
--- /dev/null
+++ b/eo/contrib/irace/expe/alpha/run_elites_all.sh
@@ -0,0 +1,61 @@
+
+#!/bin/bash
+
+# Number of runs (=seeds).
+runs=50
+
+# You most probably want to run on release builds.
+exe="./release/fastga"
+
+outdir="$(date --iso-8601=minutes)_results_elites_all"
+mkdir -p ${outdir}
+mkdir -p ${outdir}/raw
+mkdir -p ${outdir}/raw/data
+mkdir -p ${outdir}/raw/logs
+
+n=0
+algoid=0
+for line in $(cat results_irace_100k.csv|cut -s -d"," -f4-10); do
+ echo ""
+ date
+
+ a=($(echo $line | sed "s/,/ /g"))
+ algo="--crossover-rate=${a[0]} --cross-selector=${a[1]} --crossover=${a[2]} --mutation-rate=${a[3]} --mut-selector=${a[4]} --mutation=${a[5]} --replacement=${a[6]}"
+
+ for pb in $(seq 0 18) ; do
+ perc=$(echo "scale=3;${n}/(285*18)*100.0" | bc)
+ echo "${perc}% : algo ${algoid}/285, problem ${pb}/18"
+ # echo -n "Runs: "
+
+ for seed in $(seq ${runs}) ; do # Iterates over runs/seeds.
+ # This is the command to be ran.
+ cmd="${exe} --full-log=1 --problem=${pb} --seed=${seed} ${algo}"
+ # echo ${cmd} # Print the command.
+
+ # Forge a directory/log file name
+ # (remove double dashs and replace spaces with underscore).
+ name_run="pb=${pb}_seed=${seed}_$(echo "${algo}" | sed 's/--//g' | sed 's/ /_/g')"
+ # echo $name_run
+
+ # Progress print.
+ # echo -n "${seed} "
+
+ # Actually start the command.
+ ${cmd} > "${outdir}/raw/data/${name_run}.dat" 2> "${outdir}/raw/logs/${name_run}.log"
+
+ # Check for the most common problem in the log file.
+ cat "${outdir}/raw/logs/${name_run}.log" | grep "illogical performance"
+ done # seed
+ # echo ""
+
+ n=$(($n+1))
+ done # pb
+
+ algoid=$(($algoid+1))
+done
+
+# Move IOH logs in the results directory.
+mv ./FastGA_* ${outdir}
+
+echo "Done"
+date
diff --git a/eo/contrib/irace/expe/alpha/run_irace.sh b/eo/contrib/irace/expe/alpha/run_irace.sh
new file mode 100755
index 000000000..1e0cd7a1d
--- /dev/null
+++ b/eo/contrib/irace/expe/alpha/run_irace.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+
+outdir="$(date --iso-8601=minutes)_results_irace"
+mkdir ${outdir}
+cd ${outdir}
+
+for p in $(seq 0 18) ; do
+ echo -n "Problem ${p}... "
+ res="results_problem_${p}"
+ mkdir ${res}
+ cd ${res}
+
+ # Fore some reason, irace absolutely need those files...
+ cp ../../irace-config/example.scen .
+ cp ../../irace-config/default.instances .
+ cp ../../release/fastga .
+ cat ../../irace-config/target-runner | sed "s/{{PROBLEM}}/${p}/" > ./target-runner
+ chmod u+x target-runner
+
+ # Generate the parameter list file.
+ ./fastga -h > fastga.param 2>/dev/null
+ # /usr/lib/R/site-library/irace/bin/irace --scenario example.scen 2>&1 | tee irace.log
+ /usr/lib/R/site-library/irace/bin/irace --scenario example.scen &> irace.log
+
+ cd ..
+ echo " done"
+done
diff --git a/eo/contrib/irace/expe/alpha/run_irace_all.sh b/eo/contrib/irace/expe/alpha/run_irace_all.sh
new file mode 100755
index 000000000..eff27d2d6
--- /dev/null
+++ b/eo/contrib/irace/expe/alpha/run_irace_all.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+date -Iseconds
+echo "STARTS"
+
+for r in $(seq 15); do
+ echo "Run $r/15";
+ date -Iseconds
+ ./run_irace_parallel-batch.sh
+ date -Iseconds
+done
+
+echo "DONE"
+date -Iseconds
diff --git a/eo/contrib/irace/expe/alpha/run_irace_parallel-batch.sh b/eo/contrib/irace/expe/alpha/run_irace_parallel-batch.sh
new file mode 100755
index 000000000..91b73d7c3
--- /dev/null
+++ b/eo/contrib/irace/expe/alpha/run_irace_parallel-batch.sh
@@ -0,0 +1,38 @@
+#!/bin/bash
+
+outdir="$(date --iso-8601=ns)_results_irace"
+mkdir ${outdir}
+cd ${outdir}
+
+run(){
+ p="$1"
+
+ echo "Problem ${p}"
+ res="results_problem_${p}"
+ mkdir ${res}
+ cd ${res}
+
+ # Fore some reason, irace absolutely need those files...
+ cp ../../irace-config/example.scen .
+ cp ../../irace-config/default.instances .
+ cp ../../release/fastga .
+ cat ../../irace-config/target-runner | sed "s/{{PROBLEM}}/${p}/" > ./target-runner
+ chmod u+x target-runner
+
+ # Generate the parameter list file.
+ ./fastga -h > fastga.param 2>/dev/null
+ # /usr/lib/R/site-library/irace/bin/irace --scenario example.scen 2>&1 | tee irace.log
+ /usr/lib/R/site-library/irace/bin/irace --scenario example.scen &> irace.log
+
+ cd ..
+ echo "Done problem ${p}"
+}
+
+N=5 # Somehow 5 is the fastest on my 4-cores machine.
+(
+for pb in $(seq 0 18); do
+ ((i=i%N)); ((i++==0)) && wait
+ run "$pb" &
+done
+wait
+)
diff --git a/eo/contrib/irace/expe/alpha/run_randoms.sh b/eo/contrib/irace/expe/alpha/run_randoms.sh
new file mode 100755
index 000000000..2b4c65ade
--- /dev/null
+++ b/eo/contrib/irace/expe/alpha/run_randoms.sh
@@ -0,0 +1,61 @@
+
+#!/bin/bash
+
+# Number of runs (=seeds).
+runs=50
+
+# You most probably want to run on release builds.
+exe="./release/fastga"
+
+outdir="$(date --iso-8601=minutes)_results_randoms"
+mkdir -p ${outdir}
+mkdir -p ${outdir}/raw
+mkdir -p ${outdir}/raw/data
+mkdir -p ${outdir}/raw/logs
+
+n=1
+algoid=0
+for algoid in $(seq 0 100); do
+ echo ""
+ date
+
+ a=( $((RANDOM%5)) $((RANDOM%7)) $((RANDOM%11)) $((RANDOM%5)) $((RANDOM%7)) $((RANDOM%11)) $((RANDOM%11)) )
+ algo="--crossover-rate=${a[0]} --cross-selector=${a[1]} --crossover=${a[2]} --mutation-rate=${a[3]} --mut-selector=${a[4]} --mutation=${a[5]} --replacement=${a[6]}"
+
+ for pb in $(seq 0 18) ; do
+ perc=$(echo "scale=3;${n}/(100*18)*100.0" | bc)
+ echo "${perc}% : algo ${algoid}/100, problem ${pb}/18"
+ # echo -n "Runs: "
+
+ for seed in $(seq ${runs}) ; do # Iterates over runs/seeds.
+ # This is the command to be ran.
+ cmd="${exe} --full-log=1 --problem=${pb} --seed=${seed} ${algo}"
+ # echo ${cmd} # Print the command.
+
+ # Forge a directory/log file name
+ # (remove double dashs and replace spaces with underscore).
+ name_run="pb=${pb}_seed=${seed}_$(echo "${algo}" | sed 's/--//g' | sed 's/ /_/g')"
+ # echo $name_run
+
+ # Progress print.
+ # echo -n "${seed} "
+
+ # Actually start the command.
+ ${cmd} > "${outdir}/raw/data/${name_run}.dat" 2> "${outdir}/raw/logs/${name_run}.log"
+
+ # Check for the most common problem in the log file.
+ cat "${outdir}/raw/logs/${name_run}.log" | grep "illogical performance"
+ done # seed
+ # echo ""
+
+ n=$(($n+1))
+ done # pb
+
+ algoid=$(($algoid+1))
+done
+
+# Move IOH logs in the results directory.
+mv ./FastGA_* ${outdir}
+
+echo "Done"
+date
diff --git a/eo/contrib/irace/expe/beta/best_out_of_elites.py b/eo/contrib/irace/expe/beta/best_out_of_elites.py
new file mode 100755
index 000000000..c6832bbe0
--- /dev/null
+++ b/eo/contrib/irace/expe/beta/best_out_of_elites.py
@@ -0,0 +1,86 @@
+#!/usr/bin/env python3
+import sys
+import os
+import numpy as np
+import matplotlib.pyplot as plt
+#cmd eg :
+#python3 best_out_of_elites.py ./fastga_results_all/fastga_results_planO/planO_maxExp=50000_maxEv=5n_2021-08-13T19:16+02:00_results_elites_all
+#python3 best_out_of_elites.py ./fastga_results_all/fastga_results_random/maxEv=10000_nbAlgo=15_2021-08-21T20:53+02:00_results_randoms
+
+
+#get the configuration of the best out of the elite
+# recommendation suggested by 15 independant runs of irace
+
+figdir=sys.argv[1] # directory of a result of one experiment
+#eg : ./fastga_results_all/fastga_results_plan1/plan1_maxExp\=100000_maxEv\=5n_2021-08-13T19\:04+02\:00_results_elites_all/
+#print(figdir.split('/')[-2], figdir.split('/'))
+if("plan" in figdir.split('/')[-2]):
+ print("Operator,","op. ,",",".join(map(str,range(1,20))))
+
+ column={"pc" : 101, "SelectC": 7, "Crossover" : 10, "pm": 101,"SelectM" : 7, "Mutation": 11, "Replacement" : 11, "pop-size": 50, "offspring-size" : 50}
+ nbparam=(len(os.listdir(os.path.join(figdir,"raw/data"))[0].split("_"))-1) #-1 car il y a le pb
+
+ if( nbparam "${myfig}/auc_average_${experiments}.csv"
+ #--------------distribution of operators by pb and for all pb only for plan A,F,O ------
+ #myfig=${figpath}/distribution_op_${plan}
+ #mkdir -p ${myfig}
+ #cmd="python3 distribution_op_all.py ${path} ${myfig} "
+ #$cmd
+ #--------------best out csv--------
+ cmd="python3 best_out_of_elites.py ${path}"
+ myfig=${figpath}/best_out_${plan}
+ mkdir -p ${myfig}
+ $cmd > ${myfig}/best_out_all_pb_${experiments}.csv
+ echo ${cmd}
+
+ done
+done
+
+#---------------distribution of operators of randoma algo------------------
+#rpath=${ldata}/fastga_results_random
+#cmd="python3 dist_op_random.py ${rpath} ${figpath}"
+#$cmd
+#---------------random---------------
\ No newline at end of file
diff --git a/eo/contrib/irace/expe/beta/csv_all_bests.sh b/eo/contrib/irace/expe/beta/csv_all_bests.sh
new file mode 100755
index 000000000..fb7926faf
--- /dev/null
+++ b/eo/contrib/irace/expe/beta/csv_all_bests.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+ldata=$1
+file_py=$2
+csvdir="csv_FAO"
+ldir=$(echo $(ls ${ldata}))
+for data in ${ldir[@]} ; do
+ path="${ldata}/${data}"
+ cmd="python3 ${file_py} ${path}"
+ plan_name=$(echo ${data} | sed "s/data//")
+ mexp=$(echo ${data[@]} | cut -d _ -f2)
+ mevals=$(echo ${data[@]} | cut -d _ -f3)
+ ddate=$(echo ${data[@]} | cut -d _ -f4)
+ name="results_irace_plan${plan_name[@]:0:1}_${mexp}_${mevals}_${ddate}"
+ mkdir -p "${csvdir}/csv_plan${plan_name[@]:0:1}"
+ ${cmd} > "${csvdir}/csv_plan${plan_name[@]:0:1}/${name}.csv"
+done
diff --git a/eo/contrib/irace/expe/beta/dist_op_random.py b/eo/contrib/irace/expe/beta/dist_op_random.py
new file mode 100755
index 000000000..b7056cbd2
--- /dev/null
+++ b/eo/contrib/irace/expe/beta/dist_op_random.py
@@ -0,0 +1,78 @@
+#!/usr/bin/env python3
+import sys
+import os
+import numpy as np
+import matplotlib.pyplot as plt
+
+#cmd eg : python3 ./dist_op_random.py ./fastga_results_all/fastga_results_random/ ./hist_and_csv/
+#get the distribution of operators variants recommended by 15 random algo for each maxEv
+#pc and pm 10 possibilities : [0-0.1[ [0.1-0.2[ [0.2-0.3[ [0.3-0.4[ [0-0.5[ [0.5-0.6[ ...[0.9-1[
+#pop-size and offspring-size 10 possibilities : 0-5 5-10, 10-15 15-20 20-25 25-30 30-35- 35-40 40-45 45-50
+
+path=sys.argv[1] # directory of a result of one experiment
+#eg : ./fastga_results_all/fastga_results_random/
+figdir=sys.argv[2] #directory of where you want to store the data
+if("random" in path):
+ #column : [operator : nbpossibilities]
+ distdir=figdir+"/distribution_random"
+ try:
+ os.makedirs(distdir)
+ except FileExistsError:
+ pass
+
+ nbparam=9 #-1 car il y a le pb
+
+ res=[]
+
+ for maxEvdir in os.listdir(path):
+ res.append({"crossover-rate":["pc" , np.zeros(10, dtype=int)],
+ "cross-selector":["SelectC", np.zeros(7, dtype=int)],
+ "crossover":["Crossover" , np.zeros(10, dtype=int)],
+ "mutation-rate":["pm",np.zeros(10, dtype=int)],
+ "mut-selector":["SelectM",np.zeros(10, dtype=int)],
+ "mutation":["Mutation", np.zeros(11, dtype=int)],
+ "replacement":["Replacement" , np.zeros(11, dtype=int)],
+ "pop-size":["pop-size", np.zeros(10, dtype=int)],
+ "offspring-size":["offspring-size" , np.zeros(10, dtype=int)]})
+ for algodir in os.listdir(os.path.join(path,maxEvdir)): #fastgadir : directory of 50 runs of an elite configuration
+ algo=algodir.split("_")
+ for param in algo:
+ name,val=param.split("=")[0],float(param.split("=")[1])
+ if(name in {"pop-size" ,"offspring-size"}):
+ if(val%5==0):
+ res[-1][name][1][int(val//5) -1]+=1
+ else:
+ #print(res[-1][name][1],val//5)
+ res[-1][name][1][int(val//5)]+=1
+
+ elif(name in {"crossover-rate","mutation-rate"} ):
+ if(int(val*10)==10): #case of val=1
+ res[-1][name][1][-1]+=1
+ else :
+ #print(int(float(val)*10), name,pb,val)
+ res[-1][name][1][int(val*10)]+=1
+ else :
+ res[-1][name][1][int(val)]+=1
+
+
+ ind=0
+ for maxEvdir in os.listdir(path):
+ name="distribution_random_"+maxEvdir.split("_")[0]+".csv" #the end of the path must be /
+ with open(os.path.join(distdir,name),"w+") as csvfile:
+ csvfile.write("Op index, "+",".join(map(str,range(0,11)))+"\n")
+ with open(os.path.join(distdir,name),"a") as csvfile:
+ for param_name in res[ind].keys():
+ #print(map(str,res[ind]),res[ind], ",".join(map(str,res[ind])))
+ csvfile.write(res[ind][param_name][0]+","+ ",".join(map(str,res[ind][param_name][1]))+",-"*(11-len(res[ind][param_name][1])) +"\n")
+ #print(str(i)+",",",".join(map(str,np.mean(aucs[i],1))))
+ ind+=1
+ #all problems
+ name ="distribution_all_random_"+path.split("/")[-1]+".csv"
+ with open(os.path.join(distdir,name),'w+') as csvfile:
+ csvfile.write("Op index, "+",".join(map(str,range(0,11)))+"\n")
+
+ with open(os.path.join(distdir,name),'a') as csvfile:
+ for param_name in res[0].keys():
+ #print(map(str,res[ind]),res[ind], ",".join(map(str,res[ind])))
+ csvfile.write(res[0][param_name][0]+","+ ",".join(map(str,np.sum([res[i][param_name][1] for i in range(ind-1)],0)))+",-"*(11-len(res[0][param_name][1])) +"\n") #res[0] only for getting the name of parameters
+ #print(str(i)+",",",".join(map(str,np.mean(aucs[i],1))))
\ No newline at end of file
diff --git a/eo/contrib/irace/expe/beta/distribution_op_all.py b/eo/contrib/irace/expe/beta/distribution_op_all.py
new file mode 100755
index 000000000..b2843c68b
--- /dev/null
+++ b/eo/contrib/irace/expe/beta/distribution_op_all.py
@@ -0,0 +1,87 @@
+#!/usr/bin/env python3
+import sys
+import os
+import numpy as np
+import matplotlib.pyplot as plt
+
+#get the distribution of operators variants recommended by 15 runs of irace for all problems and each problem
+#also get an csv file
+#pc and pm 10 possibilities : [0-0.1[ [0.1-0.2[ [0.2-0.3[ [0.3-0.4[ [0-0.5[ [0.5-0.6[ ...[0.9-1[
+#pop-size and offspring-size 10 possibilities : 0-5 5-10, 10-15 15-20 20-25 25-30 30-35- 35-40 40-45 45-50
+
+path=sys.argv[1] # directory of a result of one experiment
+#eg : ./fastga_results_all/fastga_results_planO/planO_maxExp\=100000_maxEv\=5n_2021-08-13T19\:04+02\:00_results_elites_all/
+
+if("fastga_results_plan" in path):
+ #column : [operator : nbpossibilities]
+ distdir=sys.argv[2]
+ try:
+ os.makedirs(distdir)
+ except FileExistsError:
+ pass
+
+ nbparam=(len(os.listdir(os.path.join(path,"raw/data"))[0].split("_"))-1)
+
+ if( nbparam==7):
+ res=[{"crossover-rate":["pc" , np.zeros(10, dtype=int)],
+ "cross-selector":["SelectC", np.zeros(7, dtype=int)],
+ "crossover":["Crossover" , np.zeros(10, dtype=int)],
+ "mutation-rate":["pm",np.zeros(10, dtype=int)],
+ "mut-selector":["SelectM",np.zeros(7, dtype=int)],
+ "mutation":["Mutation", np.zeros(11, dtype=int)],
+ "replacement":["Replacement" ,np.zeros(11, dtype=int)]} for i in range(19)]
+ else:
+ res=[{"crossover-rate":["pc" , np.zeros(10, dtype=int)],
+ "cross-selector":["SelectC", np.zeros(7, dtype=int)],
+ "crossover":["Crossover" , np.zeros(10, dtype=int)],
+ "mutation-rate":["pm",np.zeros(10, dtype=int)],
+ "mut-selector":["SelectM",np.zeros(7, dtype=int)],
+ "mutation":["Mutation", np.zeros(11, dtype=int)],
+ "replacement":["Replacement" , np.zeros(11, dtype=int)],
+ "pop-size":["pop-size", np.zeros(10, dtype=int)],
+ "offspring-size":["offspring-size" , np.zeros(10, dtype=int)]} for i in range(19)]
+
+
+ for fastgadir in os.listdir(os.path.join(path,"raw/data")): #fastgadir : directory of 50 runs of an elite configuration
+ algo=fastgadir.split("_")
+ pb=int(fastgadir.split("_")[0].split("=")[1])
+ for param in algo[1:]:
+ name,val=param.split("=")[0],float(param.split("=")[1])
+ if(name in {"pop-size" ,"offspring-size"}):
+ if(val%5==0):
+ res[pb][name][1][int(val//5) -1]+=1
+ else:
+ #print(res[pb][name][1],val//5)
+ res[pb][name][1][int(val//5)]+=1
+
+ elif(name in {"crossover-rate","mutation-rate"} ):
+ if(int(val*10)==10): #case of val=1
+ res[pb][name][1][-1]+=1
+ else :
+ #print(int(float(val)*10), name,pb,val)
+ res[pb][name][1][int(val*10)]+=1
+ else :
+ res[pb][name][1][int(val)]+=1
+
+
+
+ for pb in range(19):
+ name="distribution_pb="+str(pb)+"_"+path.split("/")[-2]+".csv" #the end of the path must be /
+ with open(os.path.join(distdir,name),"w+") as csvfile:
+ csvfile.write("Op index, "+",".join(map(str,range(0,11)))+"\n")
+ with open(os.path.join(distdir,name),"a") as csvfile:
+ for param_name in res[pb].keys():
+ #print(map(str,res[ind]),res[ind], ",".join(map(str,res[ind])))
+ csvfile.write(res[pb][param_name][0]+","+ ",".join(map(str,res[pb][param_name][1]))+",-"*(11-len(res[pb][param_name][1])) +"\n")
+ #print(str(i)+",",",".join(map(str,np.mean(aucs[i],1))))
+
+ #all problems
+ name ="distribution_all_pb_"+path.split("/")[-1]+".csv"
+ with open(os.path.join(path,"raw",name),'w+') as csvfile:
+ csvfile.write("Op index, "+",".join(map(str,range(0,11)))+"\n")
+
+ with open(os.path.join(path,"raw",name),'a') as csvfile:
+ for param_name in res[0].keys():
+ #print(map(str,res[ind]),res[ind], ",".join(map(str,res[ind])))
+ csvfile.write(res[0][param_name][0]+","+ ",".join(map(str,np.sum([res[i][param_name][1] for i in range(19)],0)))+",-"*(11-len(res[0][param_name][1])) +"\n") #res[0] only for getting the name of parameters
+ #print(str(i)+",",",".join(map(str,np.mean(aucs[i],1))))
\ No newline at end of file
diff --git a/eo/contrib/irace/expe/beta/fastga_elites_all.sh b/eo/contrib/irace/expe/beta/fastga_elites_all.sh
new file mode 100644
index 000000000..42f6c0453
--- /dev/null
+++ b/eo/contrib/irace/expe/beta/fastga_elites_all.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+ldata=$1
+file_sh=$2
+ldir=$(echo $(ls ${ldata}))
+fastga_dir="fastga_results_all"
+mkdir -p /scratchbeta/${USER}/${fatga_dir}
+#mkdir -p "/home/${USER}/${fastga_dir}/fastga_results_plan1"
+mkdir -p "/scratchbeta/${USER}/${fastga_dir}/fastga_results_planF"
+mkdir -p "/scratchbeta/${USER}/${fastga_dir}/fastga_results_planA"
+mkdir -p "/scratchbeta/${USER}/${fastga_dir}/fastga_results_planO"
+
+for data in ${ldir[@]} ; do
+ path_csv="${ldata}/${data}"
+ plan_name=$(echo ${data} | sed "s/results_irace_plan//")
+ mexp=$(echo ${data[@]} | cut -d _ -f4)
+ mexp_id=$(echo ${mexp} | cut -d = -f2)
+ mevals=$(echo ${data[@]} | cut -d _ -f5)
+ mevals_id=$(echo ${mevals} | cut -d = -f2)
+ path="/scratchbeta/${USER}/${fastga_dir}/fastga_results_plan${plan_name[@]:0:1}"
+ cmd="bash ${file_sh} ${path_csv} ${mexp_id} ${mevals_id} ${path}"
+ name="fastga${plan_name[@]:0:1}_${mexp}_${mevals}_$(date -Iseconds)_results_elites_all"
+ ${cmd} &> "${path}/output${plan_name[@]:0:1}_fastga_${mexp}_${mevals}_$(date -Iseconds).txt"
+done
diff --git a/eo/contrib/irace/expe/beta/hist_all.sh b/eo/contrib/irace/expe/beta/hist_all.sh
new file mode 100755
index 000000000..89ffe932d
--- /dev/null
+++ b/eo/contrib/irace/expe/beta/hist_all.sh
@@ -0,0 +1,34 @@
+#!/bin/bash
+
+ldata="./fastga_results_all" #fastga_results_all
+figpath="./hist_and_csv" #hist_and_csv
+
+ldir=$(echo $(ls ${ldata})) #list of directory of each plan
+for plan in ${ldir[@]} ; do #get the directory of each plan
+ #------------hist by budget of a Plan (O,R or F)
+ #path="${ldata}/${plan}"
+ #cmd="python3 hist_join.py ${path} ${figpath}"
+ #echo $cmd
+ #$cmd
+
+ #---------------------------hist by pb by budget---------------
+ path="${ldata}/${plan}"
+ cmd="python3 hist_by_pb_budget_plan.py ${path} ${figpath}"
+ echo $cmd
+ $cmd
+done
+
+#---------------random------------------
+#rpath=${ldata}/fastga_results_random
+#cmd="python3 hist_join_random.py ${rpath} ${figpath}"
+#---------------random---------------
+
+#--------------------Choose a Budget irace and a budget fastga
+mexp=100000
+mevals=1000
+#-------------------histogram join each plan F,A,R,O and join all algorithms for the budget chosen
+cmd="python3 hist_by_FARO.py ${ldata} ${figdir} ${mexp} ${mevals}"
+$cmd
+#-------------------histogram by pb join each plan F,A,R,O and join all algorithms for the budget chosen
+cmd="python3 hist_by_FARO_pb.py ${ldata} ${figdir} ${mexp} ${mevals}"
+$cmd
diff --git a/eo/contrib/irace/expe/beta/hist_by_FARO.py b/eo/contrib/irace/expe/beta/hist_by_FARO.py
new file mode 100755
index 000000000..bc6ae3ccc
--- /dev/null
+++ b/eo/contrib/irace/expe/beta/hist_by_FARO.py
@@ -0,0 +1,71 @@
+#!/usr/bin/env python3
+import sys
+import os
+import numpy as np
+import matplotlib.pyplot as plt
+from scipy.stats import mannwhitneyu
+
+##python3 hist_by_FARO.py ./fastga_results_all/ ./hist_and_csv/ 100000 1000
+#one plot for one experiment plan for the same budget fastga, and the same budget irace if there is a budget irace (A,F)
+path=sys.argv[1]
+figpath=sys.argv[2]
+maxExp=sys.argv[3]
+maxEv=sys.argv[4]
+
+indF=-1
+indFO=-1
+averageConfigs=[]
+name=[]
+for fastga in os.listdir(path): #ddir : directory of fastga_plan
+ if(fastga in {"fastga_results_planA","fastga_results_planF","fastga_results_planO"}):
+ for plan in os.listdir(os.path.join(path,fastga)):
+ print("maxExp="+str(maxExp)+"_maxEv="+str(maxEv) in plan,plan,"maxExp="+str(maxExp)+"_maxEv="+str(maxEv))
+ if("maxExp="+str(maxExp)+"_maxEv="+str(maxEv) in plan):
+ average=[]
+
+ for fastgadir in os.listdir(os.path.join(path,fastga,plan,"raw","data")): #fastgadir : directory of 50 runs of a configuration
+ for fname in os.listdir(os.path.join(path,fastga,plan,"raw","data",fastgadir)):
+ with open(os.path.join(path,fastga,plan,"raw","data",fastgadir,fname)) as fd:
+ auc = float(fd.readlines()[0]) *(-1)
+ average.append(auc)
+ averageConfigs.append(average)
+ nameid=plan.split("_")[0][-1]
+ name.append("plan"+nameid+"_"+"_".join(plan.split("_")[1:3]))
+ if("random" in fastga):
+ for randir in os.listdir(os.path.join(path,fastga)):
+ #eg path: maxEv=100_nbAlgo=15_2021-08-20T1511+0200_results_randoms
+ average=[]
+ if("maxEv="+str(maxEv)+"_" in randir):
+ for ddir in os.listdir(os.path.join(path,fastga,randir)): #ddir : directory of one run_elites_all or more
+ if("crossover" in ddir):
+ #name.append("_".join(ddir.split("_")[1:3]))
+ for fastgadir in os.listdir(os.path.join(path,fastga,randir,ddir,"data")): #fastgadir : directory of 50 runs of a configuration
+ for fname in os.listdir(os.path.join(path,fastga,randir,ddir,"data",fastgadir)):
+ with open(os.path.join(path,fastga,randir,ddir,"data",fastgadir,fname)) as fd:
+ auc = float(fd.readlines()[0]) *(-1)
+ average.append(auc)
+ #hist[belonging(auc,cum)]+=1
+ averageConfigs.append(average)
+ name.append(randir.split("_")[0]+"_random")
+
+
+figdir=os.path.join(figpath,"hist_FARO_by_budget")
+try:
+ os.makedirs(figdir)
+except FileExistsError:
+ pass
+
+#_,pv=mannwhitneyu(averageConfigs[indFO],averageConfigs[indF])
+#print(name,len(averageConfigs))
+plt.figure()
+plt.hist(averageConfigs,bins=10,range=(0,1),align="mid",rwidth=0.9,label=name) #no label
+plt.xlabel("performances")
+plt.ylabel("Number of runs")
+plt.xlim(0,1)
+plt.ylim(0,8000)
+plt.yticks(range(0,8000,500))
+#plt.title("pvalue="+str(pv)+"\n medianeF="+str(np.median(averageConfigs[indF]))+", medianeFO="+str(np.median(averageConfigs[indFO])))
+plt.legend()
+plt.savefig(figdir+"/hist_planFARO"+"_maxExp="+str(maxExp)+"_maxEv="+str(maxEv)+".png")
+plt.close()
+
\ No newline at end of file
diff --git a/eo/contrib/irace/expe/beta/hist_by_FARO_pb.py b/eo/contrib/irace/expe/beta/hist_by_FARO_pb.py
new file mode 100755
index 000000000..70eb971cf
--- /dev/null
+++ b/eo/contrib/irace/expe/beta/hist_by_FARO_pb.py
@@ -0,0 +1,88 @@
+#!/usr/bin/env python3
+import sys
+import os
+import numpy as np
+import matplotlib.pyplot as plt
+
+##python3 hist_by_FARO_pb.py ./fastga_results_all/ ./hist_and_csv/ 100000 1000
+#19 histograms by plan F,A ,R O
+path=sys.argv[1]
+figpath=sys.argv[2]
+maxExp=sys.argv[3]
+maxEv=sys.argv[4]
+
+hist_pb=[[] for i in range(19)]
+name=[]
+for fastga in os.listdir(path): #ddir : directory of fastga_plan
+ if(fastga in {"fastga_results_planA", "fastga_results_planF","fastga_results_planO"}):
+ for plan in os.listdir(os.path.join(path,fastga)):
+ #print("maxExp="+str(maxExp)+"_maxEv="+str(maxEv)+"_" in plan,plan,"maxExp="+str(maxExp)+"_maxEv="+str(maxEv))
+ #print("maxExp="+str(maxExp)+"_maxEv="+str(maxEv) in plan,plan,"maxExp="+str(maxExp)+"_maxEv="+str(maxEv))
+ if("maxExp="+str(maxExp)+"_maxEv="+str(maxEv)+"_" in plan):
+ nameid=fastga[-1]
+ name.append("plan"+nameid+"_".join(plan.split("_")[1:3]))
+ for fastgadir in os.listdir(os.path.join(path,fastga,plan,"raw","data")): #fastgadir : directory of 50 runs of a configuration
+ pb=int(fastgadir.split("_")[0].split("=")[1])
+ average_pb=[]
+ for fname in os.listdir(os.path.join(path,fastga,plan,"raw","data",fastgadir)):
+ with open(os.path.join(path,fastga,plan,"raw","data",fastgadir,fname)) as fd:
+ auc = float(fd.readlines()[0]) *(-1)
+ average_pb.append(auc)
+ if(hist_pb[pb]==[]): #first algo
+ hist_pb[pb].append(average_pb)
+ elif(len(hist_pb[pb])!=len(name)):
+ hist_pb[pb].append(average_pb)
+ else:
+ hist_pb[pb][len(name)-1]+=average_pb #another algo for the same plan
+
+ if("random" in fastga):
+ for randir in os.listdir(os.path.join(path,fastga)):
+ #eg path: maxEv=100_nbAlgo=15_2021-08-20T1511+0200_results_randoms
+ if(("maxEv="+str(maxEv)+"_") in randir):
+ #print("maxEv="+str(maxEv) in randir,randir)
+ name.append(randir.split("_")[0]+"_random")
+ for ddir in os.listdir(os.path.join(path,fastga,randir)): #ddir : directory of one run_elites_all or more
+ if("crossover" in ddir):
+ #name.append("_".join(ddir.split("_")[1:3]))
+ for fastgadir in os.listdir(os.path.join(path,fastga,randir,ddir,"data")): #fastgadir : directory of 50 runs of a configuration
+ average_pb=[]
+ pb=int(fastgadir.split("_")[0].split("=")[1])
+ for fname in os.listdir(os.path.join(path,fastga,randir,ddir,"data",fastgadir)):
+ with open(os.path.join(path,fastga,randir,ddir,"data",fastgadir,fname)) as fd:
+ auc = float(fd.readlines()[0]) *(-1)
+ average_pb.append(auc)
+ #print(len(hist_pb[pb]),len(name), pb)
+ if(hist_pb[pb]==[]): #first algo
+ #print("entrer random vide")
+ hist_pb[pb].append(average_pb)
+ elif(len(hist_pb[pb])!=len(name)):
+ #print("entrer random !=")
+ hist_pb[pb].append(average_pb)
+ else:
+ hist_pb[pb][len(name)-1]+=average_pb #another algo for the same plan
+
+
+figdir=os.path.join(figpath,"hist_by_FARO_pb_maxExp={}_maxEv={}".format(maxExp,maxEv))
+try:
+ os.makedirs(figdir)
+except FileExistsError:
+ pass
+#colors=['yellow', 'green',"blue","pink","purple","orange","magenta","gray","darkred","cyan","brown","olivedrab","thistle","stateblue"]
+print(name)
+for pb in range(19):
+ print(pb, len(hist_pb[pb]))
+ for i in hist_pb[pb]:
+ print(len(i))
+ plt.figure()
+ plt.hist(hist_pb[pb],bins=10,range=(0,1),align="mid",rwidth=0.9,edgecolor="red",label=name) #no label color=colors[:len(name)]
+ #for aucs in range(len(hist_pb[pb])):
+ #plt.hist(hist_pb[pb][aucs],bins=10,range=(0,1),align="mid",rwidth=0.9,edgecolor="red",label=name[aucs]) #no label
+ plt.xlabel("performances")
+ plt.ylabel("Number of runs")
+ plt.ylim(0,800)
+ plt.xlim(0,1)
+ plt.yticks(range(0,800,50))
+ #plt.xticks(np.cumsum([0.1]*10))
+ plt.legend()
+ plt.savefig(figdir+"/hist_FARO_pb={}_maxExp={}_maxEv={}.png".format(pb,maxExp,maxEv))
+ plt.close()
\ No newline at end of file
diff --git a/eo/contrib/irace/expe/beta/hist_by_pb_budget_plan.py b/eo/contrib/irace/expe/beta/hist_by_pb_budget_plan.py
new file mode 100755
index 000000000..a91d15e87
--- /dev/null
+++ b/eo/contrib/irace/expe/beta/hist_by_pb_budget_plan.py
@@ -0,0 +1,90 @@
+#!/usr/bin/env python3
+import sys
+import os
+import numpy as np
+import matplotlib.pyplot as plt
+
+# python3 hist_by_pb_budget_plan.py ./fastga_results_all/fastga_results_planF/ ./hist_and_csv/
+#python3 hist_by_pb_budget_plan.py ./fastga_results_all/fastga_results_planO ./hist_and_csv
+#get 19 histograms with number of budget bars, same as hist_join but now is by pb
+
+#argv : list of elite results
+path=sys.argv[1]
+figpath=sys.argv[2]
+#plan_name=sys.argv[3]
+hist_pb=[[] for i in range(19)]
+name=[]
+if("random" in path):
+ plan_name="R"
+else:
+ plan_name=path.strip("/").split("/")[-1][-1]
+
+
+for plandir in os.listdir(path): #plandir: directory of an experiment of elite results
+ if("results_elites_all" in plandir):
+ #eg : plan2_maxExp=10000_maxEv=1000_2021-08-20T1347+0200_results_elites_all
+ budget_irace=plandir.split("_")[1].split("=")[1]
+ budget_fastga=plandir.split("_")[2].split("=")[1]
+ name.append("plan="+plan_name+"_"+"".join(plandir.split("_")[1:3])) #plan=*_maxExp=*_maxEv=*
+
+ for algodir in os.listdir(os.path.join(path,plandir,"raw","data")):
+ average_pb=[]
+ pb=int(algodir.split("_")[0].split("=")[1])
+ for algo in os.listdir(os.path.join(path,plandir,"raw","data",algodir)):
+ with open(os.path.join(path,plandir,"raw","data",algodir,algo)) as fd:
+ auc = float(fd.readlines()[0]) *(-1)
+ average_pb.append(auc)
+ if(hist_pb[pb]==[]): #first algo
+ hist_pb[pb].append(average_pb)
+ elif(len(hist_pb[pb])!=len(name)):
+ hist_pb[pb].append(average_pb)
+ else:
+ hist_pb[pb][len(name)-1]+=average_pb #another algo for the same plan
+
+ if("results_randoms" in plandir):
+ #eg : maxEv=1000_2021-08-20T1347+0200_results_random
+ budget_fastga=plandir.split("_")[0].split("=")[1]
+ name.append("plan="+plan_name+"_"+"".join(plandir.split("_")[0])) #plan=*_maxExp=*_maxEv=*
+ for algodir in os.listdir(os.path.join(path,plandir)):
+
+ for algo in os.listdir(os.path.join(path,plandir,algodir,"data")):
+ pb=int(algo.split("_")[0].split("=")[1])
+ average_pb=[]
+ for fname in os.listdir(os.path.join(path,plandir,algodir,"data",algo)):
+ with open(os.path.join(path,plandir,algodir,"data",algo,fname)) as fd:
+ auc = float(fd.readlines()[0]) *(-1)
+ average_pb.append(auc)
+ if(hist_pb[pb]==[]): #first algo
+ print("entrer")
+ hist_pb[pb].append(average_pb)
+ elif(len(hist_pb[pb])!=len(name)):
+ hist_pb[pb].append(average_pb)
+ else:
+ hist_pb[pb][len(name)-1]+=average_pb #another algo for the same plan
+
+
+
+print(path.split("/")[-1][-1])
+
+figdir=os.path.join(figpath,"hist_by_{}_pb_budget_plan".format(plan_name))
+#figdir=os.path.join(figpath,"hist_by_{}_pb_irace_maxEv={}".format(plan_name,1000))
+try:
+ os.makedirs(figdir)
+except FileExistsError:
+ pass
+
+
+for pb in range(19):
+ print(pb, len(hist_pb[pb]))
+ plt.figure()
+ plt.hist(hist_pb[pb],bins=10,range=(0,1),align="mid",rwidth=0.9,edgecolor="red",label=name) #no label color=colors[:len(name)]
+ #for aucs in range(len(hist_pb[pb])):
+ #plt.hist(hist_pb[pb][aucs],bins=10,range=(0,1),align="mid",rwidth=0.9,edgecolor="red",label=name[aucs]) #no label
+ plt.xlabel("performances")
+ plt.ylabel("Number of runs")
+ plt.ylim(0,750)
+ plt.yticks(range(0,750,50))
+ plt.xlim(0,1)
+ plt.legend()
+ plt.savefig(figdir+"/hist_plan={}_pb={}_budget.png".format(plan_name,pb))
+ plt.close()
\ No newline at end of file
diff --git a/eo/contrib/irace/expe/beta/hist_join.py b/eo/contrib/irace/expe/beta/hist_join.py
new file mode 100755
index 000000000..4ba2d9e13
--- /dev/null
+++ b/eo/contrib/irace/expe/beta/hist_join.py
@@ -0,0 +1,68 @@
+#!/usr/bin/env python3
+import sys
+import os
+import numpy as np
+import matplotlib.pyplot as plt
+from scipy.stats import mannwhitneyu
+
+#cmd : python3 hist_join.py ./fastga_results_all/fastga_results_planO/ ./hist_and_csv/
+#histogram by plan for the budgets (irace and fastag)
+
+
+path=sys.argv[1] #argv : directory of a Plan (O, A, F)
+figpath=sys.argv[2] #path to store the histograms
+averageConfigs=[]
+name=[]
+if("fastga_results_plan" in path):
+ for ddir in os.listdir(path): #ddir : directory of one run_elites_all or more
+ if("plan" in ddir):
+ average=[]
+ name.append("_".join(ddir.split("_")[1:3]))
+ for fastgadir in os.listdir(os.path.join(path,ddir,"raw","data")): #fastgadir : directory of 50 runs of a configuration
+ for fname in os.listdir(os.path.join(path,ddir,"raw","data",fastgadir)):
+ with open(os.path.join(path,ddir,"raw","data",fastgadir,fname)) as fd:
+ auc = float(fd.readlines()[0]) *(-1)
+ average.append(auc)
+ #hist[belonging(auc,cum)]+=1
+ averageConfigs.append(average)
+ #print(hist)
+ #print(average)
+
+ figdir=os.path.join(figpath,"hist_join")
+ try:
+ os.makedirs(figdir)
+ except FileExistsError:
+ pass
+
+
+ print(name,len(averageConfigs))
+
+ """
+ idd0=name[0].split("_")[0].split("=")[1][:-3]+"k"
+ idd1=name[1].split("_")[0].split("=")[1][:-3]+"k"
+ idd2=name[2].split("_")[0].split("=")[1][:-3]+"k"
+
+ #only for Budget irace 10000, 50000, 100000 ie: only three experiment results
+ titlename="median"+idd0+"={:.3f}".format(np.median(averageConfigs[0]))+" , median"+idd1+"={:.3f}".format(np.median(averageConfigs[1]))+" , median"+idd2+"={:.3f}".format(np.median(averageConfigs[2]))
+ _,pv=mannwhitneyu(averageConfigs[0],averageConfigs[1])
+ titlename+="\n pvalue{}={:.3f}".format(idd0+idd1,pv)
+ _,pv=mannwhitneyu(averageConfigs[0],averageConfigs[2])
+ titlename+=" ,pvalue{}={:.3f}".format(idd0+idd2,pv)
+ _,pv=mannwhitneyu(averageConfigs[1],averageConfigs[2])
+ titlename+=" ,pvalue{}={:.3f}".format(idd1+idd2,pv)
+ print(titlename)
+ """
+ plt.figure()
+ plt.hist(averageConfigs,bins=10,range=(0,1),align="mid",rwidth=0.9,label=name) #no label
+ plt.xlabel("performances")
+ plt.ylabel("Number of runs")
+ plt.xlim(0,1)
+ plt.ylim(0,7000)
+ plt.yticks(range(0,7000,500))
+ #plt.title(titlename)
+ plt.legend()
+ plt.savefig(figdir+"/hist_plan"+path.strip("/")[-1]+"_by_budget.png")
+ #plt.savefig(figpath+"/hist_plan"+path.strip("/")[-1]+"_by_budgetI.png")
+ plt.close()
+
+
diff --git a/eo/contrib/irace/expe/beta/hist_join_random.py b/eo/contrib/irace/expe/beta/hist_join_random.py
new file mode 100755
index 000000000..0b5d3c7d4
--- /dev/null
+++ b/eo/contrib/irace/expe/beta/hist_join_random.py
@@ -0,0 +1,46 @@
+#!/usr/bin/env python3
+import sys
+import os
+import numpy as np
+import matplotlib.pyplot as plt
+
+##python3 hist_random.py ./dastga_results_all/fastga_results_random ./hist_and_csv/
+#argv : list of elite results
+data=sys.argv[1]
+figpath=sys.argv[2]
+averageConfigs=[]
+name=[]
+for path in os.listdir(data):
+ #eg path: maxEv=100_nbAlgo=15_2021-08-20T1511+0200_results_randoms
+ average=[]
+ if("maxEv" in path):
+ for ddir in os.listdir(os.path.join(data,path)): #ddir : directory of one run_elites_all or more
+ if("crossover" in ddir):
+ #name.append("_".join(ddir.split("_")[1:3]))
+ for fastgadir in os.listdir(os.path.join(data,path,ddir,"data")): #fastgadir : directory of 50 runs of a configuration
+ for fname in os.listdir(os.path.join(data,path,ddir,"data",fastgadir)):
+ with open(os.path.join(data,path,ddir,"data",fastgadir,fname)) as fd:
+ auc = float(fd.readlines()[0]) *(-1)
+ average.append(auc)
+ #hist[belonging(auc,cum)]+=1
+ averageConfigs.append(average)
+ name.append(path.split("_")[0])
+
+figdir=os.path.join(figpath,"hist_join")
+try:
+ os.makedirs(figdir)
+except FileExistsError:
+ pass
+
+colors=['yellow', 'green',"blue","pink","purple","orange","magenta","gray","darkred","cyan","brown","olivedrab","thistle","stateblue"]
+plt.figure()
+plt.hist(averageConfigs,bins=10,range=(0,1),align="mid",rwidth=0.5,label=name) #no label
+plt.xlabel("performances")
+plt.ylabel("Number of runs")
+plt.ylim([0,8000])
+plt.xlim(0,1)
+plt.yticks(range(0,8000,500))
+#plt.xticks(np.cumsum([0.1]*10))
+plt.legend()
+plt.savefig(figdir+"/hist_random_by_budget.png")
+plt.close()
diff --git a/eo/contrib/irace/expe/beta/irace_files_pA/default.instances b/eo/contrib/irace/expe/beta/irace_files_pA/default.instances
new file mode 100755
index 000000000..4934f7988
--- /dev/null
+++ b/eo/contrib/irace/expe/beta/irace_files_pA/default.instances
@@ -0,0 +1,27 @@
+## This is an example of specifying instances with a file.
+
+# Each line is an instance relative to trainInstancesDir
+# (see scenario.txt.tmpl) and an optional sequence of instance-specific
+# parameters that will be passed to target-runnerx when invoked on that
+# instance.
+
+0
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+
diff --git a/eo/contrib/irace/expe/beta/irace_files_pA/example.scen b/eo/contrib/irace/expe/beta/irace_files_pA/example.scen
new file mode 100755
index 000000000..abebcbb6d
--- /dev/null
+++ b/eo/contrib/irace/expe/beta/irace_files_pA/example.scen
@@ -0,0 +1,227 @@
+###################################################### -*- mode: r -*- #####
+## Scenario setup for Iterated Race (irace).
+############################################################################
+
+## To use the default value of a parameter of iRace, simply do not set
+## the parameter (comment it out in this file, and do not give any
+## value on the command line).
+
+## File that contains the description of the parameters of the target
+## algorithm.
+parameterFile = "./fastga.param"
+
+## Directory where the programs will be run.
+execDir = "."
+
+## File to save tuning results as an R dataset, either absolute path or
+## relative to execDir.
+# logFile = "./irace.Rdata"
+
+## Previously saved log file to recover the execution of irace, either
+## absolute path or relative to the current directory. If empty or NULL,
+## recovery is not performed.
+# recoveryFile = ""
+
+## Directory where training instances are located; either absolute path or
+## relative to current directory. If no trainInstancesFiles is provided,
+## all the files in trainInstancesDir will be listed as instances.
+trainInstancesDir = "."
+
+## File that contains a list of training instances and optionally
+## additional parameters for them. If trainInstancesDir is provided, irace
+## will search for the files in this folder.
+trainInstancesFile = "./default.instances"
+
+## File that contains a table of initial configurations. If empty or NULL,
+## all initial configurations are randomly generated.
+# configurationsFile = ""
+
+## File that contains a list of logical expressions that cannot be TRUE
+## for any evaluated configuration. If empty or NULL, do not use forbidden
+## expressions.
+forbiddenFile = "./forbidden.txt"
+
+## Script called for each configuration that executes the target algorithm
+## to be tuned. See templates.
+targetRunner = "./target-runner"
+
+## Number of times to retry a call to targetRunner if the call failed.
+# targetRunnerRetries = 0
+
+## Optional data passed to targetRunner. This is ignored by the default
+## targetRunner function, but it may be used by custom targetRunner
+## functions to pass persistent data around.
+# targetRunnerData = ""
+
+## Optional R function to provide custom parallelization of targetRunner.
+# targetRunnerParallel = ""
+
+## Optional script or R function that provides a numeric value for each
+## configuration. See templates/target-evaluator.tmpl
+# targetEvaluator = ""
+
+## Maximum number of runs (invocations of targetRunner) that will be
+## performed. It determines the maximum budget of experiments for the
+## tuning.
+maxExperiments = 0 #100000
+
+## Maximum total execution time in seconds for the executions of
+## targetRunner. targetRunner must return two values: cost and time.
+# maxTime = 60
+
+## Fraction (smaller than 1) of the budget used to estimate the mean
+## computation time of a configuration. Only used when maxTime > 0
+# budgetEstimation = 0.02
+
+## Maximum number of decimal places that are significant for numerical
+## (real) parameters.
+digits = 2
+
+## Debug level of the output of irace. Set this to 0 to silence all debug
+## messages. Higher values provide more verbose debug messages.
+# debugLevel = 0
+
+## Number of iterations.
+# nbIterations = 0
+
+## Number of runs of the target algorithm per iteration.
+# nbExperimentsPerIteration = 0
+
+## Randomly sample the training instances or use them in the order given.
+# sampleInstances = 1
+
+## Statistical test used for elimination. Default test is always F-test
+## unless capping is enabled, in which case the default test is t-test.
+## Valid values are: F-test (Friedman test), t-test (pairwise t-tests with
+## no correction), t-test-bonferroni (t-test with Bonferroni's correction
+## for multiple comparisons), t-test-holm (t-test with Holm's correction
+## for multiple comparisons).
+# testType = "F-test"
+
+## Number of instances evaluated before the first elimination test. It
+## must be a multiple of eachTest.
+# firstTest = 5
+
+## Number of instances evaluated between elimination tests.
+# eachTest = 1
+
+## Minimum number of configurations needed to continue the execution of
+## each race (iteration).
+# minNbSurvival = 0
+
+## Number of configurations to be sampled and evaluated at each iteration.
+# nbConfigurations = 0
+
+## Parameter used to define the number of configurations sampled and
+## evaluated at each iteration.
+# mu = 5
+
+## Confidence level for the elimination test.
+# confidence = 0.95
+
+## If the target algorithm is deterministic, configurations will be
+## evaluated only once per instance.
+# deterministic = 0
+
+## Seed of the random number generator (by default, generate a random
+## seed).
+# seed = NA
+
+## Number of calls to targetRunner to execute in parallel. Values 0 or 1
+## mean no parallelization.
+# parallel = 0
+
+## Enable/disable load-balancing when executing experiments in parallel.
+## Load-balancing makes better use of computing resources, but increases
+## communication overhead. If this overhead is large, disabling
+## load-balancing may be faster.
+# loadBalancing = 1
+
+## Enable/disable MPI. Use Rmpi to execute targetRunner in parallel
+## (parameter parallel is the number of slaves).
+# mpi = 0
+
+## Specify how irace waits for jobs to finish when targetRunner submits
+## jobs to a batch cluster: sge, pbs, torque or slurm. targetRunner must
+## submit jobs to the cluster using, for example, qsub.
+# batchmode = 0
+
+## Enable/disable the soft restart strategy that avoids premature
+## convergence of the probabilistic model.
+# softRestart = 1
+
+## Soft restart threshold value for numerical parameters. If NA, NULL or
+## "", it is computed as 10^-digits.
+# softRestartThreshold = ""
+
+## Directory where testing instances are located, either absolute or
+## relative to current directory.
+# testInstancesDir = ""
+
+## File containing a list of test instances and optionally additional
+## parameters for them.
+# testInstancesFile = ""
+
+## Number of elite configurations returned by irace that will be tested if
+## test instances are provided.
+# testNbElites = 1
+
+## Enable/disable testing the elite configurations found at each
+## iteration.
+# testIterationElites = 0
+
+## Enable/disable elitist irace.
+# elitist = 1
+
+## Number of instances added to the execution list before previous
+## instances in elitist irace.
+# elitistNewInstances = 1
+
+## In elitist irace, maximum number per race of elimination tests that do
+## not eliminate a configuration. Use 0 for no limit.
+# elitistLimit = 2
+
+## User-defined R function that takes a configuration generated by irace
+## and repairs it.
+# repairConfiguration = ""
+
+## Enable the use of adaptive capping, a technique designed for minimizing
+## the computation time of configurations. This is only available when
+## elitist is active.
+# capping = 0
+
+## Measure used to obtain the execution bound from the performance of the
+## elite configurations: median, mean, worst, best.
+# cappingType = "median"
+
+## Method to calculate the mean performance of elite configurations:
+## candidate or instance.
+# boundType = "candidate"
+
+## Maximum execution bound for targetRunner. It must be specified when
+## capping is enabled.
+# boundMax = 0
+
+## Precision used for calculating the execution time. It must be specified
+## when capping is enabled.
+# boundDigits = 0
+
+## Penalization constant for timed out executions (executions that reach
+## boundMax execution time).
+# boundPar = 1
+
+## Replace the configuration cost of bounded executions with boundMax.
+# boundAsTimeout = 1
+
+## Percentage of the configuration budget used to perform a postselection
+## race of the best configurations of each iteration after the execution
+## of irace.
+# postselection = 0
+
+## Enable/disable AClib mode. This option enables compatibility with
+## GenericWrapper4AC as targetRunner script.
+# aclib = 0
+
+## END of scenario file
+############################################################################
+
diff --git a/eo/contrib/irace/expe/beta/irace_files_pA/fastga.param b/eo/contrib/irace/expe/beta/irace_files_pA/fastga.param
new file mode 100755
index 000000000..2b5779f64
--- /dev/null
+++ b/eo/contrib/irace/expe/beta/irace_files_pA/fastga.param
@@ -0,0 +1,12 @@
+# name switch type range
+# continuator "--continuator=" c (0)
+crossoverrate "--crossover-rate=" r (0,1)
+crossselector "--cross-selector=" c (0,1,2,3,4,5,6)
+# aftercrossselector "--aftercross-selector=" c (0)
+crossover "--crossover=" c (0,1,2,3,4,5,6,7,8,9)
+mutationrate "--mutation-rate=" r (0,1)
+mutselector "--mut-selector=" c (0,1,2,3,4,5,6)
+mutation "--mutation=" c (0,1,2,3,4,5,6,7,8,9,10)
+replacement "--replacement=" c (0,1,2,3,4,5,6,7,8,9,10)
+popsize "--pop-size=" i (1,50)
+offspringsize "--offspring-size=" i (1,50)
diff --git a/eo/contrib/irace/expe/beta/irace_files_pA/forbidden.txt b/eo/contrib/irace/expe/beta/irace_files_pA/forbidden.txt
new file mode 100755
index 000000000..56eb175cd
--- /dev/null
+++ b/eo/contrib/irace/expe/beta/irace_files_pA/forbidden.txt
@@ -0,0 +1,13 @@
+## Template for specifying forbidden parameter configurations in irace.
+##
+## This filename must be specified via the --forbidden-file command-line option
+## (or forbiddenFile in scenario.txt).
+##
+## The format is one constraint per line. Each constraint is a logical
+## expression (in R syntax). If a parameter configuration
+## is generated that makes the logical expression evaluate to TRUE,
+## then the configuration is discarded.
+##
+## Examples of valid logical operators are: == != >= <= > < & | ! %in%
+(replacement %in% c(2,3,4,5,6,7,8,9,10)) & (offspringsize > popsize)
+(replacement %in% c(1)) & (offspringsize < popsize)
diff --git a/eo/contrib/irace/expe/beta/irace_files_pA/target-runner b/eo/contrib/irace/expe/beta/irace_files_pA/target-runner
new file mode 100755
index 000000000..54c47ecd2
--- /dev/null
+++ b/eo/contrib/irace/expe/beta/irace_files_pA/target-runner
@@ -0,0 +1,89 @@
+#!/bin/bash
+###############################################################################
+# This script is the command that is executed every run.
+# Check the examples in examples/
+#
+# This script is run in the execution directory (execDir, --exec-dir).
+#
+# PARAMETERS:
+# $1 is the candidate configuration number
+# $2 is the instance ID
+# $3 is the seed
+# $4 is the instance name
+# The rest ($* after `shift 4') are parameters to the run
+#
+# RETURN VALUE:
+# This script should print one numerical value: the cost that must be minimized.
+# Exit with 0 if no error, with 1 in case of error
+###############################################################################
+error() {
+ echo "`TZ=UTC date`: $0: error: $@"
+ exit 1
+}
+
+
+EXE="./fastga"
+LOG_DIR="irace_logs"
+
+#FIXED_PARAMS="--problem=0"
+#
+CONFIG_ID=$1
+INSTANCE_ID=$2
+SEED=$3
+INSTANCE=$(echo $4 | sed 's/\//\n/g'|tail -n 1)
+CROSSOVER_RATE=$5
+CROSSOVER_SELECTOR=$6
+CROSSOVER=$7
+MUTATION_RATE=$8
+MUT_SELECTOR=$9
+MUTATION=${10}
+REPLACEMENT=${11}
+POPSIZE=${12}
+OFFSPRINGSIZE=${13}
+shift 13 || error "Not enough parameters"
+
+INSTANCE_PARAMS=$*
+buckets=0
+# STDOUT=${LOG_DIR}/c${CONFIG_ID}_i${INSTANCE_ID}_s${SEED}.stdout
+# STDERR=${LOG_DIR}/c${CONFIG_ID}_i${INSTANCE_ID}_s${SEED}.stderr
+STDOUT="/dev/null"
+STDERR="/dev/null"
+
+if [ ! -x "${EXE}" ]; then
+ error "${EXE}: not found or not executable (pwd: $(pwd))"
+fi
+
+# If the program just prints a number, we can use 'exec' to avoid
+# creating another process, but there can be no other commands after exec.
+#exec $EXE ${FIXED_PARAMS} -i $INSTANCE ${INSTANCE_PARAMS}
+# exit 1
+#
+# Otherwise, save the output to a file, and parse the result from it.
+# (If you wish to ignore segmentation faults you can use '{}' around
+# the command.)
+cmd="$EXE --problem=${INSTANCE} --instance=${INSTANCE} --seed=${SEED} ${CROSSOVER_RATE} ${CROSSOVER_SELECTOR} ${CROSSOVER} ${MUTATION_RATE} ${MUT_SELECTOR} ${MUTATION} ${REPLACEMENT} ${POPSIZE} ${OFFSPRINGSIZE} --max-evals=${buckets}"
+# NOTE: irace seems to capture both stderr and stdout, so you should not output to stderr
+echo ${cmd} > ${STDERR}
+$cmd 2> ${STDERR} | tee ${STDOUT}
+
+# The following code is useless if the binary only output a single number on stdout.
+
+# This may be used to introduce a delay if there are filesystem
+# issues.
+# SLEEPTIME=1
+# while [ ! -s "${STDOUT}" ]; do
+# sleep $SLEEPTIME
+# let "SLEEPTIME += 1"
+# done
+
+# This is an example of reading a number from the output.
+# It assumes that the objective value is the first number in
+# the first column of the last line of the output.
+# if [ -s "${STDOUT}" ]; then
+# COST=$(tail -n 1 ${STDOUT} | grep -e '^[[:space:]]*[+-]\?[0-9]' | cut -f1)
+# echo "$COST"
+# rm -f "${STDOUT}" "${STDERR}"
+# exit 0
+# else
+# error "${STDOUT}: No such file or directory"
+# fi
diff --git a/eo/contrib/irace/expe/beta/irace_files_pF/default.instances b/eo/contrib/irace/expe/beta/irace_files_pF/default.instances
new file mode 100755
index 000000000..a0a1adfc3
--- /dev/null
+++ b/eo/contrib/irace/expe/beta/irace_files_pF/default.instances
@@ -0,0 +1,48 @@
+## This is an example of specifying instances with a file.
+
+# Each line is an instance relative to trainInstancesDir
+# (see scenario.txt.tmpl) and an optional sequence of instance-specific
+# parameters that will be passed to target-runnerx when invoked on that
+# instance.
+
+0
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
diff --git a/eo/contrib/irace/expe/beta/irace_files_pF/example.scen b/eo/contrib/irace/expe/beta/irace_files_pF/example.scen
new file mode 100755
index 000000000..abebcbb6d
--- /dev/null
+++ b/eo/contrib/irace/expe/beta/irace_files_pF/example.scen
@@ -0,0 +1,227 @@
+###################################################### -*- mode: r -*- #####
+## Scenario setup for Iterated Race (irace).
+############################################################################
+
+## To use the default value of a parameter of iRace, simply do not set
+## the parameter (comment it out in this file, and do not give any
+## value on the command line).
+
+## File that contains the description of the parameters of the target
+## algorithm.
+parameterFile = "./fastga.param"
+
+## Directory where the programs will be run.
+execDir = "."
+
+## File to save tuning results as an R dataset, either absolute path or
+## relative to execDir.
+# logFile = "./irace.Rdata"
+
+## Previously saved log file to recover the execution of irace, either
+## absolute path or relative to the current directory. If empty or NULL,
+## recovery is not performed.
+# recoveryFile = ""
+
+## Directory where training instances are located; either absolute path or
+## relative to current directory. If no trainInstancesFiles is provided,
+## all the files in trainInstancesDir will be listed as instances.
+trainInstancesDir = "."
+
+## File that contains a list of training instances and optionally
+## additional parameters for them. If trainInstancesDir is provided, irace
+## will search for the files in this folder.
+trainInstancesFile = "./default.instances"
+
+## File that contains a table of initial configurations. If empty or NULL,
+## all initial configurations are randomly generated.
+# configurationsFile = ""
+
+## File that contains a list of logical expressions that cannot be TRUE
+## for any evaluated configuration. If empty or NULL, do not use forbidden
+## expressions.
+forbiddenFile = "./forbidden.txt"
+
+## Script called for each configuration that executes the target algorithm
+## to be tuned. See templates.
+targetRunner = "./target-runner"
+
+## Number of times to retry a call to targetRunner if the call failed.
+# targetRunnerRetries = 0
+
+## Optional data passed to targetRunner. This is ignored by the default
+## targetRunner function, but it may be used by custom targetRunner
+## functions to pass persistent data around.
+# targetRunnerData = ""
+
+## Optional R function to provide custom parallelization of targetRunner.
+# targetRunnerParallel = ""
+
+## Optional script or R function that provides a numeric value for each
+## configuration. See templates/target-evaluator.tmpl
+# targetEvaluator = ""
+
+## Maximum number of runs (invocations of targetRunner) that will be
+## performed. It determines the maximum budget of experiments for the
+## tuning.
+maxExperiments = 0 #100000
+
+## Maximum total execution time in seconds for the executions of
+## targetRunner. targetRunner must return two values: cost and time.
+# maxTime = 60
+
+## Fraction (smaller than 1) of the budget used to estimate the mean
+## computation time of a configuration. Only used when maxTime > 0
+# budgetEstimation = 0.02
+
+## Maximum number of decimal places that are significant for numerical
+## (real) parameters.
+digits = 2
+
+## Debug level of the output of irace. Set this to 0 to silence all debug
+## messages. Higher values provide more verbose debug messages.
+# debugLevel = 0
+
+## Number of iterations.
+# nbIterations = 0
+
+## Number of runs of the target algorithm per iteration.
+# nbExperimentsPerIteration = 0
+
+## Randomly sample the training instances or use them in the order given.
+# sampleInstances = 1
+
+## Statistical test used for elimination. Default test is always F-test
+## unless capping is enabled, in which case the default test is t-test.
+## Valid values are: F-test (Friedman test), t-test (pairwise t-tests with
+## no correction), t-test-bonferroni (t-test with Bonferroni's correction
+## for multiple comparisons), t-test-holm (t-test with Holm's correction
+## for multiple comparisons).
+# testType = "F-test"
+
+## Number of instances evaluated before the first elimination test. It
+## must be a multiple of eachTest.
+# firstTest = 5
+
+## Number of instances evaluated between elimination tests.
+# eachTest = 1
+
+## Minimum number of configurations needed to continue the execution of
+## each race (iteration).
+# minNbSurvival = 0
+
+## Number of configurations to be sampled and evaluated at each iteration.
+# nbConfigurations = 0
+
+## Parameter used to define the number of configurations sampled and
+## evaluated at each iteration.
+# mu = 5
+
+## Confidence level for the elimination test.
+# confidence = 0.95
+
+## If the target algorithm is deterministic, configurations will be
+## evaluated only once per instance.
+# deterministic = 0
+
+## Seed of the random number generator (by default, generate a random
+## seed).
+# seed = NA
+
+## Number of calls to targetRunner to execute in parallel. Values 0 or 1
+## mean no parallelization.
+# parallel = 0
+
+## Enable/disable load-balancing when executing experiments in parallel.
+## Load-balancing makes better use of computing resources, but increases
+## communication overhead. If this overhead is large, disabling
+## load-balancing may be faster.
+# loadBalancing = 1
+
+## Enable/disable MPI. Use Rmpi to execute targetRunner in parallel
+## (parameter parallel is the number of slaves).
+# mpi = 0
+
+## Specify how irace waits for jobs to finish when targetRunner submits
+## jobs to a batch cluster: sge, pbs, torque or slurm. targetRunner must
+## submit jobs to the cluster using, for example, qsub.
+# batchmode = 0
+
+## Enable/disable the soft restart strategy that avoids premature
+## convergence of the probabilistic model.
+# softRestart = 1
+
+## Soft restart threshold value for numerical parameters. If NA, NULL or
+## "", it is computed as 10^-digits.
+# softRestartThreshold = ""
+
+## Directory where testing instances are located, either absolute or
+## relative to current directory.
+# testInstancesDir = ""
+
+## File containing a list of test instances and optionally additional
+## parameters for them.
+# testInstancesFile = ""
+
+## Number of elite configurations returned by irace that will be tested if
+## test instances are provided.
+# testNbElites = 1
+
+## Enable/disable testing the elite configurations found at each
+## iteration.
+# testIterationElites = 0
+
+## Enable/disable elitist irace.
+# elitist = 1
+
+## Number of instances added to the execution list before previous
+## instances in elitist irace.
+# elitistNewInstances = 1
+
+## In elitist irace, maximum number per race of elimination tests that do
+## not eliminate a configuration. Use 0 for no limit.
+# elitistLimit = 2
+
+## User-defined R function that takes a configuration generated by irace
+## and repairs it.
+# repairConfiguration = ""
+
+## Enable the use of adaptive capping, a technique designed for minimizing
+## the computation time of configurations. This is only available when
+## elitist is active.
+# capping = 0
+
+## Measure used to obtain the execution bound from the performance of the
+## elite configurations: median, mean, worst, best.
+# cappingType = "median"
+
+## Method to calculate the mean performance of elite configurations:
+## candidate or instance.
+# boundType = "candidate"
+
+## Maximum execution bound for targetRunner. It must be specified when
+## capping is enabled.
+# boundMax = 0
+
+## Precision used for calculating the execution time. It must be specified
+## when capping is enabled.
+# boundDigits = 0
+
+## Penalization constant for timed out executions (executions that reach
+## boundMax execution time).
+# boundPar = 1
+
+## Replace the configuration cost of bounded executions with boundMax.
+# boundAsTimeout = 1
+
+## Percentage of the configuration budget used to perform a postselection
+## race of the best configurations of each iteration after the execution
+## of irace.
+# postselection = 0
+
+## Enable/disable AClib mode. This option enables compatibility with
+## GenericWrapper4AC as targetRunner script.
+# aclib = 0
+
+## END of scenario file
+############################################################################
+
diff --git a/eo/contrib/irace/expe/beta/irace_files_pF/fastga.param b/eo/contrib/irace/expe/beta/irace_files_pF/fastga.param
new file mode 100755
index 000000000..2e1d9fe1c
--- /dev/null
+++ b/eo/contrib/irace/expe/beta/irace_files_pF/fastga.param
@@ -0,0 +1,12 @@
+# name switch type range
+# continuator "--continuator=" c (0)
+crossoverrate "--crossover-rate=" r (0,1)
+crossselector "--cross-selector=" c (0,1,2,3,4,5,6)
+# aftercrossselector "--aftercross-selector=" c (0)
+crossover "--crossover=" c (0,1,2,3,4,5,6,7,8,9)
+mutationrate "--mutation-rate=" r (0,1)
+mutselector "--mut-selector=" c (0,1,2,3,4,5,6)
+mutation "--mutation=" c (0,1,2,3,4,5,6,7,8,9,10)
+replacement "--replacement=" c (0,1,2,3,4,5,6,7,8,9,10)
+popsize "--pop-size=" i (1,50)
+offspringsize "--offspring-size=" i (1,50)
diff --git a/eo/contrib/irace/expe/beta/irace_files_pF/forbidden.txt b/eo/contrib/irace/expe/beta/irace_files_pF/forbidden.txt
new file mode 100755
index 000000000..86c8798e4
--- /dev/null
+++ b/eo/contrib/irace/expe/beta/irace_files_pF/forbidden.txt
@@ -0,0 +1,15 @@
+## Template for specifying forbidden parameter configurations in irace.
+##
+## This filename must be specified via the --forbidden-file command-line option
+## (or forbiddenFile in scenario.txt).
+##
+## The format is one constraint per line. Each constraint is a logical
+## expression (in R syntax). If a parameter configuration
+## is generated that makes the logical expression evaluate to TRUE,
+## then the configuration is discarded.
+##
+## Examples of valid logical operators are: == != >= <= > < & | ! %in%
+(replacement %in% c(2,3,4,5,6,7,8,9,10)) & (offspringsize > popsize)
+(replacement %in% c(1)) & (offspringsize < popsize)
+#(as.numeric(replacement) == 2) & (offspringsize > popsize)
+#(as.numeric(replacement) == 3) & (offspringsize > popsize)
diff --git a/eo/contrib/irace/expe/beta/irace_files_pF/target-runner b/eo/contrib/irace/expe/beta/irace_files_pF/target-runner
new file mode 100755
index 000000000..7a990a8ec
--- /dev/null
+++ b/eo/contrib/irace/expe/beta/irace_files_pF/target-runner
@@ -0,0 +1,96 @@
+#!/bin/bash
+###############################################################################
+# This script is the command that is executed every run.
+# Check the examples in examples/
+#
+# This script is run in the execution directory (execDir, --exec-dir).
+#
+# PARAMETERS:
+# $1 is the candidate configuration number
+# $2 is the instance ID
+# $3 is the seed
+# $4 is the instance name
+# The rest ($* after `shift 4') are parameters to the run
+#
+# RETURN VALUE:
+# This script should print one numerical value: the cost that must be minimized.
+# Exit with 0 if no error, with 1 in case of error
+###############################################################################
+error() {
+ echo "`TZ=UTC date`: $0: error: $@"
+ exit 1
+}
+
+
+EXE="./fastga"
+LOG_DIR="irace_logs"
+
+FIXED_PARAMS="--problem=0"
+#MAX_EVALS=2
+#
+CONFIG_ID=$1
+INSTANCE_ID=$2
+SEED=$3
+INSTANCE=$(echo $4 | sed 's/\//\n/g'|tail -n 1)
+CROSSOVER_RATE=$5
+CROSSOVER_SELECTOR=$6
+CROSSOVER=$7
+MUTATION_RATE=$8
+MUT_SELECTOR=$9
+MUTATION=${10}
+REPLACEMENT=${11}
+POPSIZE=${12}
+OFFSPRINGSIZE=${13}
+shift 13 || error "Not enough parameters"
+
+INSTANCE_PARAMS=$*
+
+buckets=0
+#dim=(20 20 16 48 25 32 128 128 128 50 100 150 128 192 192 192 256 75 150)
+#size= $( echo $(echo $13 | cut -d'=' -f2))
+#pb=$(echo $(echo $13 | cut -d'=' -f2))
+#maxevals=$( echo ${dim[$pb]})
+# STDOUT=${LOG_DIR}/c${CONFIG_ID}_i${INSTANCE_ID}_s${SEED}.stdout
+# STDERR=${LOG_DIR}/c${CONFIG_ID}_i${INSTANCE_ID}_s${SEED}.stderr
+STDOUT="/dev/null"
+STDERR="/dev/null"
+
+if [ ! -x "${EXE}" ]; then
+ error "${EXE}: not found or not executable (pwd: $(pwd))"
+fi
+
+# If the program just prints a number, we can use 'exec' to avoid
+# creating another process, but there can be no other commands after exec.
+#exec $EXE ${FIXED_PARAMS} -i $INSTANCE ${INSTANCE_PARAMS}
+# exit 1
+#
+# Otherwise, save the output to a file, and parse the result from it.
+# (If you wish to ignore segmentation faults you can use '{}' around
+# the command.)
+
+cmd="$EXE ${FIXED_PARAMS} --instance=${INSTANCE} --seed=${SEED} ${CROSSOVER_RATE} ${CROSSOVER_SELECTOR} ${CROSSOVER} ${MUTATION_RATE} ${MUT_SELECTOR} ${MUTATION} ${REPLACEMENT} ${POPSIZE} ${OFFSPRINGSIZE} --max-evals=${buckets}"
+# NOTE: irace seems to capture both stderr and stdout, so you should not output to stderr
+echo ${cmd} > ${STDERR}
+$cmd 2> ${STDERR} | tee ${STDOUT}
+
+# The following code is useless if the binary only output a single number on stdout.
+
+# This may be used to introduce a delay if there are filesystem
+# issues.
+# SLEEPTIME=1
+# while [ ! -s "${STDOUT}" ]; do
+# sleep $SLEEPTIME
+# let "SLEEPTIME += 1"
+# done
+
+# This is an example of reading a number from the output.
+# It assumes that the objective value is the first number in
+# the first column of the last line of the output.
+# if [ -s "${STDOUT}" ]; then
+# COST=$(tail -n 1 ${STDOUT} | grep -e '^[[:space:]]*[+-]\?[0-9]' | cut -f1)
+# echo "$COST"
+# rm -f "${STDOUT}" "${STDERR}"
+# exit 0
+# else
+# error "${STDOUT}: No such file or directory"
+# fi
diff --git a/eo/contrib/irace/expe/beta/irace_files_pO/default.instances b/eo/contrib/irace/expe/beta/irace_files_pO/default.instances
new file mode 100755
index 000000000..a0a1adfc3
--- /dev/null
+++ b/eo/contrib/irace/expe/beta/irace_files_pO/default.instances
@@ -0,0 +1,48 @@
+## This is an example of specifying instances with a file.
+
+# Each line is an instance relative to trainInstancesDir
+# (see scenario.txt.tmpl) and an optional sequence of instance-specific
+# parameters that will be passed to target-runnerx when invoked on that
+# instance.
+
+0
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
diff --git a/eo/contrib/irace/expe/beta/irace_files_pO/example.scen b/eo/contrib/irace/expe/beta/irace_files_pO/example.scen
new file mode 100755
index 000000000..8b9447333
--- /dev/null
+++ b/eo/contrib/irace/expe/beta/irace_files_pO/example.scen
@@ -0,0 +1,228 @@
+###################################################### -*- mode: r -*- #####
+## Scenario setup for Iterated Race (irace).
+############################################################################
+
+## To use the default value of a parameter of iRace, simply do not set
+## the parameter (comment it out in this file, and do not give any
+## value on the command line).
+
+## File that contains the description of the parameters of the target
+## algorithm.
+parameterFile = "./fastga.param"
+
+## Directory where the programs will be run.
+execDir = "."
+
+## File to save tuning results as an R dataset, either absolute path or
+## relative to execDir.
+# logFile = "./irace.Rdata"
+
+## Previously saved log file to recover the execution of irace, either
+## absolute path or relative to the current directory. If empty or NULL,
+## recovery is not performed.
+# recoveryFile = ""
+
+## Directory where training instances are located; either absolute path or
+## relative to current directory. If no trainInstancesFiles is provided,
+## all the files in trainInstancesDir will be listed as instances.
+trainInstancesDir = "."
+
+## File that contains a list of training instances and optionally
+## additional parameters for them. If trainInstancesDir is provided, irace
+## will search for the files in this folder.
+trainInstancesFile = "./default.instances"
+
+## File that contains a table of initial configurations. If empty or NULL,
+## all initial configurations are randomly generated.
+# configurationsFile = ""
+
+## File that contains a list of logical expressions that cannot be TRUE
+## for any evaluated configuration. If empty or NULL, do not use forbidden
+## expressions.
+# forbiddenFile = ""
+
+## Script called for each configuration that executes the target algorithm
+## to be tuned. See templates.
+targetRunner = "./target-runner"
+
+## Number of times to retry a call to targetRunner if the call failed.
+# targetRunnerRetries = 0
+
+## Optional data passed to targetRunner. This is ignored by the default
+## targetRunner function, but it may be used by custom targetRunner
+## functions to pass persistent data around.
+# targetRunnerData = ""
+
+## Optional R function to provide custom parallelization of targetRunner.
+# targetRunnerParallel = ""
+
+## Optional script or R function that provides a numeric value for each
+## configuration. See templates/target-evaluator.tmpl
+# targetEvaluator = ""
+
+## Maximum number of runs (invocations of targetRunner) that will be
+## performed. It determines the maximum budget of experiments for the
+## tuning.
+maxExperiments = 0 #100000
+
+
+## Maximum total execution time in seconds for the executions of
+## targetRunner. targetRunner must return two values: cost and time.
+# maxTime = 60
+
+## Fraction (smaller than 1) of the budget used to estimate the mean
+## computation time of a configuration. Only used when maxTime > 0
+# budgetEstimation = 0.02
+
+## Maximum number of decimal places that are significant for numerical
+## (real) parameters.
+digits = 2
+
+## Debug level of the output of irace. Set this to 0 to silence all debug
+## messages. Higher values provide more verbose debug messages.
+# debugLevel = 0
+
+## Number of iterations.
+# nbIterations = 0
+
+## Number of runs of the target algorithm per iteration.
+# nbExperimentsPerIteration = 0
+
+## Randomly sample the training instances or use them in the order given.
+# sampleInstances = 1
+
+## Statistical test used for elimination. Default test is always F-test
+## unless capping is enabled, in which case the default test is t-test.
+## Valid values are: F-test (Friedman test), t-test (pairwise t-tests with
+## no correction), t-test-bonferroni (t-test with Bonferroni's correction
+## for multiple comparisons), t-test-holm (t-test with Holm's correction
+## for multiple comparisons).
+# testType = "F-test"
+
+## Number of instances evaluated before the first elimination test. It
+## must be a multiple of eachTest.
+# firstTest = 5
+
+## Number of instances evaluated between elimination tests.
+# eachTest = 1
+
+## Minimum number of configurations needed to continue the execution of
+## each race (iteration).
+# minNbSurvival = 0
+
+## Number of configurations to be sampled and evaluated at each iteration.
+# nbConfigurations = 0
+
+## Parameter used to define the number of configurations sampled and
+## evaluated at each iteration.
+# mu = 5
+
+## Confidence level for the elimination test.
+# confidence = 0.95
+
+## If the target algorithm is deterministic, configurations will be
+## evaluated only once per instance.
+# deterministic = 0
+
+## Seed of the random number generator (by default, generate a random
+## seed).
+# seed = NA
+
+## Number of calls to targetRunner to execute in parallel. Values 0 or 1
+## mean no parallelization.
+# parallel = 0
+
+## Enable/disable load-balancing when executing experiments in parallel.
+## Load-balancing makes better use of computing resources, but increases
+## communication overhead. If this overhead is large, disabling
+## load-balancing may be faster.
+# loadBalancing = 1
+
+## Enable/disable MPI. Use Rmpi to execute targetRunner in parallel
+## (parameter parallel is the number of slaves).
+# mpi = 0
+
+## Specify how irace waits for jobs to finish when targetRunner submits
+## jobs to a batch cluster: sge, pbs, torque or slurm. targetRunner must
+## submit jobs to the cluster using, for example, qsub.
+# batchmode = 0
+
+## Enable/disable the soft restart strategy that avoids premature
+## convergence of the probabilistic model.
+# softRestart = 1
+
+## Soft restart threshold value for numerical parameters. If NA, NULL or
+## "", it is computed as 10^-digits.
+# softRestartThreshold = ""
+
+## Directory where testing instances are located, either absolute or
+## relative to current directory.
+# testInstancesDir = ""
+
+## File containing a list of test instances and optionally additional
+## parameters for them.
+# testInstancesFile = ""
+
+## Number of elite configurations returned by irace that will be tested if
+## test instances are provided.
+# testNbElites = 1
+
+## Enable/disable testing the elite configurations found at each
+## iteration.
+# testIterationElites = 0
+
+## Enable/disable elitist irace.
+# elitist = 1
+
+## Number of instances added to the execution list before previous
+## instances in elitist irace.
+# elitistNewInstances = 1
+
+## In elitist irace, maximum number per race of elimination tests that do
+## not eliminate a configuration. Use 0 for no limit.
+# elitistLimit = 2
+
+## User-defined R function that takes a configuration generated by irace
+## and repairs it.
+# repairConfiguration = ""
+
+## Enable the use of adaptive capping, a technique designed for minimizing
+## the computation time of configurations. This is only available when
+## elitist is active.
+# capping = 0
+
+## Measure used to obtain the execution bound from the performance of the
+## elite configurations: median, mean, worst, best.
+# cappingType = "median"
+
+## Method to calculate the mean performance of elite configurations:
+## candidate or instance.
+# boundType = "candidate"
+
+## Maximum execution bound for targetRunner. It must be specified when
+## capping is enabled.
+# boundMax = 0
+
+## Precision used for calculating the execution time. It must be specified
+## when capping is enabled.
+# boundDigits = 0
+
+## Penalization constant for timed out executions (executions that reach
+## boundMax execution time).
+# boundPar = 1
+
+## Replace the configuration cost of bounded executions with boundMax.
+# boundAsTimeout = 1
+
+## Percentage of the configuration budget used to perform a postselection
+## race of the best configurations of each iteration after the execution
+## of irace.
+# postselection = 0
+
+## Enable/disable AClib mode. This option enables compatibility with
+## GenericWrapper4AC as targetRunner script.
+# aclib = 0
+
+## END of scenario file
+############################################################################
+
diff --git a/eo/contrib/irace/expe/beta/irace_files_pO/fastga.param b/eo/contrib/irace/expe/beta/irace_files_pO/fastga.param
new file mode 100755
index 000000000..9f8c088f4
--- /dev/null
+++ b/eo/contrib/irace/expe/beta/irace_files_pO/fastga.param
@@ -0,0 +1,10 @@
+# name switch type range
+# continuator "--continuator=" c (0)
+crossoverrate "--crossover-rate=" r (0,1)
+crossselector "--cross-selector=" c (0,1,2,3,4,5,6)
+# aftercrossselector "--aftercross-selector=" c (0)
+crossover "--crossover=" c (0,1,2,3,4,5,6,7,8,9)
+mutationrate "--mutation-rate=" r (0,1)
+mutselector "--mut-selector=" c (0,1,2,3,4,5,6)
+mutation "--mutation=" c (0,1,2,3,4,5,6,7,8,9,10)
+replacement "--replacement=" c (0,1,2,3,4,5,6,7,8,9,10)
diff --git a/eo/contrib/irace/expe/beta/irace_files_pO/target-runner b/eo/contrib/irace/expe/beta/irace_files_pO/target-runner
new file mode 100755
index 000000000..941322610
--- /dev/null
+++ b/eo/contrib/irace/expe/beta/irace_files_pO/target-runner
@@ -0,0 +1,88 @@
+#!/bin/bash
+###############################################################################
+# This script is the command that is executed every run.
+# Check the examples in examples/
+#
+# This script is run in the execution directory (execDir, --exec-dir).
+#
+# PARAMETERS:
+# $1 is the candidate configuration number
+# $2 is the instance ID
+# $3 is the seed
+# $4 is the instance name
+# The rest ($* after `shift 4') are parameters to the run
+#
+# RETURN VALUE:
+# This script should print one numerical value: the cost that must be minimized.
+# Exit with 0 if no error, with 1 in case of error
+###############################################################################
+error() {
+ echo "`TZ=UTC date`: $0: error: $@"
+ exit 1
+}
+
+
+EXE="./fastga"
+LOG_DIR="irace_logs"
+
+FIXED_PARAMS="--problem=0"
+MAX_EVALS=100
+#
+CONFIG_ID=$1
+INSTANCE_ID=$2
+SEED=$3
+INSTANCE=$(echo $4 | sed 's/\//\n/g'|tail -n 1)
+CROSSOVER_RATE=$5
+CROSSOVER_SELECTOR=$6
+CROSSOVER=$7
+MUTATION_RATE=$8
+MUT_SELECTOR=$9
+MUTATION=${10}
+REPLACEMENT=${11}
+shift 11 || error "Not enough parameters"
+
+INSTANCE_PARAMS=$*
+
+# STDOUT=${LOG_DIR}/c${CONFIG_ID}_i${INSTANCE_ID}_s${SEED}.stdout
+# STDERR=${LOG_DIR}/c${CONFIG_ID}_i${INSTANCE_ID}_s${SEED}.stderr
+STDOUT="/dev/null"
+STDERR="/dev/null"
+
+if [ ! -x "${EXE}" ]; then
+ error "${EXE}: not found or not executable (pwd: $(pwd))"
+fi
+
+# If the program just prints a number, we can use 'exec' to avoid
+# creating another process, but there can be no other commands after exec.
+#exec $EXE ${FIXED_PARAMS} -i $INSTANCE ${INSTANCE_PARAMS}
+# exit 1
+#
+# Otherwise, save the output to a file, and parse the result from it.
+# (If you wish to ignore segmentation faults you can use '{}' around
+# the command.)
+cmd="$EXE ${FIXED_PARAMS} --instance=${INSTANCE} --seed=${SEED} ${CROSSOVER_RATE} ${CROSSOVER_SELECTOR} ${CROSSOVER} ${MUTATION_RATE} ${MUT_SELECTOR} ${MUTATION} ${REPLACEMENT}"
+# NOTE: irace seems to capture both stderr and stdout, so you should not output to stderr
+echo ${cmd} > ${STDERR}
+$cmd 2> ${STDERR} | tee ${STDOUT}
+
+# The following code is useless if the binary only output a single number on stdout.
+
+# This may be used to introduce a delay if there are filesystem
+# issues.
+# SLEEPTIME=1
+# while [ ! -s "${STDOUT}" ]; do
+# sleep $SLEEPTIME
+# let "SLEEPTIME += 1"
+# done
+
+# This is an example of reading a number from the output.
+# It assumes that the objective value is the first number in
+# the first column of the last line of the output.
+# if [ -s "${STDOUT}" ]; then
+# COST=$(tail -n 1 ${STDOUT} | grep -e '^[[:space:]]*[+-]\?[0-9]' | cut -f1)
+# echo "$COST"
+# rm -f "${STDOUT}" "${STDERR}"
+# exit 0
+# else
+# error "${STDOUT}: No such file or directory"
+# fi
diff --git a/eo/contrib/irace/expe/beta/mwtestU.py b/eo/contrib/irace/expe/beta/mwtestU.py
new file mode 100755
index 000000000..00b06ead6
--- /dev/null
+++ b/eo/contrib/irace/expe/beta/mwtestU.py
@@ -0,0 +1,140 @@
+#!/usr/bin/env python3
+import sys
+import os
+import numpy as np
+import matplotlib.pyplot as plt
+from scipy.stats import mannwhitneyu
+
+##cmd eg :
+# python3 hist_by_2_4_5.py ./fastga_results_all/ ./hist_and_csv/ 100000 1000
+
+#get the Mann Whitney test U results between the plan F and plan R
+# (change ligne 23 and 44 for other plan, and the maxExp, maxEv for other budget)
+
+path=sys.argv[1]
+figpath=sys.argv[2] #directory to store the data
+maxExp=sys.argv[3]
+maxEv=sys.argv[4]
+
+hist_pb=[[] for i in range(19)]
+name=[]
+randind=-1
+for fastga in os.listdir(path): #ddir : directory of fastga_plan
+ if(fastga in {"fastga_results_planF"}):
+ for plan in os.listdir(os.path.join(path,fastga)):
+ print("maxExp="+str(maxExp)+"_maxEv="+str(maxEv)+"_" in plan,plan,"maxExp="+str(maxExp)+"_maxEv="+str(maxEv))
+ #print("maxExp="+str(maxExp)+"_maxEv="+str(maxEv) in plan,plan,"maxExp="+str(maxExp)+"_maxEv="+str(maxEv))
+ if("maxExp="+str(maxExp)+"_maxEv="+str(maxEv)+"_" in plan):
+ name.append("_".join(plan.split("_")[:3]))
+ for fastgadir in os.listdir(os.path.join(path,fastga,plan,"raw","data")): #fastgadir : directory of 50 runs of a configuration
+ pb=int(fastgadir.split("_")[0].split("=")[1])
+ average_pb=[]
+ for fname in os.listdir(os.path.join(path,fastga,plan,"raw","data",fastgadir)):
+ with open(os.path.join(path,fastga,plan,"raw","data",fastgadir,fname)) as fd:
+ auc = float(fd.readlines()[0])
+ average_pb.append(auc)
+ if(hist_pb[pb]==[]): #first algo
+ hist_pb[pb].append(average_pb)
+ elif(len(hist_pb[pb])!=len(name)):
+ hist_pb[pb].append(average_pb)
+ else:
+ hist_pb[pb][len(name)-1]+=average_pb #another algo for the same plan
+
+
+ if("random" in fastga):
+ for randir in os.listdir(os.path.join(path,fastga)):
+ #eg path: maxEv=100_nbAlgo=15_2021-08-20T1511+0200_results_randoms
+ if(("maxEv="+str(maxEv)+"_") in randir):
+ print("maxEv="+str(maxEv) in randir,randir)
+ name.append(randir.split("_")[0]+"_random")
+ randind=len(name)-1
+ print(randind,name)
+ for ddir in os.listdir(os.path.join(path,fastga,randir)): #ddir : directory of one run_elites_all or more
+ if("crossover" in ddir):
+ for fastgadir in os.listdir(os.path.join(path,fastga,randir,ddir,"data")): #fastgadir : directory of 50 runs of a configuration
+ average_pb=[]
+ pb=int(fastgadir.split("_")[0].split("=")[1])
+ for fname in os.listdir(os.path.join(path,fastga,randir,ddir,"data",fastgadir)):
+ with open(os.path.join(path,fastga,randir,ddir,"data",fastgadir,fname)) as fd:
+ auc = float(fd.readlines()[0])
+ average_pb.append(auc)
+ #print(len(hist_pb[pb]),len(name), pb)
+ if(hist_pb[pb]==[]): #first algo
+ #print("entrer random vide")
+ hist_pb[pb].append(average_pb)
+ elif(len(hist_pb[pb])!=len(name)):
+ #print("entrer random !=")
+ hist_pb[pb].append(average_pb)
+ else:
+ hist_pb[pb][len(name)-1]+=average_pb #another algo for the same plan
+
+
+figdir=os.path.join(figpath,"mwtestU_FR")
+try:
+ os.makedirs(figdir)
+except FileExistsError:
+ pass
+#colors=['yellow', 'green',"blue","pink","purple","orange","magenta","gray","darkred","cyan","brown","olivedrab","thistle","stateblue"]
+print(name)
+
+filename="mwtestU_maxExp={}_maxEv={}_FR.csv".format(maxExp,maxEv)
+with open(os.path.join(figdir,filename),'w+') as csvfile:
+ csvfile.write(" ,"+",".join(map(str,range(0,19)))+"\n")
+meanvalue=[]
+pvalue=[]
+meanR=[]
+meanF=[]
+mdianR=[]
+mdianF=[]
+mdianvalue=[]
+iqrR=[]
+iqrF=[]
+stdR=[]
+stdF=[]
+iqrvalue=[]
+pstd=[]
+
+for pb in range(19):
+ #hR,lR,_=plt.hist(hist_pb[pb][randind],bins=10,range=(-1,0),align="mid",label=name) #no label color=colors[:len(name)]
+ #hF,lF,_=plt.hist(hist_pb[pb][np.abs(1-randind)],bins=10,range=(-1,0),align="mid",label=name) #no label color=colors[:len(name)]
+ _,pv=mannwhitneyu(hist_pb[pb][np.abs(1-randind)],hist_pb[pb][randind])
+ print(_,pv)
+ #meanvalue.append(np.mean(np.array(hF)*np.array(lF[:len(lF)-1]))-np.mean(np.array(hR)*np.array(lR[:len(lR)-1])))
+ pstd.append(np.std(hist_pb[pb][np.abs(1-randind)])-np.std(hist_pb[pb][randind]))
+ stdF.append(np.std(hist_pb[pb][np.abs(1-randind)]))
+ stdR.append(np.std(hist_pb[pb][randind]))
+ meanF.append(np.mean(hist_pb[pb][np.abs(1-randind)]))
+ meanR.append(np.mean(hist_pb[pb][randind]))
+ mdianF.append(np.median(hist_pb[pb][np.abs(1-randind)]))
+ mdianR.append(np.median(hist_pb[pb][randind]))
+ mdianvalue.append(np.median(hist_pb[pb][np.abs(1-randind)])-np.median(hist_pb[pb][randind]))
+ meanvalue.append(np.mean(hist_pb[pb][np.abs(1-randind)])-np.mean(hist_pb[pb][randind]))
+ pvalue.append(pv)
+ Q1 = np.percentile(hist_pb[pb][np.abs(1-randind)], 25, interpolation = 'midpoint')
+ # Third quartile (Q3)
+ Q3 = np.percentile(hist_pb[pb][np.abs(1-randind)], 75, interpolation = 'midpoint')
+ # Interquaritle range (IQR)
+ iqrF.append( Q3 - Q1)
+ Q1 = np.percentile(hist_pb[pb][randind], 25, interpolation = 'midpoint')
+ # Third quartile (Q3)
+ Q3 = np.percentile(hist_pb[pb][randind], 75, interpolation = 'midpoint')
+ # Interquaritle range (IQR)
+ iqrR.append( Q3 - Q1)
+ print(_,pv)
+iqrvalue=np.array(iqrF)-np.array(iqrR)
+with open(os.path.join(figdir,filename),'a') as csvfile:
+ csvfile.write("mF-mR,"+",".join(map(str,meanvalue))+"\n")
+ csvfile.write("p_value,"+",".join(map(str,pvalue))+"\n")
+ csvfile.write("mF,"+",".join(map(str,meanF))+"\n")
+ csvfile.write("mR,"+",".join(map(str,meanR))+"\n")
+ csvfile.write("medianF-medianR,"+",".join(map(str,mdianvalue))+"\n")
+ csvfile.write("medianF,"+",".join(map(str,mdianF))+"\n")
+ csvfile.write("medianR,"+",".join(map(str,mdianR))+"\n")
+ csvfile.write("stdF-stdR,"+",".join(map(str,mdianvalue))+"\n")
+ csvfile.write("stdF,"+",".join(map(str,stdF))+"\n")
+ csvfile.write("stdR,"+",".join(map(str,stdR))+"\n")
+ csvfile.write("iqrF,"+",".join(map(str,iqrF))+"\n")
+ csvfile.write("iqrR,"+",".join(map(str,iqrR))+"\n")
+ csvfile.write("iqrF-iqrR,"+",".join(map(str,iqrvalue))+"\n")
+
+
\ No newline at end of file
diff --git a/eo/contrib/irace/expe/beta/parseA_irace_bests.py b/eo/contrib/irace/expe/beta/parseA_irace_bests.py
new file mode 100755
index 000000000..7c48f8049
--- /dev/null
+++ b/eo/contrib/irace/expe/beta/parseA_irace_bests.py
@@ -0,0 +1,31 @@
+#!/usr/bin/env python3
+#parse data1
+import os
+import re
+import sys
+
+print("ecdf,id,crossover-rate,cross-selector,crossover,mutation-rate,mut-selector,mutation,replacement,pop-size,offspring-size")
+
+
+#give the path of one experiment
+argv=sys.argv[1]
+for datadir in os.listdir(argv):
+ #if(os.path.isdir(os.path.join(argv,datadir))): check if argv/datadir is a directory
+ if(datadir.find("results_irace")>=0): #check if the directory is one JOB
+ with open(os.path.join("./",argv,datadir,"irace.log")) as fd:
+ data = fd.readlines()
+
+ # Find the last best configuration
+ bests = [line.strip() for line in data if "Best-so-far" in line]
+ #print(datadir,bests)
+ best = bests[-1].split()
+ best_id, best_perf = best[2], best[5]
+ # print(best_id,best_perf)
+
+ # Filter the config detail
+ configs = [line.strip() for line in data if "--crossover-rate=" in line and best_id in line]
+ # print(configs)
+ # Format as CSV
+ algo = re.sub("\-\-\S*=", ",", configs[0])
+ csv_line = best_perf + "," + algo
+ print(csv_line.replace(" ",""))
\ No newline at end of file
diff --git a/eo/contrib/irace/expe/beta/parseF_irace_bests.py b/eo/contrib/irace/expe/beta/parseF_irace_bests.py
new file mode 100755
index 000000000..39c3d44cc
--- /dev/null
+++ b/eo/contrib/irace/expe/beta/parseF_irace_bests.py
@@ -0,0 +1,35 @@
+#!/usr/bin/env python3
+#parse data1
+import os
+import re
+import sys
+#print("pb,ecdf,id,crossover-rate,cross-selector,crossover,mutation-rate,mut-selector,mutation,replacement") #plan1
+print("pb,ecdf,id,crossover-rate,cross-selector,crossover,mutation-rate,mut-selector,mutation,replacement,pop-size,offspring-size")
+
+
+#give the path of one experiment
+argv=sys.argv[1]
+for datadir in os.listdir(argv):
+ #if(os.path.isdir(os.path.join(argv,datadir))): check if argv/datadir is a directory
+ if(datadir.find("results_irace")>=0): #check if the directory is one JOB
+ for pb_dir in os.listdir(os.path.join(argv,datadir)):
+ if "results_problem" in pb_dir:
+ pb_id=pb_dir.replace("results_problem_","")
+ with open(os.path.join("./",argv,datadir,pb_dir,"irace.log")) as fd:
+ data = fd.readlines()
+
+ # Find the last best configuration
+ bests = [line.strip() for line in data if "Best-so-far" in line]
+ #print(datadir,bests)
+ best = bests[-1].split()
+ best_id, best_perf = best[2], best[5]
+ # print(best_id,best_perf)
+
+ # Filter the config detail
+ configs = [line.strip() for line in data if "--crossover-rate=" in line and best_id in line]
+ # print(configs)
+
+ # Format as CSV
+ algo = re.sub("\-\-\S*=", ",", configs[0])
+ csv_line = pb_id + "," + best_perf + "," + algo
+ print(csv_line.replace(" ",""))
diff --git a/eo/contrib/irace/expe/beta/parseO_irace_bests.py b/eo/contrib/irace/expe/beta/parseO_irace_bests.py
new file mode 100755
index 000000000..c1811acdf
--- /dev/null
+++ b/eo/contrib/irace/expe/beta/parseO_irace_bests.py
@@ -0,0 +1,35 @@
+#!/usr/bin/env python3
+#parse data1
+import os
+import re
+import sys
+#print("pb,ecdf,id,crossover-rate,cross-selector,crossover,mutation-rate,mut-selector,mutation,replacement") #plan1
+print("pb,ecdf,id,crossover-rate,cross-selector,crossover,mutation-rate,mut-selector,mutation,replacement")
+
+
+#give the path of one experiment
+argv=sys.argv[1]
+for datadir in os.listdir(argv):
+ #if(os.path.isdir(os.path.join(argv,datadir))): check if argv/datadir is a directory
+ if(datadir.find("results_irace")>=0): #check if the directory is one JOB
+ for pb_dir in os.listdir(os.path.join(argv,datadir)):
+ if "results_problem" in pb_dir:
+ pb_id=pb_dir.replace("results_problem_","")
+ with open(os.path.join("./",argv,datadir,pb_dir,"irace.log")) as fd:
+ data = fd.readlines()
+
+ # Find the last best configuration
+ bests = [line.strip() for line in data if "Best-so-far" in line]
+ #print(datadir,bests)
+ best = bests[-1].split()
+ best_id, best_perf = best[2], best[5]
+ # print(best_id,best_perf)
+
+ # Filter the config detail
+ configs = [line.strip() for line in data if "--crossover-rate=" in line and best_id in line]
+ # print(configs)
+
+ # Format as CSV
+ algo = re.sub("\-\-\S*=", ",", configs[0])
+ csv_line = pb_id + "," + best_perf + "," + algo
+ print(csv_line.replace(" ",""))
diff --git a/eo/contrib/irace/expe/beta/parse_auc_average.py b/eo/contrib/irace/expe/beta/parse_auc_average.py
new file mode 100755
index 000000000..b2d20dbd3
--- /dev/null
+++ b/eo/contrib/irace/expe/beta/parse_auc_average.py
@@ -0,0 +1,34 @@
+#!/usr/bin/env python3
+import sys
+import os
+import numpy as np
+import matplotlib.pyplot as plt
+
+#get the auc average values of one experiment
+figdir=sys.argv[1] # directory of a result of one experiment
+#eg : ./fastga_results_all/fastga_results_planO/planO_maxExp\=100000_maxEv\=5n_2021-08-13T19\:04+02\:00_results_elites_all/raw
+
+if("fastga_results_plan" in figdir):
+ print("FID,",",".join(map(str,range(1,16))))
+ aucs=[[] for i in range(19)]
+ for fastgadir in os.listdir(os.path.join(figdir,"raw/data")): #fastgadir : directory of 50 runs of an elite configuration
+ #cum=np.cumsum([0.1]*10)
+ average=[]
+ for fname in os.listdir(os.path.join(figdir,"raw/data",fastgadir)):
+ with open(os.path.join(figdir,"raw/data",fastgadir,fname)) as fd:
+ auc = float(fd.readlines()[0]) * -1
+ average.append(auc)
+ aucs[int(fastgadir.split("_")[0].split("=")[1])].append(average)
+ #print(np.shape(aucs))
+
+
+
+ for i in range(19):
+ print(str(i)+",",",".join(map(str,np.mean(aucs[i],1))))
+
+
+
+
+
+
+
diff --git a/eo/contrib/irace/expe/beta/planA/r_iA.sh b/eo/contrib/irace/expe/beta/planA/r_iA.sh
new file mode 100755
index 000000000..b9ca24be8
--- /dev/null
+++ b/eo/contrib/irace/expe/beta/planA/r_iA.sh
@@ -0,0 +1,34 @@
+#!/bin/bash
+#run once each problem
+
+echo "-------------------------Start the JOB : $(date --iso-8601=seconds)"
+. /etc/profile.d/modules.sh
+export MODULEPATH=${MODULEPATH}${MODULEPATH:+:}/opt/dev/Modules/Anaconda:/opt/dev/Modules/Compilers:/opt/dev/Modules/Frameworks:/opt/dev/Modules/Libraries:/opt/dev/Modules/Tools:/opt/dev/Modules/IDEs:/opt/dev/Modules/MPI
+module load LLVM/clang-llvm-10.0
+module load R
+
+dir=$1
+run=$2
+budget_irace=$3
+buckets=$4
+myhome=$5
+cp -r ${myhome}/R .
+cp -r ${myhome}/irace_files_pA .
+#cp -r /scratchbeta/zhenga/irace_files .
+#chmod u+x ./fastga
+outdir="${run}_$(date --iso-8601=seconds)_results_irace"
+rundir=${dir}/${outdir}
+mkdir -p ${rundir}
+# Fore some reason, irace absolutely need those files...
+cp ${myhome}/code/paradiseo/eo/contrib/irace/release/fastga ${rundir}
+cat ./irace_files_pA/example.scen | sed "s%\".%\"${rundir}%g" | sed "s/maxExperiments = 0/maxExperiments=${budget_irace}/" > ${rundir}/example.scen
+cp ./irace_files_pA/default.instances ${rundir}
+cp ./irace_files_pA/fastga.param ${rundir}
+cp ./irace_files_pA/forbidden.txt ${rundir}
+cat ./irace_files_pA/target-runner | sed "s/buckets=0/buckets=${buckets}/" > ${rundir}/target-runner
+chmod u+x ${rundir}/target-runner
+
+echo "---start $(date)"
+time -p ./R/x86_64-pc-linux-gnu-library/3.6/irace/bin/irace --scenario ${rundir}/example.scen > ${rundir}/irace.log
+echo "---end $(date)"
+echo "End the JOB : $(date --iso-8601=seconds)------------------------------"
diff --git a/eo/contrib/irace/expe/beta/planA/riaA.sh b/eo/contrib/irace/expe/beta/planA/riaA.sh
new file mode 100755
index 000000000..0653a3358
--- /dev/null
+++ b/eo/contrib/irace/expe/beta/planA/riaA.sh
@@ -0,0 +1,25 @@
+#!/bin/bashi
+myhome=$1
+scratchpath=$2
+mexp=$3
+mevals=$4
+date -Iseconds
+echo "STARTS"
+dir=${scratchpath}/dataFAR/dataA
+#dir=${HOME}/plan4/${name}
+#cat ${HOME}/irace_files_pA/example.scen |sed "s/maxExperiments = 0/maxExperiments = ${mexp}/" > ${HOME}/irace_files_pA/example.scen
+
+mkdir -p ${dir}
+outdir="${dir}/dataA_maxExp=${mexp}_maxEv=${mevals}_$(date --iso-8601=seconds)"
+mkdir -p ${outdir}
+for r in $(seq 2); do
+ echo "Run $r/15";
+ cmd="qsub -N iraceA_maxEv_${r} -q beta -l select=1:ncpus=1 -l walltime=00:25:00 -- ${scratchpath}/planA/r_iA.sh ${outdir} ${r} ${mexp} ${mevals} ${myhome}"
+ #cmd="bash ./r_iA_buckets.sh ${outdir} ${r} ${mexp} ${mevals}"
+ echo $cmd
+ time -p $cmd
+done
+echo "DONE"
+#cat ${HOME}/irace_files_pA/example.scen |sed "s/maxExperiments = ${mexp}/maxExperiments = 0/" > ${HOME}/irace_files_pA/example.scen
+date -Iseconds
+
diff --git a/eo/contrib/irace/expe/beta/planF/r_iF.sh b/eo/contrib/irace/expe/beta/planF/r_iF.sh
new file mode 100755
index 000000000..fb9246746
--- /dev/null
+++ b/eo/contrib/irace/expe/beta/planF/r_iF.sh
@@ -0,0 +1,37 @@
+#!/bin/bash
+#run once each problem
+dir=$1
+run=$2
+budget_irace=$3
+buckets=$4
+myhome=$5
+
+echo "---------------start JOB ${run} $(date --iso-8601=seconds)"
+. /etc/profile.d/modules.sh
+export MODULEPATH=${MODULEPATH}${MODULEPATH:+:}/opt/dev/Modules/Anaconda:/opt/dev/Modules/Compilers:/opt/dev/Modules/Frameworks:/opt/dev/Modules/Libraries:/opt/dev/Modules/Tools:/opt/dev/Modules/IDEs:/opt/dev/Modules/MPI
+module load LLVM/clang-llvm-10.0
+module load R
+
+cp -r ${myhome}/R .
+cp -r ${myhome}/irace_files_pF .
+#cp -r /scratchbeta/zhenga/irace_files .
+#chmod u+x ./fastga
+outdir="${run}_$(date --iso-8601=seconds)_results_irace"
+for pb in $(seq 0 18) ; do
+ echo "Problem ${pb}... "
+ res="results_problem_${pb}"
+ mkdir -p ${dir}/${outdir}/${res}
+ # Fore some reason, irace absolutely need those files...
+ cp ${myhome}/code/paradiseo/eo/contrib/irace/release/fastga ${dir}/${outdir}/${res}
+ cat ./irace_files_pF/example.scen | sed "s%\".%\"${dir}/${outdir}/${res}%g" | sed "s/maxExperiments = 0/maxExperiments=${budget_irace}/" > ${dir}/${outdir}/${res}/example.scen
+ cp ./irace_files_pF/default.instances ${dir}/${outdir}/${res}
+ cp ./irace_files_pF/fastga.param ${dir}/${outdir}/${res}
+ cp ./irace_files_pF/forbidden.txt ${dir}/${outdir}/${res}
+ cat ./irace_files_pF/target-runner | sed "s/--problem=0/--problem=${p}/" | sed "s/buckets=0/buckets=${buckets}/" > ${dir}/${outdir}/${res}/target-runner
+ chmod u+x ${dir}/${outdir}/${res}/target-runner
+
+ echo "---start $(date)"
+ time -p ./R/x86_64-pc-linux-gnu-library/3.6/irace/bin/irace --scenario ${dir}/${outdir}/${res}/example.scen > ${dir}/${outdir}/${res}/irace.log
+ echo "---end $(date)"
+done
+echo "end JOB ${run} $(date --iso-8601=seconds)---------------"
diff --git a/eo/contrib/irace/expe/beta/planF/riaF.sh b/eo/contrib/irace/expe/beta/planF/riaF.sh
new file mode 100755
index 000000000..e400f152a
--- /dev/null
+++ b/eo/contrib/irace/expe/beta/planF/riaF.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+date -Iseconds
+echo "STARTS"
+myhome=$1
+scratchpath=$2
+#dir=${HOME}/plan2/${name}
+mexp=$3 #budget irace
+mevals=$4 #budget fastga
+name="dataF_maxExp=${mexp}_maxEv=${mevals}_$(date --iso-8601=seconds)"
+dir=${scratchpath}/dataFAR/dataF/${name}
+mkdir -p ${dir}
+
+for r in $(seq 2); do
+ echo "Run $r/15";
+ #date -Iseconds
+ #cmd="qsub -N irace_${runs}_${buckets}" -q beta -l select=1:ncpus=1 -l walltime=00:04:00 --${HOME}/run_irace.sh ${dir}
+ cmd="qsub -N iraceF_${mevals}_run=${r} -q beta -l select=1:ncpus=1 -l walltime=00:25:00 -- ${scratchpath}/planF/r_iF.sh ${dir} ${r} ${mexp} ${mevals} ${myhome}"
+ #time -p bash ${HOME}/plan2/run_irace2.sh ${dir} ${r} &> ${dir}/erreur_${r}.txt
+ #bash ${HOME}/test/r_i.sh
+ echo $cmd
+ $cmd
+ #date -Iseconds
+done
+
+#echo "DONE"
+#date -Iseconds
+#echo $(pwd)
diff --git a/eo/contrib/irace/expe/beta/planO/r_iO.sh b/eo/contrib/irace/expe/beta/planO/r_iO.sh
new file mode 100755
index 000000000..b69a18941
--- /dev/null
+++ b/eo/contrib/irace/expe/beta/planO/r_iO.sh
@@ -0,0 +1,43 @@
+#!/bin/bash
+#run once each problem
+
+. /etc/profile.d/modules.sh
+export MODULEPATH=${MODULEPATH}${MODULEPATH:+:}/opt/dev/Modules/Anaconda:/opt/dev/Modules/Compilers:/opt/dev/Modules/Frameworks:/opt/dev/Modules/Libraries:/opt/dev/Modules/Tools:/opt/dev/Modules/IDEs:/opt/dev/Modules/MPI
+module load LLVM/clang-llvm-10.0
+module load R
+
+dir=$1
+run=$2
+budget_irace=$3
+buckets=$4
+myhome=$5
+
+cp -r ${myhome}/R .
+cp -r ${myhome}/irace_files_pO .
+
+outdir="${run}_$(date --iso-8601=seconds)_results_irace"
+echo "start a job $(date -Iseconds)"
+
+for pb in $(seq 0 18) ; do
+ echo "Problem ${pb}... "
+ res="results_problem_${pb}"
+ mkdir -p ${dir}/${outdir}/${res}
+ # Fore some reason, irace absolutely need those files...
+ cp ${myhome}/code/paradiseo/eo/contrib/irace/release/fastga ${dir}/${outdir}/${res}
+
+ cat ./irace_files_pO/example.scen | sed "s%\".%\"${dir}/${outdir}/${res}%g" | sed "s/maxExperiments = 0/maxExperiments=${budget_irace}/" > ${dir}/${outdir}/${res}/example.scen
+ cp ./irace_files_pO/default.instances ${dir}/${outdir}/${res}
+ cp ./irace_files_pO/fastga.param ${dir}/${outdir}/${res}
+ cat ./irace_files_pO/target-runner | sed "s/--problem=0/--problem=${pb}/" > ${dir}/${outdir}/${res}/target-runner
+ chmod u+x ${dir}/${outdir}/${res}/target-runner
+
+ echo "---start $(date)"
+ time -p ./R/x86_64-pc-linux-gnu-library/3.6/irace/bin/irace --scenario ${dir}/${outdir}/${res}/example.scen > ${dir}/${outdir}/${res}/irace.log
+ echo "---end $(date)"
+
+ echo "done run : ${run} pb : ${pb}"
+ date -Iseconds
+done
+
+echo "end a job $(date -Iseconds)---------------------"
+
diff --git a/eo/contrib/irace/expe/beta/planO/riaO.sh b/eo/contrib/irace/expe/beta/planO/riaO.sh
new file mode 100755
index 000000000..76e7d822e
--- /dev/null
+++ b/eo/contrib/irace/expe/beta/planO/riaO.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+date -Iseconds
+echo "STARTS"
+myhome=$1
+scratchpath=$2
+mexp=$3
+mevals=$4
+name="dataO_maxExp=${mexp}_maxEv=${mevals}_$(date --iso-8601=seconds)"
+dir=${scratchpath}/dataFAR/dataO/${name}
+mkdir -p ${dir}
+
+for r in $(seq 2); do
+ echo "Run $r/15";
+ cmd="qsub -N iraceO_maxExp=${exp}_maxEv=${evals}_${r} -q beta -l select=1:ncpus=1 -l walltime=00:10:00 -- ${scratchpath}/planO/r_iO.sh ${dir} ${r} ${mexp} ${mevals} ${myhome}"
+ echo $cmd
+ $cmd
+ #time (p=2; while [[ ${p} > 1 ]] ; do p=$(qqueue -u $USER | wc -l); echo "$r: $p"; sleep 300; done)
+done
+
+#echo "DONE"
+#date -Iseconds
+
diff --git a/eo/contrib/irace/expe/beta/readme.txt b/eo/contrib/irace/expe/beta/readme.txt
new file mode 100755
index 000000000..85e30d5af
--- /dev/null
+++ b/eo/contrib/irace/expe/beta/readme.txt
@@ -0,0 +1,167 @@
+############################################
+#Explanation of the experimental plans and the validation runs
+
+############################################
+1. INTRODUCTION
+
+The aim of all the scripts is to make the experimental plans for Algorithm Configuration for Genetic Algorithms by using a fully modular benchmarking pipeline design of this article https://arxiv.org/abs/2102.06435 .
+
+You can upload the data in : https://zenodo.org/record/5479538#.YTaT0Bnis2w
+
+Plan A is an experimental plan for finding an efficient algorithm for all the functions that we consider.
+
+Plan F is an experimental plan for finding an efficient algorithm for each function that we consider.
+
+Plan R is an experimental plan for getting random algorithms.
+
+Plan O is the reproduction of the experimental plan of the article.
+
+2. VOCABULARIES
+
+* maxExp : means maximum Experiments, the budget for irace
+* maxEv : means maximum evaluation, the budget for FastGA algorithms
+
+*dataFAR : directory which we store all the experiment data of Plan F and Plan A, created when you run run_exp.sh
+
+* dataA, dataF
+dataA is a directory which we store all the runs of an experiment plan for several budgets
+eg : /dataA/planA_maxExp=*_maxEv=**_$(data), * is a value of maxExp, and ** is a value of maxEv
+
+
+*fastga_results_all : directory which we store all the data for validation runs. It constains only 3 subdirectories (fastga_results_planF, fastga_results_planA, fastga_results_planO, fastga_results_random), created by running run_exp.sh
+
+* fastga_results_planF, fastga_results_planA, fastga_results_random, fastga_results_planO
+Each directory store the data for validation runs of each experiment plan.
+fastga_random directory are created by running run_exp.sh
+fastga_results_planF, fastag_results_planO and fastag_results_planA are created only after you have data in the dataA or dataF or dataO directories.
+
+
+* planA_*, planF_*, planO_*
+If the planA_* or planF_* or planO_* are in the dataFAR directory, the directory contains the data of experimental plan. This means that each plan contains the result of 15 runs of irace stored in irace.log file, and the data are provided by run_exp.sh.
+
+If the planA_* or planF_* or planO_* directories are in the fastga_results_planA or fastga_results_planF, these directories contain the data of 50 validation runs by running all the best algorithms of each plan stores in dataFAR. The data are provided by running run_res.sh
+
+
+*fastag_all_results : contains the directories of the validation run data.
+
+*fastga_results_planF, fastga_results_planA and fastga_results_random contain respectively the validation run data of Plan F, Plan A and Plan R.
+
+
+3. DESCRIPTION
+
+The directory which you load all the scripts contains :
+
+ * bash files :
+ -run_res.sh : submit to the cluster all the experiment plan, get all the data we need for the plan F, plan A and plan R.
+ -run_exp.sh : submit to the cluster for getting all the data for validation runs of each data A and data F provided by running run_res.sh
+ -run_random.sh : script for getting random algorithms and the data for validation runs for each problem
+ -testrandom.sh : change the budget fastga (maxEv) in this file if you need, by running this file, you submit plan R job in the cluster
+
+ -csv_all_bests.sh : script for getting all the best configurations of each plan in a dataF or a dataA directories
+
+ -run_elites_planA.sh : script for validation runs of plan A by giving a csv file of each best configuration. This file is provided by running parseA_irace_bests.py.
+ -run_elites_planB.sh
+ -fastga_elites_all.sh : run this file, by giving a directory csv_plan* of csv files ( must only contains the csv file of the same plan, eg : csv_planF) and a run_elites_plan*.sh (* is the name of the plan, eg run_elites_planF.sh), by running this file you get all the validation runs of each csv file. Each csv file contains the best configuration (you get these csv files by running csv_all_bests.sh)
+
+ * python files :
+ -parseA_irace_bests.py : for parsing the irace.log file of each data provided by running irace. By giving a bounch of directories of one experiment
+ -parseF_irace_bests.py : for the plan plan F and plan O(in the plan O csv, there are label offspringsize and popsize, but there are not values)
+
+ * 6 directories :
+ -irace_files_pA :
+ -default.instances
+ -example.scen
+ -fastga.param
+ -forbidden.txt
+ -target-runner
+
+ -irace_files_pF :
+ -default.instances :
+ -example.scen
+ -fastga.param
+ -forbidden.txt
+ -target-runner
+
+ -irace_files_pO :
+ -default.instances :
+ -example.scen
+ -fastga.param
+ -target-runner
+
+ -planA :
+ -riaA.sh : for running 15 times r_iA.sh file by submitting to the mesu cluster
+ -r_iA.sh : for running irace for all the problems
+
+ -planF :
+ -riaF.sh : for running 15 times r_iF.sh file by submitting to the mesu cluster
+ -r_iF.sh : for running irace for each problem we considered
+ -planO :
+ -riaO.sh : for running 15 times r_iO.sh file by submitting to the mesu cluster
+ -r_iO.sh : for running irace for each problem we considered
+
+
+The directories planA, planF contain the scripts to run one experiment of Plan A and Plan F.
+
+The directories irace_files_pA, irace_files_pO and irace_files_pF contain the scripts needing for calling irace for one experiment of Plan A, Plan O and Plan F. [Look at the irace package : User Guide for more information]
+
+
+5. CONCLUSION
+
+For getting all the experiment data and the validation run data run run_exp.sh file first, after run_exp.sh file finished to execute and there is all the data in the dataFAR (ie : in the cluster, all the jobs finished to execute) run_res.sh data.
+
+Warning : run_exp.sh may take few days or few weeks depending on the Budget you ask, do not run_res.sh if in dataFAR there are data which are not finished to execute in the cluster, or jobs killed. Do not forget to remove directories of plan which are not complete.
+
+
+
+
+############################################
+#Scripts for getting histograms and csv files of validation runs results.
+
+############################################
+
+get histograms or csv files for random data :
+-hist_join_random.py : get one histogram for a plan by budget
+-dist_op_random.py : get csv files of the distribution of operators by problems
+
+get histograms or csv files for plan O,F,A :
+-hist_join.py
+-dist_op_all.py
+-parse_auc_average # get the mean auc value of each problem and each irace run
+
+get histograms for plan F, A , R, O
+-hist_by_pb_budget_plan.py : get histograms by problem
+-hist_by_FARO_pb.py :
+-hist_by_FARO.py
+-best_out_of_elites.py : get the best algorithm found among 15 runs of irace, for a plan
+
+
+files to call all these files :
+-csv_all.sh : get all the csv files (average of auc, best out ..), call best_out_of_elites.py, parse_auc_average.py, dist_op_*.py
+-hist_all.sh : get all the histograms, call each hist_*.py file
+
+file for other goal :
+-mwtestU.py ; csv file for selected problems which irace algorithms gave better performances than random algorithms
+-rep_std_mean_selected.py : to get the std, mean and the distribution of operators of the selected problems
+
+
+
+
+
+############################################
+#Summary
+
+############################################
+
+Get the experiment data :
+run : bash run_exp.sh
+
+-----------Only after you have the experiment data:
+Get the validation run data :
+run : bash run_res.sh
+
+Get histograms :
+run : bash hist_all.sh
+
+Get csv files of validation run data :
+run : bash csv_all.sh
+
diff --git a/eo/contrib/irace/expe/beta/rep_std_mean_selected.py b/eo/contrib/irace/expe/beta/rep_std_mean_selected.py
new file mode 100755
index 000000000..1add3e9ab
--- /dev/null
+++ b/eo/contrib/irace/expe/beta/rep_std_mean_selected.py
@@ -0,0 +1,55 @@
+#!/usr/bin/env python3
+import sys
+import os
+import numpy as np
+import matplotlib.pyplot as plt
+import pandas
+
+#eg : python3 ./rep_std_mean_selected.py ./hist_and_csv/distribution_op_fastga_results_planF
+#get the std of the selected problem
+path=sys.argv[1] # directory of each distribution by pb
+lpb={13,14,15,16,18} #set of pb selected
+#column : [operator : nbpossibilities]
+distdir=path+"/rep_std_mean"
+try:
+ os.makedirs(distdir)
+except FileExistsError:
+ pass
+
+res=[]
+for csvfile in os.listdir(os.path.join(path)):
+ if(int(csvfile.split("_")[1].split("=")[1]) in lpb):
+ print(csvfile)
+ res.append(pandas.read_csv(os.path.join(path,csvfile)))
+
+#assert(len(res[0])==len(res[1]) , "each csv file does not have the same line " #check if the number of param is eq in each csv file
+
+
+name ="std_rep_pb={}".format(str(lpb))+"".join(map(str,path.split("/")[-3].split("_")[:3]))+".csv"
+with open(os.path.join(distdir,name),'w+') as fd:
+ fd.write("Op index, "+",".join(map(str,range(0,11)))+"\n")
+globalname="rep_all_pb={}".format(str(lpb))+"".join(map(str,path.split("/")[-3].split("_")[:3]))+".csv"
+with open(os.path.join(distdir,globalname),'w+') as fd:
+ fd.write("Op index, "+",".join(map(str,range(0,11)))+"\n")
+meanname="mean_rep_pb={}".format(str(lpb))+"".join(map(str,path.split("/")[-3].split("_")[:3]))+".csv"
+with open(os.path.join(distdir,meanname),'w+') as fd:
+ fd.write("Op index, "+",".join(map(str,range(0,11)))+"\n")
+#print(res)
+limparam=[10,7,10,10,7,11,11,10,10]
+for i in range(1,10): #9 nb parameters
+ npval=np.zeros((len(res),limparam[i-1]),dtype=int)
+ for pb in range(len(res)):
+ print(i,np.array(np.array(res[pb][i-1:i])[0]),np.array(np.array(res[pb][i-1:i])[0][1:limparam[i-1]+1]))
+ npval[pb,:]=np.array(np.array(res[pb][i-1:i])[0][1:limparam[i-1]+1],dtype=int)
+ nameparam=np.array(res[pb][i-1:i])[0][0]
+ line= ",".join(map(str,np.std(npval,0)))+",-"*(11-limparam[i-1])
+ print("ligne ",line)
+
+ with open(os.path.join(distdir,name),'a') as fd:
+ fd.write(nameparam+","+line+"\n")
+ line= ",".join(map(str,np.sum(npval,0)))+",-"*(11-limparam[i-1])
+ with open(os.path.join(distdir,globalname),'a') as fd:
+ fd.write(nameparam+","+line+"\n")
+ line= ",".join(map(str,np.mean(npval,0)))+",-"*(11-limparam[i-1])
+ with open(os.path.join(distdir,meanname),'a') as fd:
+ fd.write(nameparam+","+line+"\n")
\ No newline at end of file
diff --git a/eo/contrib/irace/expe/beta/run_elites_planA.sh b/eo/contrib/irace/expe/beta/run_elites_planA.sh
new file mode 100755
index 000000000..8cc3b146a
--- /dev/null
+++ b/eo/contrib/irace/expe/beta/run_elites_planA.sh
@@ -0,0 +1,61 @@
+#!/bin/bash
+#instance = seed
+echo "-----------------Start $(date)"
+. /etc/profile.d/modules.sh
+export MODULEPATH=${MODULEPATH}${MODULEPATH:+:}/opt/dev/Modules/Anaconda:/opt/dev/Modules/Compilers:/opt/dev/Modules/Frameworks:/opt/dev/Modules/Libraries:/opt/dev/Modules/Tools:/opt/dev/Modules/IDEs:/opt/dev/Modules/MPI
+module load LLVM/clang-llvm-10.0
+
+csv_file=$1 #contains all the configs of all the problems of one experiments
+mexp=$2
+mevals=$3
+path=$4
+# Number of runs (=seeds).
+runs=50
+
+# You most probably want to run on release builds.
+exe="/home/zhenga/fastga"
+plan=$(echo ${csv_file} | sed "s/results_irace_plan//")
+outdir="${path}/plan4_maxExp=${mexp}_maxEv=${mevals}_$(date --iso-8601=minutes)_results_elites_all"
+mkdir -p ${outdir}
+mkdir -p ${outdir}/raw
+mkdir -p ${outdir}/raw/data
+mkdir -p ${outdir}/raw/logs
+
+n=0
+algoid=0
+for line in $(cat ${csv_file}| sed 1,1d | cut -s -d"," -f3-11 ); do
+ a=($(echo $line | sed "s/,/ /g"))
+ algo="--crossover-rate=${a[0]} --cross-selector=${a[1]} --crossover=${a[2]} --mutation-rate=${a[3]} --mut-selector=${a[4]} --mutation=${a[5]} --replacement=${a[6]} --pop-size=${a[7]} --offspring-size=${a[8]}"
+
+ #perc=$(echo "scale=3;${n}/(285)*100.0" | bc)
+ #echo "${perc}% : algo ${algoid}/285"
+ # echo -n "Runs: "
+ for pb in $(seq 0 18) ; do
+ name_dir="pb=${pb}_$(echo "${algo}" | sed 's/--//g' | sed 's/ /_/g')"
+ mkdir -p ${outdir}/raw/data/${name_dir}
+ mkdir -p ${outdir}/raw/logs/${name_dir}
+ for seed in $(seq ${runs}) ; do # Iterates over runs/seeds.
+ # This is the command to be ran.
+ #cmd="${exe} --full-log=1 --problem=${pb} --seed=${seed} ${algo}"
+ cmd="${exe} --problem=${pb} --seed=${seed} --instance=${seed} ${algo}"
+ #echo ${cmd} # Print the command.
+ # Forge a directory/log file name
+ # (remove double dashs and replace spaces with underscore).
+ name_run="pb=${pb}_seed=${seed}_$(echo "${algo}" | sed 's/--//g' | sed 's/ /_/g')"
+ # echo $name_run
+ # Actually start the command.
+
+ ${cmd} > "${outdir}/raw/data/${name_dir}/${name_run}.dat" 2> "${outdir}/raw/logs/${name_dir}/${name_run}.log"
+ # Check for the most common problem in the log file.
+ #cat "${outdir}/raw/logs/${name_run}.log" | grep "illogical performance"
+ done # seed
+ n=$(($n+1))
+ done
+ algoid=$(($algoid+1))
+done
+
+# Move IOH logs in the results directory.
+#mv ./FastGA_* ${outdir}
+
+echo "Done $(date) -----------------------"
+#date
diff --git a/eo/contrib/irace/expe/beta/run_elites_planF.sh b/eo/contrib/irace/expe/beta/run_elites_planF.sh
new file mode 100755
index 000000000..1c8b20a0a
--- /dev/null
+++ b/eo/contrib/irace/expe/beta/run_elites_planF.sh
@@ -0,0 +1,59 @@
+#!/bin/bash
+#instance = seed
+echo "-----------------Start $(date)"
+. /etc/profile.d/modules.sh
+export MODULEPATH=${MODULEPATH}${MODULEPATH:+:}/opt/dev/Modules/Anaconda:/opt/dev/Modules/Compilers:/opt/dev/Modules/Frameworks:/opt/dev/Modules/Libraries:/opt/dev/Modules/Tools:/opt/dev/Modules/IDEs:/opt/dev/Modules/MPI
+module load LLVM/clang-llvm-10.0
+
+csv_file=$1 #contains all the configs of all the problems of one experiments
+mexp=$2
+mevals=$3
+path=$4
+# Number of runs (=seeds).
+runs=50
+
+# You most probably want to run on release builds.
+exe="/home/${USER}/fastga"
+plan=$(echo ${csv_file} | cut -d / -f3 | sed "s/results_irace_plan//")
+outdir="${path}/plan${plan[@]:0:1}_maxExp=${mexp}_maxEv=${mevals}_$(date --iso-8601=minutes)_results_elites_all"
+mkdir -p ${outdir}
+mkdir -p ${outdir}/raw
+mkdir -p ${outdir}/raw/data
+mkdir -p ${outdir}/raw/logs
+
+n=0
+algoid=0
+for line in $(cat ${csv_file}| sed 1,1d ); do
+ a=($(echo $line | sed "s/,/ /g"))
+ algo="--crossover-rate=${a[3]} --cross-selector=${a[4]} --crossover=${a[5]} --mutation-rate=${a[6]} --mut-selector=${a[7]} --mutation=${a[8]} --replacement=${a[9]} --pop-size=${a[10]} --offspring-size=${a[11]}"
+
+ #perc=$(echo "scale=3;${n}/(285)*100.0" | bc)
+ #echo "${perc}% : algo ${algoid}/285"
+ # echo -n "Runs: "
+ name_dir="pb=${a[0]}_$(echo "${algo}" | sed 's/--//g' | sed 's/ /_/g')"
+ mkdir -p ${outdir}/raw/logs/${name_dir}
+ mkdir -p ${outdir}/raw/data/${name_dir}
+ for seed in $(seq ${runs}) ; do # Iterates over runs/seeds.
+ # This is the command to be ran.
+ #cmd="${exe} --full-log=1 --problem=${pb} --seed=${seed} ${algo}"
+ cmd="${exe} --problem=${a[0]} --seed=${seed} --instance=${seed} ${algo}"
+ #echo ${cmd} # Print the command.
+ # Forge a directory/log file name
+ # (remove double dashs and replace spaces with underscore).
+ name_run="pb=${a[0]}_seed=${seed}_$(echo "${algo}" | sed 's/--//g' | sed 's/ /_/g')"
+ # echo $name_run
+ # Actually start the command.
+ ${cmd} > "${outdir}/raw/data/${name_dir}/${name_run}.dat" 2> "${outdir}/raw/logs/${name_dir}/${name_run}.log"
+ # Check for the most common problem in the log file.
+ #cat "${outdir}/raw/logs/${name_run}.log" | grep "illogical performance"
+ done # seed
+
+ n=$(($n+1))
+ algoid=$(($algoid+1))
+done
+
+# Move IOH logs in the results directory.
+#mv ./FastGA_* ${outdir}
+
+echo "Done $(date) -----------------------"
+#date
diff --git a/eo/contrib/irace/expe/beta/run_elites_planO.sh b/eo/contrib/irace/expe/beta/run_elites_planO.sh
new file mode 100755
index 000000000..8f93293c4
--- /dev/null
+++ b/eo/contrib/irace/expe/beta/run_elites_planO.sh
@@ -0,0 +1,64 @@
+#!/bin/bash
+#instance = seed
+
+. /etc/profile.d/modules.sh
+export MODULEPATH=${MODULEPATH}${MODULEPATH:+:}/opt/dev/Modules/Anaconda:/opt/dev/Modules/Compilers:/opt/dev/Modules/Frameworks:/opt/dev/Modules/Libraries:/opt/dev/Modules/Tools:/opt/dev/Modules/IDEs:/opt/dev/Modules/MPI
+module load LLVM/clang-llvm-10.0
+
+
+
+
+csv_file=$1 #contains all the configs of all the problems of one experiments
+mexp=$2
+mevals=$3
+path=$4
+
+echo "-----------------Start $(date -Iseconds) "
+# Number of runs (=seeds).
+runs=50
+
+# You most probably want to run on release builds.
+exe="/home/${USER}/fastga"
+
+outdir="${path}/planO_maxExp=${mexp}_maxEv=${mevals}_$(date --iso-8601=minutes)_results_elites_all"
+mkdir -p ${outdir}
+mkdir -p ${outdir}/raw
+mkdir -p ${outdir}/raw/data
+mkdir -p ${outdir}/raw/logs
+
+n=0
+algoid=0
+for line in $(cat ${csv_file}| sed 1,1d ); do
+ a=($(echo $line | sed "s/,/ /g"))
+ algo="--crossover-rate=${a[3]} --cross-selector=${a[4]} --crossover=${a[5]} --mutation-rate=${a[6]} --mut-selector=${a[7]} --mutation=${a[8]} --replacement=${a[9]}"
+
+ #perc=$(echo "scale=3;${n}/(285)*100.0" | bc)
+ #echo "${perc}% : algo ${algoid}/285"
+ # echo -n "Runs: "
+ name_dir="pb=${a[0]}_$(echo "${algo}" | sed 's/--//g' | sed 's/ /_/g')"
+ mkdir -p ${outdir}/raw/data/${name_dir}
+ mkdir -p ${outdir}/raw/logs/${name_dir}
+ for seed in $(seq ${runs}) ; do # Iterates over runs/seeds.
+ # This is the command to be ran.
+ #cmd="${exe} --full-log=1 --problem=${pb} --seed=${seed} ${algo}"
+ cmd="${exe} --problem=${a[0]} --seed=${seed} --instance=${seed} ${algo}"
+ #echo ${cmd} # Print the command.
+ # Forge a directory/log file name
+ # (remove double dashs and replace spaces with underscore).
+ name_run="pb=${a[0]}_seed=${seed}_$(echo "${algo}" | sed 's/--//g' | sed 's/ /_/g')"
+ # echo $name_run
+ # Actually start the command.
+ ${cmd} > "${outdir}/raw/data/${name_dir}/${name_run}.dat" 2> "${outdir}/raw/logs/${name_dir}/${name_run}.log"
+ # Check for the most common problem in the log file.
+ #cat "${outdir}/raw/logs/${name_run}.log" | grep "illogical performance"
+ done # seed
+
+ n=$(($n+1))
+ algoid=$(($algoid+1))
+done
+
+# Move IOH logs in the results directory.
+#mv ./FastGA_* ${outdir}
+
+echo "Done $(date) -----------------------"
+date
diff --git a/eo/contrib/irace/expe/beta/run_exp.sh b/eo/contrib/irace/expe/beta/run_exp.sh
new file mode 100644
index 000000000..44630176c
--- /dev/null
+++ b/eo/contrib/irace/expe/beta/run_exp.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+lexp=(300 600)
+levals=(100 500)
+myscratchpath=/scratchbeta/$USER
+myhome=${HOME}
+for exp in ${lexp[@]} ; do
+ for evals in ${levals[@]} ; do
+ bash ./planF/riaF.sh ${myhome} ${myscratchpath} ${exp} ${evals}
+ bash ./planO/riaO.sh ${myhome} ${myscratchpath} ${exp} ${evals}
+ bash ./planA/riaA.sh ${myhome} ${myscratchpath} ${exp} ${evals}
+ done
+done
+bash testrandom.sh ${myhome} ${scratchpath} ${levals[@]}
diff --git a/eo/contrib/irace/expe/beta/run_random.sh b/eo/contrib/irace/expe/beta/run_random.sh
new file mode 100755
index 000000000..f509e4f3a
--- /dev/null
+++ b/eo/contrib/irace/expe/beta/run_random.sh
@@ -0,0 +1,67 @@
+#!/bin/bash
+# Number of runs (=seeds).
+runs=5
+basename=$1
+mevals=$2
+nbAlgo=2
+echo "Start JOB maxEv= $mevals $(date -Iseconds) ----------------------"
+. /etc/profile.d/modules.sh
+export MODULEPATH=${MODULEPATH}${MODULEPATH:+:}/opt/dev/Modules/Anaconda:/opt/dev/Modules/Compilers:/opt/dev/Modules/Frameworks:/opt/dev/Modules/Libraries:/opt/dev/Modules/Tools:/opt/dev/Modules/IDEs:/opt/dev/Modules/MPI
+module load LLVM/clang-llvm-10.0
+cp ${HOME}/code/paradiseo/eo/contrib/irace/release/fastga .
+# You most probably want to run on release builds.
+exe="./fastga"
+
+#outdir="/scratchbeta/$USER/$(date --iso-8601=minutes)_results_randoms"
+outdir="${basename}/maxEv=${mevals}_nbAlgo=${nbAlgo}_$(date --iso-8601=minutes)_results_randoms"
+mkdir -p ${outdir}
+n=1
+algoid=0
+for algoid in $(seq ${nbAlgo}); do
+ #date
+ r1=$(echo "scale=2 ; ${RANDOM}/32767" | bc)
+ r2=$(echo "scale=2 ; ${RANDOM}/32767" | bc)
+ a=(${r1} $((RANDOM%7)) $((RANDOM%10)) ${r2} $((RANDOM%7)) $((RANDOM%11)) $((RANDOM%11)) $((RANDOM%50 +1)) $((RANDOM%50 +1)) )
+ #condition for value of replacement, pop-size and offspringsize
+ while [[ (1 -lt ${a[6]} && ${a[7]} -lt ${a[8]}) || ( ${a[6]} -eq 1 && ${a[7]} -ne ${a[8]}) ]]
+ do
+ #echo "get in ------------------replacement ${a[6]} popsize ${a[7]} offspringsize ${a[8]}"
+ r1=$(echo "scale=2 ; ${RANDOM}/32767" | bc)
+ r2=$(echo "scale=2 ; ${RANDOM}/32767" | bc)
+ a=(${r1} $((RANDOM%7)) $((RANDOM%10)) ${r2} $((RANDOM%7)) $((RANDOM%11)) $((RANDOM%11)) $((RANDOM%50 +1)) $((RANDOM%50 +1)))
+ done
+ algo="--crossover-rate=${a[0]} --cross-selector=${a[1]} --crossover=${a[2]} --mutation-rate=${a[3]} --mut-selector=${a[4]} --mutation=${a[5]} --replacement=${a[6]} --pop-size=${a[7]} --offspring-size=${a[8]}"
+ echo " start algo ${a}------ $(date --iso-8601=minutes)"
+ algodir="$(echo "${algo}" | sed 's/--//g' | sed 's/ /_/g')"
+ for pb in $(seq 0 18) ; do
+ perc=$(echo "scale=3;${n}/(10*18)*10.0" | bc)
+ #echo "${perc}% : algo ${algoid}/100, problem ${pb}/18 $(date --iso-8601=minutes)"
+ # echo -n "Runs: "
+ name_dir="pb=${pb}_$(echo "${algo}" | sed 's/--//g' | sed 's/ /_/g')"
+
+ mkdir -p ${outdir}/${algodir}/data/${name_dir}
+ mkdir -p ${outdir}/${algodir}/logs/${name_dir}
+
+ for seed in $(seq ${runs}) ; do # Iterates over runs/seeds.
+ # This is the command to be ran.
+ cmd="${exe} --problem=${pb} --seed=${seed} --instance=${seed} ${algo} --max-evals=${mevals}"
+ name_run="pb=${pb}_seed=${seed}_$(echo "${algo}" | sed 's/--//g' | sed 's/ /_/g')"
+ # echo $name_run
+ #echo $algo
+
+ ${cmd} > ${outdir}/${algodir}/data/${name_dir}/${name_run}.dat 2> ${outdir}/${algodir}/logs/${name_dir}/${name_run}.log
+ # Check for the most common problem in the log file.
+ #cat "${outdir}/raw/logs/${name_run}.log" | grep "illogical performance"
+ done # seed
+ # echo ""
+
+ n=$(($n+1))
+ done # pb
+ echo "end algo $(date -Iseconds) "
+ algoid=$(($algoid+1))
+done
+
+
+
+echo "------------------------------------Done $mevals $(date -Iseconds) "
+
diff --git a/eo/contrib/irace/expe/beta/run_res.sh b/eo/contrib/irace/expe/beta/run_res.sh
new file mode 100644
index 000000000..b3579863a
--- /dev/null
+++ b/eo/contrib/irace/expe/beta/run_res.sh
@@ -0,0 +1,26 @@
+#!/bin/bash
+
+#get csv file, parse dataF in a csv file
+dir=/scratchbeta/$USER/dataFAR
+listdir=$(echo $(ls ${dir}))
+
+for data in ${listdir[@]} ; do
+ file_py="parse${data: -1}_irace_bests.py"
+ path="${dir}/${data}"
+ cmd="bash ./csv_all_bests.sh ${path} ${file_py}"
+ echo $cmd
+ $cmd
+done
+
+#get validation run of each config
+
+dir=/scratchbeta/$USER/csv_FAO
+listdir=$(echo $(ls ${dir}))
+echo ${listdir[@]}
+for csvdir in ${listdir[@]} ; do
+ csvpath="${dir}/${csvdir}"
+ file_py="./run_elites_plan${csvdir: -1}.sh"
+ cmd="bash ./fastga_elites_all.sh ${csvpath} ${file_py}"
+ echo $cmd
+ $cmd
+done
diff --git a/eo/contrib/irace/expe/beta/testrandom.sh b/eo/contrib/irace/expe/beta/testrandom.sh
new file mode 100644
index 000000000..5c6880594
--- /dev/null
+++ b/eo/contrib/irace/expe/beta/testrandom.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+#tab=(15000 20000 30000 40000)
+#tab=(100 500 1000 1500 2000 2500 3000 3500 4000 4500 5000 10000)
+myhome=$1
+scratchpath=$2
+tab=${@:3}
+#echo ${tab[@]}
+outdir="/scratchbeta/$USER/fastga_results_all/fastga_results_random"
+mkdir -p ${outdir} #results of random experiment
+for evals in ${tab[@]}; do
+ #evalsdir="${name}/maxEv=${evals}"
+ #mkdir -p ${evalsdir}
+ #{ time -p bash /home/$USER/run_random.sh ${name} ${i} 50 ; } &> "${name}/sortie5_${j}_maxExp=${i}.txt"
+ #cmd="qsub -N iraceR_maxEv=${evals} -q beta -l select=1:ncpus=1 -l walltime=00:30:00 -- /scratchbeta/$USER/run_random.sh ${outdir} ${evals}"
+ $cmd
+
+done
diff --git a/eo/contrib/irace/expe/gamma/irace-config/target-runner.py b/eo/contrib/irace/expe/gamma/irace-config/target-runner.py
new file mode 100755
index 000000000..91db92b71
--- /dev/null
+++ b/eo/contrib/irace/expe/gamma/irace-config/target-runner.py
@@ -0,0 +1,119 @@
+#!/usr/bin/python
+###############################################################################
+# This script is the command that is executed every run.
+# Check the examples in examples/
+#
+# This script is run in the execution directory (execDir, --exec-dir).
+#
+# PARAMETERS:
+# argv[1] is the candidate configuration ID
+# argv[2] is the instance ID
+# argv[3] is the seed
+# argv[4] is the instance name
+# The rest (argv[5:]) are parameters to the run
+#
+# RETURN VALUE:
+# This script should print one numerical value: the cost that must be minimized.
+# Exit with 0 if no error, with 1 in case of error
+###############################################################################
+
+import datetime
+import os.path
+import re
+import subprocess
+import sys
+
+exe = "../../../../release/onlymutga"
+
+problem = 19
+pop_size = 1
+offspring_size = 100
+
+fixed_parameters = ["--problem", str(problem), "--crossover-rate", "0", "--mutation-rate", "1", "--pop-size", str(pop_size), " --offspring-size", str(offspring_size)]
+
+if __name__=='__main__':
+ if len(sys.argv) < 5:
+ print("\nUsage: ./target-runner.py \n")
+ sys.exit(1)
+
+# Get the parameters as command line arguments.
+configuration_id = sys.argv[1]
+instance_id = sys.argv[2]
+seed = sys.argv[3]
+instance = sys.argv[4]
+slices_prop = sys.argv[5:]
+#print(sys.argv)
+
+exe = os.path.expanduser(exe)
+
+cmd = [exe] + fixed_parameters + ["--instance", instance, "--seed", seed]
+
+residual_prob = 1
+cl_probs = []
+residual_size = 1
+cl_sizes = []
+
+values = ""
+sizes = ""
+for i in range(len(slices_prop)):
+ cl_probs.append(residual_prob * float(slices_prop[i]))
+ cl_sizes.append(residual_size * (1-float(slices_prop[i])))
+ residual_prob -= cl_probs[-1]
+ residual_size -= cl_sizes[-1]
+ values += "%.2f,"%cl_probs[-1]
+ sizes += "%.2f,"%cl_sizes[-1]
+
+cl_probs.append(residual_prob)
+values += "%.2f"%cl_probs[-1]
+sizes += "%.2f"%cl_sizes[-1]
+
+cmd += ["--cl-probs", values, "--cl-sizes", sizes]
+
+
+# Define the stdout and stderr files.
+out_file = "c" + str(configuration_id) + "-" + str(instance_id) + str(seed) + ".stdout"
+err_file = "c" + str(configuration_id) + "-" + str(instance_id) + str(seed) + ".stderr"
+
+def target_runner_error(msg):
+ now = datetime.datetime.now()
+ print(str(now) + " error: " + msg)
+ sys.exit(1)
+
+def check_executable(fpath):
+ fpath = os.path.expanduser(fpath)
+ if not os.path.isfile(fpath):
+ target_runner_error(str(fpath) + " not found")
+ if not os.access(fpath, os.X_OK):
+ target_runner_error(str(fpath) + " is not executable")
+
+# This is an example of reading a number from the output.
+def parse_output(out):
+ match = re.search(r'Best ([-+0-9.eE]+)', out.strip())
+ if match:
+ return match.group(1);
+ else:
+ return "No match"
+
+check_executable (exe)
+
+outf = open(out_file, "w")
+errf = open(err_file, "w")
+return_code = subprocess.call(cmd, stdout = outf, stderr = errf)
+
+outf.close()
+errf.close()
+
+if return_code != 0:
+ target_runner_error("command returned code " + str(return_code))
+
+if not os.path.isfile(out_file):
+ target_runner_error("output file " + out_file + " not found.")
+
+cost = parse_output (open(out_file).read())
+#print(cost)
+print(open(out_file).read().strip())
+
+os.remove(out_file)
+os.remove(err_file)
+sys.exit(0)
+
diff --git a/eo/contrib/irace/expe/gamma/run_irace.ipynb b/eo/contrib/irace/expe/gamma/run_irace.ipynb
new file mode 100644
index 000000000..251422d22
--- /dev/null
+++ b/eo/contrib/irace/expe/gamma/run_irace.ipynb
@@ -0,0 +1,267 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "id": "04867792",
+ "metadata": {},
+ "source": [
+ "# Imports"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 18,
+ "id": "435212a6",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "import pandas as pd\n",
+ "import numpy as np\n",
+ "import seaborn as sb\n",
+ "import matplotlib.pyplot as plt\n",
+ "from matplotlib.ticker import MaxNLocator\n",
+ "import matplotlib.animation\n",
+ "from math import sqrt, log, cos, sin, pi\n",
+ "import numpy as np\n",
+ "import os\n",
+ "import shutil\n",
+ "import re\n",
+ "from subprocess import call\n",
+ "sb.set_style(\"whitegrid\")\n",
+ "#sb.set_palette(\"cubehelix\")\n",
+ "sb.set_palette(\"husl\")\n",
+ "sb.set(font_scale=1) # crazy big\n",
+ "sb.set_style('whitegrid', {'legend.frameon':True})\n",
+ "myfontsize = 12\n",
+ "titlesize = 15\n",
+ "%matplotlib notebook"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "d76bdf6b",
+ "metadata": {},
+ "source": [
+ "# Function to generate the scenario file for irace"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 19,
+ "id": "d86a9ca8",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "def scenario(filename=\"scenario.txt\", \n",
+ " parameterFile=\"parameters.txt\", \n",
+ " execDir=\".\", \n",
+ " logFile=\"./irace.Rdata\", \n",
+ " targetRunner = \"target-runner.py\", \n",
+ " maxExperiments = 100000,\n",
+ " digits = 2):\n",
+ " f = open(filename, \"w\")\n",
+ " f.write(\"parameterFile=\" + parameterFile +\"\\n\")\n",
+ " f.write(\"execDir=\" + execDir + \"\\n\")\n",
+ " f.write(\"logFile=\" + logFile + \"\\n\")\n",
+ " f.write(\"targetRunner=\" + targetRunner + \"\\n\")\n",
+ " f.write(\"maxExperiments=\" + maxExperiments + \"\\n\")\n",
+ " f.write(\"digits=\" + digits + \"\\n\")\n",
+ " f.close()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "1213321a",
+ "metadata": {},
+ "source": [
+ "# Function to generate the parameter file for irace"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 20,
+ "id": "70d221c9",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# Generate the param file for irace with all configuarable parameters\n",
+ "def parameters(filename=\"parameters.txt\"):\n",
+ " f = open(\"parameters.txt\", \"w\")\n",
+ " f.write(\"# name\\tswitch\\ttype\\tvalues\\n\") # head of the param file\n",
+ " cl_nb_part = 10 # number of category for the custom categorial probabilistic law\n",
+ " for i in range(cl_nb_part-1): # minus 1 slice than the number of categories\n",
+ " f.write(\"slice_prob_%s\\t\\\"\\\"\\tr\\t(0,1)\\n\"%i) # percentage of the residual probability for the slice\n",
+ "\n",
+ " ######################################### NOT USED YET ##########################################\n",
+ " #for i in range(cl_nb_part-1): # minus 1 slice than the number of categories\n",
+ " # f.write(\"slice_size_%s\\t\\\"\\\"\\tr\\t(0,1)\\n\"%i) # percentage of the residual size for the slice\n",
+ " #################################################################################################\n",
+ " f.close()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "65fcb69d",
+ "metadata": {},
+ "source": [
+ "# Fonction to generate problem dedicated target-runner.py"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 21,
+ "id": "a18ba251",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "def target_runner(origin=\"irace-config/target-runner.py\", path=\"target-runner.py\", problem=1):\n",
+ " \n",
+ " generalTR = open(origin, \"r\")\n",
+ " dedicatedTR = open(path, \"w\")\n",
+ " for line in generalTR:\n",
+ " if re.search(\"problem = \", line, flags=0):\n",
+ " dedicatedTR.write(\"problem = \" + str(problem) + \"\\n\")\n",
+ " else:\n",
+ " dedicatedTR.write(line)\n",
+ " generalTR.close()\n",
+ " dedicatedTR.close()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "59421dee",
+ "metadata": {},
+ "source": [
+ "# Run script"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 28,
+ "id": "38dfec96",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "results_directory = \"results\"\n",
+ "irace_path = \"/Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/irace/bin/irace\"\n",
+ "instances_file = \"instances.txt\"\n",
+ "scenario_file = \"scenario.txt\"\n",
+ "parameters_file = \"parameters.txt\"\n",
+ "target_runner_file = \"target-runner.py\"\n",
+ "\n",
+ "# create or clear the results directory\n",
+ "if not os.path.isdir(results_directory):\n",
+ " os.mkdir(results_directory)\n",
+ " \n",
+ "for pb in range(1,3): # for each problem\n",
+ " # create or clear a subdirectory for the problem\n",
+ " problem_directory = results_directory + \"/problem_%s\"%pb\n",
+ " if os.path.isdir(problem_directory):\n",
+ " shutil.rmtree(problem_directory)\n",
+ " os.mkdir(problem_directory)\n",
+ " \n",
+ " # generate a custom target runner file for the problem\n",
+ " target_runner(path = problem_directory + \"/\" + target_runner_file, problem = pb)\n",
+ "\n",
+ " # copy the config files for iraces\n",
+ " for filename in [instances_file, scenario_file, parameters_file, target_runner_file]:\n",
+ " src = r'irace-config/' + filename\n",
+ " dst = problem_directory + \"/\" + filename\n",
+ " shutil.copyfile(src, dst)\n",
+ " \n",
+ " # run irace for\n",
+ " cmd = [irace_path, \"--scenario\", problem_directory + \"/\" + scenario_file] #, \"&> irace.log\"\n",
+ " call(cmd)\n",
+ "#call(cmd)\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 59,
+ "id": "b707ff3b",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "shutil.rmtree(\"results\")"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 25,
+ "id": "460c588e",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "-10"
+ ]
+ },
+ "execution_count": 25,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "call([\"../../release/onlymutga\"])"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 43,
+ "id": "eb234425",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "'problem_1/default.instances'"
+ ]
+ },
+ "execution_count": 43,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "import shutil\n",
+ "import os\n",
+ "src = r'irace-config/default.instances'\n",
+ "dst = r'problem_1/default.instances'\n",
+ "shutil.copyfile(src, dst)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "7a62c411",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "chmod u+x script.py\n",
+ "cp -a a b"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 3",
+ "language": "python",
+ "name": "python3"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 3
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython3",
+ "version": "3.8.8"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 5
+}
diff --git a/eo/contrib/irace/expe/gamma/run_irace.py b/eo/contrib/irace/expe/gamma/run_irace.py
new file mode 100644
index 000000000..caa7ea928
--- /dev/null
+++ b/eo/contrib/irace/expe/gamma/run_irace.py
@@ -0,0 +1,12 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+"""
+Created on Tue Dec 14 12:16:17 2021
+
+@author: labeiros
+"""
+
+import sys
+
+print('Number of arguments:', len(sys.argv), 'arguments.')
+print('Argument List:', str(sys.argv))
diff --git a/eo/contrib/irace/expe/gamma/target-runner.py b/eo/contrib/irace/expe/gamma/target-runner.py
new file mode 100644
index 000000000..c1dca9c36
--- /dev/null
+++ b/eo/contrib/irace/expe/gamma/target-runner.py
@@ -0,0 +1,119 @@
+#!/usr/bin/python
+###############################################################################
+# This script is the command that is executed every run.
+# Check the examples in examples/
+#
+# This script is run in the execution directory (execDir, --exec-dir).
+#
+# PARAMETERS:
+# argv[1] is the candidate configuration ID
+# argv[2] is the instance ID
+# argv[3] is the seed
+# argv[4] is the instance name
+# The rest (argv[5:]) are parameters to the run
+#
+# RETURN VALUE:
+# This script should print one numerical value: the cost that must be minimized.
+# Exit with 0 if no error, with 1 in case of error
+###############################################################################
+
+import datetime
+import os.path
+import re
+import subprocess
+import sys
+
+exe = "../../../../release/onlymutga"
+
+problem = blabla
+pop_size = 1
+offspring_size = 100
+
+fixed_parameters = ["--problem", str(problem), "--crossover-rate", "0", "--mutation-rate", "1", "--pop-size", str(pop_size), " --offspring-size", str(offspring_size)]
+
+if __name__=='__main__':
+ if len(sys.argv) < 5:
+ print("\nUsage: ./target-runner.py \n")
+ sys.exit(1)
+
+# Get the parameters as command line arguments.
+configuration_id = sys.argv[1]
+instance_id = sys.argv[2]
+seed = sys.argv[3]
+instance = sys.argv[4]
+slices_prop = sys.argv[5:]
+#print(sys.argv)
+
+exe = os.path.expanduser(exe)
+
+cmd = [exe] + fixed_parameters + ["--instance", instance, "--seed", seed]
+
+residual_prob = 1
+cl_probs = []
+residual_size = 1
+cl_sizes = []
+
+values = ""
+sizes = ""
+for i in range(len(slices_prop)):
+ cl_probs.append(residual_prob * float(slices_prop[i]))
+ cl_sizes.append(residual_size * (1-float(slices_prop[i])))
+ residual_prob -= cl_probs[-1]
+ residual_size -= cl_sizes[-1]
+ values += "%.2f,"%cl_probs[-1]
+ sizes += "%.2f,"%cl_sizes[-1]
+
+cl_probs.append(residual_prob)
+values += "%.2f"%cl_probs[-1]
+sizes += "%.2f"%cl_sizes[-1]
+
+cmd += ["--cl-probs", values, "--cl-sizes", sizes]
+
+
+# Define the stdout and stderr files.
+out_file = "c" + str(configuration_id) + "-" + str(instance_id) + str(seed) + ".stdout"
+err_file = "c" + str(configuration_id) + "-" + str(instance_id) + str(seed) + ".stderr"
+
+def target_runner_error(msg):
+ now = datetime.datetime.now()
+ print(str(now) + " error: " + msg)
+ sys.exit(1)
+
+def check_executable(fpath):
+ fpath = os.path.expanduser(fpath)
+ if not os.path.isfile(fpath):
+ target_runner_error(str(fpath) + " not found")
+ if not os.access(fpath, os.X_OK):
+ target_runner_error(str(fpath) + " is not executable")
+
+# This is an example of reading a number from the output.
+def parse_output(out):
+ match = re.search(r'Best ([-+0-9.eE]+)', out.strip())
+ if match:
+ return match.group(1);
+ else:
+ return "No match"
+
+check_executable (exe)
+
+outf = open(out_file, "w")
+errf = open(err_file, "w")
+return_code = subprocess.call(cmd, stdout = outf, stderr = errf)
+
+outf.close()
+errf.close()
+
+if return_code != 0:
+ target_runner_error("command returned code " + str(return_code))
+
+if not os.path.isfile(out_file):
+ target_runner_error("output file " + out_file + " not found.")
+
+cost = parse_output (open(out_file).read())
+#print(cost)
+print(open(out_file).read().strip())
+
+os.remove(out_file)
+os.remove(err_file)
+sys.exit(0)
+
diff --git a/eo/contrib/irace/fastga.cpp b/eo/contrib/irace/fastga.cpp
index 919231eb7..a7514f4b1 100644
--- a/eo/contrib/irace/fastga.cpp
+++ b/eo/contrib/irace/fastga.cpp
@@ -1,33 +1,43 @@
+#include
#include
#include
#include
+#include
+
#include
#include
#include
#include
#include
-#include
-#include
+#include
+
+/*****************************************************************************
+ * ParadisEO algorithmic grammar definition.
+ *****************************************************************************/
-// using Particle = eoRealParticle;
-using Ints = eoInt, size_t>;
using Bits = eoBit, int>;
// by enumerating candidate operators and their parameters.
eoAlgoFoundryFastGA& make_foundry(
eoFunctorStore& store,
eoInit& init,
- eoEvalFunc& eval_onemax,
+ eoEvalFunc& eval,
const size_t max_evals,
- const size_t generations
+ const size_t generations,
+ const double optimum
)
{
// FIXME using max_restarts>1 does not allow to honor max evals.
- auto& foundry = store.pack< eoAlgoFoundryFastGA >(init, eval_onemax, max_evals, /*max_restarts=*/1);
+ auto& foundry = store.pack< eoAlgoFoundryFastGA >(init, eval, max_evals, /*max_restarts=*/1);
/***** Continuators ****/
- foundry.continuators.add< eoGenContinue >(generations);
+ auto& fitcont = store.pack< eoFitContinue >(optimum);
+ auto& gencont = store.pack< eoGenContinue >(generations);
+ auto combconts = std::make_shared< std::vector*> >();
+ combconts->push_back( &fitcont );
+ combconts->push_back( &gencont );
+ foundry.continuators.add< eoCombinedContinue >( *combconts );
// for(size_t i=1; i<10; i++) {
// foundry.continuators.add< eoGenContinue >(i);
// }
@@ -35,17 +45,17 @@ eoAlgoFoundryFastGA& make_foundry(
// foundry.continuators.add< eoSteadyFitContinue >(10,i);
// }
- for(double i=0.0; i<1.0; i+=0.2) {
- foundry.crossover_rates.add(i);
- foundry.mutation_rates.add(i);
- }
+ // for(double i=0.0; i<1.0; i+=0.2) {
+ // foundry.crossover_rates.add(i);
+ // foundry.mutation_rates.add(i);
+ // }
/***** Offsprings size *****/
// for(size_t i=5; i<100; i+=10) {
// foundry.offspring_sizes.add(i);
// }
- foundry.offspring_sizes.add(0); // 0 = use parents fixed pop size.
+ foundry.offspring_sizes.setup(0,100); // 0 = use parents fixed pop size.
/***** Crossovers ****/
for(double i=0.1; i<1.0; i+=0.2) {
@@ -55,18 +65,25 @@ eoAlgoFoundryFastGA& make_foundry(
foundry.crossovers.add< eoNPtsBitXover >(i); // nb of points
}
- foundry.crossovers.add< eo1PtBitXover >();
+ // foundry.crossovers.add< eo1PtBitXover >(); // Same as NPts=1
/***** Mutations ****/
- double p = 1.0; // Probability of flipping eath bit.
- foundry.mutations.add< eoUniformBitMutation >(p); // proba of flipping k bits, k drawn in uniform distrib
- foundry.mutations.add< eoStandardBitMutation >(p); // proba of flipping k bits, k drawn in binomial distrib
- foundry.mutations.add< eoConditionalBitMutation >(p); // proba of flipping k bits, k drawn in binomial distrib, minus zero
- foundry.mutations.add< eoShiftedBitMutation >(p); // proba of flipping k bits, k drawn in binomial distrib, changing zeros to one
- foundry.mutations.add< eoNormalBitMutation >(p); // proba of flipping k bits, k drawn in normal distrib
- foundry.mutations.add< eoFastBitMutation >(p); // proba of flipping k bits, k drawn in powerlaw distrib
+ double p = 1.0; // Probability of flipping each bit.
+ // proba of flipping k bits, k drawn in uniform distrib
+ foundry.mutations.add< eoUniformBitMutation >(p);
+ // proba of flipping k bits, k drawn in binomial distrib
+ foundry.mutations.add< eoStandardBitMutation >(p);
+ // proba of flipping k bits, k drawn in binomial distrib, minus zero
+ foundry.mutations.add< eoConditionalBitMutation >(p);
+ // proba of flipping k bits, k drawn in binomial distrib, changing zeros to one
+ foundry.mutations.add< eoShiftedBitMutation >(p);
+ // proba of flipping k bits, k drawn in normal distrib
+ foundry.mutations.add< eoNormalBitMutation >(p);
+ // proba of flipping k bits, k drawn in powerlaw distrib
+ foundry.mutations.add< eoFastBitMutation >(p);
for(size_t i=1; i < 11; i+=2) {
- foundry.mutations.add< eoDetSingleBitFlip >(i); // mutate k bits without duplicates
+ // mutate k bits without duplicates
+ foundry.mutations.add< eoDetSingleBitFlip >(i);
}
/***** Selectors *****/
@@ -100,9 +117,13 @@ eoAlgoFoundryFastGA& make_foundry(
return foundry;
}
+/*****************************************************************************
+ * irace helper functions.
+ *****************************************************************************/
+
Bits::Fitness fake_func(const Bits&) { return 0; }
-void print_param_range(const eoParam& param, const size_t slot_size, std::ostream& out = std::cout)
+void print_irace_categorical(const eoParam& param, const size_t slot_size, std::string type="c", std::ostream& out = std::cout)
{
// If there is no choice to be made on this operator, comment it out.
if(slot_size - 1 <= 0) {
@@ -115,37 +136,230 @@ void print_param_range(const eoParam& param, const size_t slot_size, std::ostrea
out << irace_name
<< "\t\"--" << param.longName() << "=\""
- << "\ti";
+ << "\t" << type;
- if(slot_size -1 <= 0) {
- out << "\t(0)";
+ out << "\t(0";
+ for(size_t i=1; i
+void print_irace_ranged(const eoParam& param, const T min, const T max, std::string type="r", std::ostream& out = std::cout)
+{
+ // If there is no choice to be made on this operator, comment it out.
+ if(max - min <= 0) {
+ out << "# ";
+ }
+
+ // irace doesn't support "-" in names.
+ std::string irace_name = param.longName();
+ irace_name.erase(std::remove(irace_name.begin(), irace_name.end(), '-'), irace_name.end());
+
+ out << irace_name
+ << "\t\"--" << param.longName() << "=\""
+ << "\t" << type;
+
+ if(max-min <= 0) {
+ out << "\t(?)";
} else {
- out << "\t(0," << slot_size-1 << ")";
+ out << "\t(" << min << "," << max << ")";
}
out << std::endl;
}
+
+template
+void print_irace_oper(const eoParam& param, const eoOperatorFoundry& op_foundry, std::ostream& out = std::cout)
+{
+ print_irace_categorical(param, op_foundry.size(), "c", out);
+}
+
+// FIXME generalize to any scalar type with enable_if
+// template
+void print_irace_param(
+ const eoParam& param,
+ // const eoParameterFoundry::value >::type>& op_foundry,
+ const eoParameterFoundry& op_foundry,
+ std::ostream& out)
+{
+ print_irace_ranged(param, op_foundry.min(), op_foundry.max(), "r", out);
+}
+
+// template
+void print_irace_param(
+ const eoParam& param,
+ // const eoParameterFoundry::value >::type>& op_foundry,
+ const eoParameterFoundry& op_foundry,
+ std::ostream& out)
+{
+ print_irace_ranged(param, op_foundry.min(), op_foundry.max(), "i", out);
+}
+
+
+template
+void print_irace(const eoParam& param, const eoOperatorFoundry& op_foundry, std::ostream& out = std::cout)
+{
+ print_irace_oper(param, op_foundry, out);
+}
+
+template
+void print_irace(const eoParam& param, const eoParameterFoundry& op_foundry, std::ostream& out = std::cout)
+{
+ print_irace_param/**/(param, op_foundry, out);
+}
+
+void print_irace(const eoParam& param, const size_t min, const size_t max, std::ostream& out = std::cout)
+{
+ print_irace_ranged(param, min, max, "i", out);
+}
+
+void print_operator_typed(const eoFunctorBase& op, std::ostream& out)
+{
+ out << op.className();
+}
+
+void print_operator_typed(const double& op, std::ostream& out)
+{
+ out << op;
+}
+
+template
+void print_operators(const eoParam& param, eoOperatorFoundry& op_foundry, std::ostream& out = std::cout, std::string indent=" ")
+{
+ out << indent << op_foundry.size() << " " << param.longName() << ":" << std::endl;
+ for(size_t i=0; i < op_foundry.size(); ++i) {
+ out << indent << indent << i << ": ";
+ auto& op = op_foundry.instantiate(i);
+ print_operator_typed(op, out);
+ out << std::endl;
+ }
+}
+
+template
+void print_operators(const eoParam& param, T min, T max, std::ostream& out = std::cout, std::string indent=" ")
+{
+ out << indent << "[" << min << "," << max << "] " << param.longName() << "." << std::endl;
+}
+
+template
+void print_operators(const eoParam& param, eoParameterFoundry& op_foundry, std::ostream& out = std::cout, std::string indent=" ")
+{
+ print_operators(param, op_foundry.min(), op_foundry.max(), out, indent);
+}
+
+// Problem configuration.
+struct Problem {
+ double dummy;
+ size_t epistasis;
+ size_t neutrality;
+ size_t ruggedness;
+ size_t max_target;
+ size_t dimension;
+ friend std::ostream& operator<<(std::ostream& os, const Problem& pb);
+};
+
+std::ostream& operator<<(std::ostream& os, const Problem& pb)
+{
+ os << "u=" << pb.dummy << "_"
+ << "e=" << pb.epistasis << "_"
+ << "n=" << pb.neutrality << "_"
+ << "r=" << pb.ruggedness << "_"
+ << "t=" << pb.max_target << "_"
+ << "d=" << pb.dimension;
+ return os;
+}
+
+/*****************************************************************************
+ * IOH problem adaptation.
+ *****************************************************************************/
+
+class WModelFlat : public ioh::problem::wmodel::WModelOneMax
+{
+ public:
+ WModelFlat(const int instance, const int n_variables,
+ const double dummy_para, const int epistasis_para, const int neutrality_para,
+ const int ruggedness_para)
+ : WModelOneMax(instance, n_variables, dummy_para, epistasis_para, neutrality_para, ruggedness_para)
+ { }
+
+ protected:
+ double transform_objectives(const double y) override
+ { // Disable objective function shift & scaling.
+ return y;
+ }
+};
+
+/*****************************************************************************
+ * Command line interface.
+ *****************************************************************************/
+
int main(int argc, char* argv[])
{
/***** Global parameters. *****/
enum { NO_ERROR = 0, ERROR_USAGE = 100 };
+ std::map benchmark {
+ /* ┌ problem index in the map
+ * │ ┌ problem ID in IOH experimenter
+ * │ │ ┌ dummy
+ * │ │ │ ┌ epistasis
+ * │ │ │ │ ┌ neutrality
+ * │ │ │ │ │ ┌ ruggedness
+ * │ │ │ │ │ │ ┌ max target
+ * │ │ │ │ │ │ │ ┌ dimension (bitstring length) */
+ { 0 /* 1*/, {0, 6, 2, 10, 10, 20 }},
+ { 1 /* 2*/, {0, 6, 2, 18, 10, 20 }},
+ { 2 /* 3*/, {0, 5, 1, 72, 16, 16 }},
+ { 3 /* 4*/, {0, 9, 3, 72, 16, 48 }},
+ { 4 /* 5*/, {0, 23, 1, 90, 25, 25 }},
+ { 5 /* 6*/, {0, 2, 1, 397, 32, 32 }},
+ { 6 /* 7*/, {0, 11, 4, 0, 32, 128 }},
+ { 7 /* 8*/, {0, 14, 4, 0, 32, 128 }},
+ { 8 /* 9*/, {0, 8, 4, 128, 32, 128 }},
+ { 9 /*10*/, {0, 36, 1, 245, 50, 50 }},
+ {10 /*11*/, {0, 21, 2, 256, 50, 100 }},
+ {11 /*12*/, {0, 16, 3, 613, 50, 150 }},
+ {12 /*13*/, {0, 32, 2, 256, 64, 128 }},
+ {13 /*14*/, {0, 21, 3, 16, 64, 192 }},
+ {14 /*15*/, {0, 21, 3, 256, 64, 192 }},
+ {15 /*16*/, {0, 21, 3, 403, 64, 192 }},
+ {16 /*17*/, {0, 52, 4, 2, 64, 256 }},
+ {17 /*18*/, {0, 60, 1, 16, 75, 75 }},
+ {18 /*19*/, {0, 32, 2, 4, 75, 150 }}
+ };
+
eoFunctorStore store;
eoParser parser(argc, argv, "FastGA interface for iRace");
- const size_t dimension = parser.getORcreateParam(1000,
- "dimension", "Dimension size",
- 'd', "Problem").value();
+ /***** Problem parameters *****/
+ auto problem_p = parser.getORcreateParam(0,
+ "problem", "Problem ID",
+ 'p', "Problem", /*required=*/true);
+ const size_t problem = problem_p.value();
+ assert(problem < benchmark.size());
- const size_t max_evals = parser.getORcreateParam(2 * dimension,
- "max-evals", "Maximum number of evaluations",
+ // const size_t dimension = parser.getORcreateParam(1000,
+ // "dimension", "Dimension size",
+ // 'd', "Problem").value();
+ const size_t dimension = benchmark[problem].dimension;
+
+ auto instance_p = parser.getORcreateParam(0,
+ "instance", "Instance ID",
+ 'i', "Instance", /*required=*/false);
+ const size_t instance = instance_p.value();
+
+ const size_t max_evals = parser.getORcreateParam(5 * dimension,
+ "max-evals", "Maximum number of evaluations (default: 5*dim, else the given value)",
'e', "Stopping criterion").value();
const size_t buckets = parser.getORcreateParam(100,
"buckets", "Number of buckets for discretizing the ECDF",
'b', "Performance estimation").value();
+ /***** Generic options *****/
uint32_t seed =
parser.getORcreateParam(0,
"seed", "Random number seed (0 = epoch)",
@@ -156,33 +370,52 @@ int main(int argc, char* argv[])
// rng is a global
rng.reseed(seed);
+ bool full_log =
+ parser.getORcreateParam(0,
+ "full-log", "Log the full search in CSV files"/* (using the IOH profiler format)"*/,
+ 'F').value();
- auto problem_p = parser.getORcreateParam(0,
- "problem", "Problem ID",
- 'p', "Problem", /*required=*/true);
- const size_t problem = problem_p.value();
+ bool output_mat =
+ parser.getORcreateParam(0,
+ "output-mat", "Output the aggregated attainment matrix instead of its scalar sum (fancy colormap on stderr, parsable CSV on stdout).",
+ 'A').value();
-
- auto pop_size_p = parser.getORcreateParam(1,
+ /***** populations sizes *****/
+ auto pop_size_p = parser.getORcreateParam(5,
"pop-size", "Population size",
'P', "Operator Choice", /*required=*/false);
const size_t pop_size = pop_size_p.value();
+ const size_t pop_size_max = 200;
- auto instance_p = parser.getORcreateParam(0,
- "instance", "Instance ID",
- 'i', "Instance", /*required=*/false);
- const size_t instance = instance_p.value();
+ auto offspring_size_p = parser.getORcreateParam(0,
+ "offspring-size", "Offsprings size (0 = same size than the parents pop, see --pop-size)",
+ 'O', "Operator Choice", /*required=*/false); // Single alternative, not required.
+ const size_t offspring_size = offspring_size_p.value();
+ size_t generations = static_cast(std::floor(
+ static_cast(max_evals) / static_cast(pop_size)));
+ // const size_t generations = std::numeric_limits::max();
+ if(generations < 1) {
+ generations = 1;
+ }
+
+ /***** metric parameters *****/
+ auto crossover_rate_p = parser.getORcreateParam(0.5,
+ "crossover-rate", "",
+ 'C', "Operator Choice", /*required=*/true);
+ const double crossover_rate = crossover_rate_p.value();
+
+ auto mutation_rate_p = parser.getORcreateParam(0,
+ "mutation-rate", "",
+ 'M', "Operator Choice", /*required=*/true);
+ const double mutation_rate = mutation_rate_p.value();
+
+ /***** operators *****/
auto continuator_p = parser.getORcreateParam(0,
"continuator", "Stopping criterion",
'o', "Operator Choice", /*required=*/false); // Single alternative, not required.
const size_t continuator = continuator_p.value();
- auto crossover_rate_p = parser.getORcreateParam(0,
- "crossover-rate", "",
- 'C', "Operator Choice", /*required=*/true);
- const size_t crossover_rate = crossover_rate_p.value();
-
auto crossover_selector_p = parser.getORcreateParam(0,
"cross-selector", "How to selects candidates for cross-over",
's', "Operator Choice", /*required=*/true);
@@ -198,11 +431,6 @@ int main(int argc, char* argv[])
'a', "Operator Choice", /*required=*/false); // Single alternative, not required.
const size_t aftercross_selector = aftercross_selector_p.value();
- auto mutation_rate_p = parser.getORcreateParam(0,
- "mutation-rate", "",
- 'M', "Operator Choice", /*required=*/true);
- const size_t mutation_rate = mutation_rate_p.value();
-
auto mutation_selector_p = parser.getORcreateParam(0,
"mut-selector", "How to selects candidate for mutation",
'u', "Operator Choice", /*required=*/true);
@@ -218,12 +446,6 @@ int main(int argc, char* argv[])
'r', "Operator Choice", /*required=*/true);
const size_t replacement = replacement_p.value();
- auto offspring_size_p = parser.getORcreateParam(0,
- "offspring-size", "Offsprings size (0 = same size than the parents pop, see --pop-size)",
- 'O', "Operator Choice", /*required=*/false); // Single alternative, not required.
- const size_t offspring_size = offspring_size_p.value();
-
-
// Help + Verbose routines
make_verbose(parser);
make_help(parser, /*exit_after*/false, std::clog);
@@ -235,36 +457,56 @@ int main(int argc, char* argv[])
eoEvalFuncPtr fake_eval(fake_func);
eoUniformGenerator fake_gen(0, 1);
eoInitFixedLength fake_init(/*bitstring size=*/1, fake_gen);
- auto fake_foundry = make_foundry(store, fake_init, fake_eval, max_evals, /*generations=*/ 1);
+ auto fake_foundry = make_foundry(store, fake_init, fake_eval, max_evals, /*generations=*/ 1, 0);
+ std::clog << std::endl << "Available operators:" << std::endl;
+ print_operators( continuator_p, fake_foundry.continuators , std::clog);
+ print_operators( crossover_rate_p, fake_foundry.crossover_rates , std::clog);
+ print_operators( crossover_selector_p, fake_foundry.crossover_selectors , std::clog);
+ print_operators(aftercross_selector_p, fake_foundry.aftercross_selectors, std::clog);
+ print_operators( crossover_p, fake_foundry.crossovers , std::clog);
+ print_operators( mutation_rate_p, fake_foundry.mutation_rates , std::clog);
+ print_operators( mutation_selector_p, fake_foundry.mutation_selectors , std::clog);
+ print_operators( mutation_p, fake_foundry.mutations , std::clog);
+ print_operators( replacement_p, fake_foundry.replacements , std::clog);
+ print_operators( offspring_size_p, fake_foundry.offspring_sizes , std::clog);
+ print_operators( pop_size_p, (size_t)1, pop_size_max , std::clog);
+ std::clog << std::endl;
+
+ // If we were to make a DoE sampling numeric parameters,
+ // we would use that many samples:
+ size_t fake_sample_size = 10;
+ std::clog << "With " << fake_sample_size << " samples for numeric parameters..." << std::endl;
size_t n =
- fake_foundry.crossover_rates.size()
+ fake_sample_size //crossover_rates
* fake_foundry.crossover_selectors.size()
* fake_foundry.crossovers.size()
* fake_foundry.aftercross_selectors.size()
- * fake_foundry.mutation_rates.size()
+ * fake_sample_size //mutation_rates
* fake_foundry.mutation_selectors.size()
* fake_foundry.mutations.size()
* fake_foundry.replacements.size()
* fake_foundry.continuators.size()
- * fake_foundry.offspring_sizes.size();
- std::clog << std::endl;
- std::clog << n << " possible algorithms configurations." << std::endl;
+ * fake_sample_size //offspring_sizes
+ * fake_sample_size //pop_size
+ ;
+ std::clog << "~" << n << " possible algorithms configurations." << std::endl;
std::clog << "Ranges of configurable parameters (redirect the stdout in a file to use it with iRace): " << std::endl;
// Do not print problem and instances, as they are managed separately by irace.
std::cout << "# name\tswitch\ttype\trange" << std::endl;
- print_param_range( continuator_p, fake_foundry.continuators .size(), std::cout);
- print_param_range( crossover_rate_p, fake_foundry.crossover_rates .size(), std::cout);
- print_param_range( crossover_selector_p, fake_foundry.crossover_selectors .size(), std::cout);
- print_param_range(aftercross_selector_p, fake_foundry.aftercross_selectors.size(), std::cout);
- print_param_range( crossover_p, fake_foundry.crossovers .size(), std::cout);
- print_param_range( mutation_rate_p, fake_foundry.mutation_rates .size(), std::cout);
- print_param_range( mutation_selector_p, fake_foundry.mutation_selectors .size(), std::cout);
- print_param_range( mutation_p, fake_foundry.mutations .size(), std::cout);
- print_param_range( replacement_p, fake_foundry.replacements .size(), std::cout);
- print_param_range( offspring_size_p, fake_foundry.offspring_sizes .size(), std::cout);
+ print_irace( continuator_p, fake_foundry.continuators , std::cout);
+ print_irace( crossover_rate_p, fake_foundry.crossover_rates , std::cout);
+ print_irace( crossover_selector_p, fake_foundry.crossover_selectors , std::cout);
+ print_irace(aftercross_selector_p, fake_foundry.aftercross_selectors, std::cout);
+ print_irace( crossover_p, fake_foundry.crossovers , std::cout);
+ print_irace( mutation_rate_p, fake_foundry.mutation_rates , std::cout);
+ print_irace( mutation_selector_p, fake_foundry.mutation_selectors , std::cout);
+ print_irace( mutation_p, fake_foundry.mutations , std::cout);
+ print_irace( replacement_p, fake_foundry.replacements , std::cout);
+ print_irace( offspring_size_p, fake_foundry.offspring_sizes , std::cout);
+ print_irace( pop_size_p, 1, pop_size_max , std::cout);
// std::ofstream irace_param("fastga.params");
// irace_param << "# name\tswitch\ttype\tvalues" << std::endl;
@@ -272,91 +514,105 @@ int main(int argc, char* argv[])
exit(NO_ERROR);
}
- const size_t generations = static_cast(std::floor(
- static_cast(max_evals) / static_cast(pop_size)));
- // const size_t generations = std::numeric_limits::max();
+ eo::log << eo::debug << "Maximum number of evaluations: " << max_evals << std::endl;
eo::log << eo::debug << "Number of generations: " << generations << std::endl;
- // Problem configuration code.
- struct Problem {
- double dummy;
- size_t epistasis;
- size_t neutrality;
- size_t ruggedness;
- size_t max_target;
- };
- std::map problem_config_mapping {
- { 0, {0, 0, 1, 0, 1000}},
- { 1, {0, 0, 3, 0, 333}},
- { 2, {0, 0, 5, 0, 200}},
- { 3, {0, 2, 1, 0, 1000}},
- { 4, {0, 2, 3, 0, 333}},
- { 5, {0, 2, 3, 0, 200}},
- { 6, {0, 4, 1, 0, 1000}},
- { 7, {0, 4, 3, 0, 333}},
- { 8, {0, 4, 5, 0, 200}},
- { 9, {0.5, 0, 1, 0, 500}},
- {10, {0.5, 0, 3, 0, 166}},
- {11, {0.5, 0, 5, 0, 100}},
- {12, {0.5, 2, 1, 0, 500}},
- {13, {0.5, 2, 3, 0, 166}},
- {14, {0.5, 2, 5, 0, 100}},
- {15, {0.5, 4, 1, 0, 500}},
- {16, {0.5, 4, 3, 0, 166}},
- {17, {0.5, 4, 5, 0, 100}},
- };
-
- assert(0 <= problem and problem < problem_config_mapping.size());
+ /*****************************************************************************
+ * IOH stuff.
+ *****************************************************************************/
/***** IOH logger *****/
- auto max_target_para = problem_config_mapping[problem].max_target;
- IOHprofiler_RangeLinear target_range(0, max_target_para, buckets);
- IOHprofiler_RangeLinear budget_range(0, max_evals, buckets);
- IOHprofiler_ecdf_logger logger(
- target_range, budget_range,
- /*use_known_optimum*/false);
+ auto max_target = benchmark[problem].max_target;
+ ioh::logger::eah::Log10Scale target_range(0, max_target, buckets);
+ ioh::logger::eah::Log10Scale budget_range(0, max_evals, buckets);
+ ioh::logger::EAH eah_logger(target_range, budget_range);
- logger.set_complete_flag(true);
- logger.set_interval(0);
- logger.activate_logger();
+ ioh::logger::Combine loggers(eah_logger);
+
+ std::shared_ptr csv_logger = nullptr;
+ if(full_log) {
+ // Build up an algorithm name from main parameters.
+ std::ostringstream name;
+ name << "FastGA";
+ for(auto& p : {
+ crossover_selector_p,
+ crossover_p,
+ aftercross_selector_p,
+ mutation_selector_p,
+ mutation_p,
+ replacement_p }) {
+ name << "_" << p.shortName() << "=" << p.getValue();
+ }
+ for(auto& p : {
+ crossover_rate_p,
+ mutation_rate_p }) {
+ name << "_" << p.shortName() << "=" << p.getValue();
+ }
+ for(auto& p : {pop_size_p,
+ offspring_size_p }) {
+ name << "_" << p.shortName() << "=" << p.getValue();
+ }
+ std::clog << name.str() << std::endl;
+
+ // Build up a problem description.
+ std::ostringstream desc;
+ desc << "pb=" << problem << "_";
+ desc << benchmark[problem]; // Use the `operator<<` above.
+ std::clog << desc.str() << std::endl;
+
+ std::filesystem::path folder = desc.str();
+ std::filesystem::create_directories(folder);
+
+ ioh::trigger::OnImprovement on_improvement;
+ ioh::watch::Evaluations evaluations;
+ ioh::watch::TransformedYBest transformed_y_best;
+ std::vector> t = {on_improvement};
+ std::vector> w = {evaluations,transformed_y_best};
+ csv_logger = std::make_shared(
+ // {std::ref(on_improvement)},
+ // {std::ref(evaluations),std::ref(transformed_y_best)},
+ t, w,
+ name.str(),
+ folder
+ );
+ loggers.append(*csv_logger);
+ }
/***** IOH problem *****/
- double w_model_suite_dummy_para = problem_config_mapping[problem].dummy;
- int w_model_suite_epitasis_para = problem_config_mapping[problem].epistasis;
- int w_model_suite_neutrality_para = problem_config_mapping[problem].neutrality;
- int w_model_suite_ruggedness_para = problem_config_mapping[problem].ruggedness;
+ double w_dummy = benchmark[problem].dummy;
+ int w_epitasis = benchmark[problem].epistasis;
+ int w_neutrality = benchmark[problem].neutrality;
+ int w_ruggedness = benchmark[problem].ruggedness;
- W_Model_OneMax w_model_om;
- std::string problem_name = "OneMax";
- problem_name = problem_name
- + "_D" + std::to_string((int)(w_model_suite_dummy_para * dimension))
- + "_E" + std::to_string(w_model_suite_epitasis_para)
- + "_N" + std::to_string(w_model_suite_neutrality_para)
- + "_R" + std::to_string(w_model_suite_ruggedness_para);
+ // std::string problem_name = "OneMax";
+ // problem_name = problem_name
+ // + "_D" + std::to_string((int)(w_dummy * dimension))
+ // + "_E" + std::to_string(w_epitasis)
+ // + "_N" + std::to_string(w_neutrality)
+ // + "_R" + std::to_string(w_ruggedness);
-
- /// This must be called to configure the w-model to be tested.
- w_model_om.set_w_setting(w_model_suite_dummy_para,w_model_suite_epitasis_para,
- w_model_suite_neutrality_para,w_model_suite_ruggedness_para);
-
- /// Set problem_name based on the configuration.
- w_model_om.IOHprofiler_set_problem_name(problem_name);
-
- /// Set problem_id as 1
- w_model_om.IOHprofiler_set_problem_id(problem); // FIXME check what that means
- // w_model_om.IOHprofiler_set_instance_id(instance); // FIXME changing the instance seems to change the target upper bound.
-
- /// Set dimension.
- w_model_om.IOHprofiler_set_number_of_variables(dimension);
+ // ioh::problem::wmodel::WModelOneMax w_model_om(
+ WModelFlat w_model_om(
+ instance,
+ dimension,
+ w_dummy,
+ w_epitasis,
+ w_neutrality,
+ w_ruggedness);
/***** Bindings *****/
- logger.track_problem(w_model_om);
+ w_model_om.attach_logger(loggers);
- eoEvalIOHproblem onemax_pb(w_model_om, logger);
+ /*****************************************************************************
+ * Binding everything together.
+ *****************************************************************************/
+
+ eoEvalIOHproblem onemax_pb(w_model_om, loggers);
// eoEvalPrint eval_print(onemax_pb, std::clog, "\n");
- eoEvalFuncCounter eval_count(onemax_pb);
+ // eoEvalFuncCounter eval_count(onemax_pb);
+ eoEvalCounterThrowException eval_count(onemax_pb, max_evals);
eoPopLoopEval onemax_eval(eval_count);
@@ -364,9 +620,9 @@ int main(int argc, char* argv[])
eoBooleanGenerator bgen;
eoInitFixedLength onemax_init(/*bitstring size=*/dimension, bgen);
- auto& foundry = make_foundry(store, onemax_init, eval_count, max_evals - pop_size, generations);
+ auto& foundry = make_foundry(store, onemax_init, eval_count, max_evals, generations, max_target);
- Ints encoded_algo(foundry.size());
+ eoAlgoFoundry::Encodings encoded_algo(foundry.size());
encoded_algo[foundry.crossover_rates .index()] = crossover_rate;
encoded_algo[foundry.crossover_selectors .index()] = crossover_selector;
@@ -379,39 +635,55 @@ int main(int argc, char* argv[])
encoded_algo[foundry.continuators .index()] = continuator;
encoded_algo[foundry.offspring_sizes .index()] = offspring_size;
- std::clog << "Encoded algorithm:" << std::endl;
+ // std::clog << "Encoded algorithm:" << std::endl;
foundry.select(encoded_algo);
std::clog << foundry.name() << std::endl;
- // // Evaluation of a forged encoded_algo on the sub-problem
- // eoEvalFoundryFastGA eval_foundry(
- // foundry, pop_size,
- // onemax_init, onemax_eval,
- // /*penalization=*/ dimension, // Worst case penalization.
- // /*normalized=*/ false); // Use direct integer encoding.
- //
- // // Actually instanciate and run the algorithm.
- // eval_foundry(encoded_algo);
+ /*****************************************************************************
+ * Run and output results.
+ *****************************************************************************/
eoPop pop;
pop.append(pop_size, onemax_init);
- onemax_eval(pop,pop);
- foundry(pop); // Actually run the selected algorithm.
+ try {
+ onemax_eval(pop,pop);
+ foundry(pop); // Actually run the selected algorithm.
+
+ } catch(eoMaxEvalException & e) {
+ eo::log << eo::debug << "Reached maximum evaluations: " << eval_count.getValue() << " / " << max_evals << std::endl;
+ }
/***** IOH perf stats *****/
- IOHprofiler_ecdf_sum ecdf_sum;
- // iRace expects minimization
- long perf = ecdf_sum(logger.data());
+ double perf = ioh::logger::eah::stat::under_curve::volume(eah_logger);
- // assert(0 < perf and perf <= buckets*buckets);
- if(perf <= 0 or buckets*buckets < perf) {
- std::cerr << "WARNING: illogical performance: " << perf
- << ", check the bounds or the algorithm." << std::endl;
+ if(perf == 0 or perf > max_target * max_evals * 1.0) {
+ std::cerr << "WARNING: illogical performance? " << perf
+ << " Check the bounds or the algorithm." << std::endl;
}
// std::clog << "After " << eval_count.getValue() << " / " << max_evals << " evaluations" << std::endl;
- // Output
- std::cout << -1 * perf << std::endl;
+ if(output_mat) {
+ std::vector> mat = ioh::logger::eah::stat::distribution(eah_logger);
+ // Fancy color map on clog.
+ std::clog << ioh::logger::eah::colormap(mat) << std::endl;
+
+ // Parsable CSV on cout.
+ std::clog << "Attainment matrix distribution: " << std::endl;
+ assert(mat.size() > 0);
+ assert(mat[0].size() > 1);
+ for(size_t i = mat.size()-1; i > 0; --i) {
+ assert(mat[i].size() >= 1);
+ std::cout << mat[i][0];
+ for(size_t j = 1; j < mat[i].size(); ++j) {
+ std::cout << "," << mat[i][j];
+ }
+ std::cout << std::endl;
+ }
+
+ } else {
+ // iRace expects minimization
+ std::cout << -1 * perf << std::endl;
+ }
}
diff --git a/eo/contrib/irace/fastga.sindef b/eo/contrib/irace/fastga.sindef
new file mode 100644
index 000000000..b27155ecf
--- /dev/null
+++ b/eo/contrib/irace/fastga.sindef
@@ -0,0 +1,64 @@
+https://github.com/drbild/json2yaml.gitBootstrap: library
+From: ubuntu:20.04
+
+%post
+
+ # Dependencies
+ apt -y update
+ apt -y install software-properties-common
+ add-apt-repository universe
+ apt -y update
+ apt -y dist-upgrade
+ apt -y install git clang-9 cmake make libeigen3-dev
+ apt clean
+ update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-9 90
+ update-alternatives --set c++ /usr/bin/clang++-9
+
+ # Temporary directory where we are going to build everything.
+ tmpdir=$(mktemp -d)
+ mkdir -p ${tmpdir}/fastga/
+
+ # Build IOH
+ cd ${tmpdir}/fastga/
+ git clone --branch feat+EAF --single-branch --recurse-submodules https://github.com/jdreo/IOHexperimenter.git
+ cd IOHexperimenter
+ mkdir -p release
+ cd release
+ cmake -D CMAKE_BUILD_TYPE=Release -D BUILD_TESTS=OFF -D BUILD_EXAMPLE=OFF -D BUILD_GMOCK=OFF ..
+ make
+
+ # Build Paradiseo
+ cd ${tmpdir}/fastga/
+ git clone --branch feat+num_foundry --single-branch https://github.com/jdreo/paradiseo.git
+ cd paradiseo
+ touch LICENSE
+ mkdir -p release
+ cd release
+ cmake -D CMAKE_BUILD_TYPE=Release -EDO=ON -EDO_USE_LIB=Eigen3 ..
+ make
+
+ # Build FastGA
+ cd ${tmpdir}/fastga/paradiseo/eo/contrib/irace/
+ mkdir -p release
+ cd release
+ cmake -D CMAKE_BUILD_TYPE=Release -D IOH_ROOT=${tmpdir}/fastga/IOHexperimenter/ -D PARADISEO_ROOT=${tmpdir}/fastga/paradiseo/ -D PARADISEO_BUILD=${tmpdir}/fastga/paradiseo/release/ ..
+ make
+
+ # Install FastGA
+ cp fastga /usr/local/bin/
+
+ # Clean-up
+ rm -rf ${tmpdir}
+ apt -y purge software-properties-common git clang-9 cmake make libeigen3-dev
+ apt -y --purge autoremove
+ apt -y autoclean
+ apt clean
+
+%environment
+
+%runscript
+ /usr/local/bin/fastga $*
+
+%labels
+ Author Quentin Renau
+ Author Johann Dreo
diff --git a/eo/contrib/irace/irace-config/example.scen b/eo/contrib/irace/irace-config/example.scen
index 6c7abb972..5f9fafe15 100644
--- a/eo/contrib/irace/irace-config/example.scen
+++ b/eo/contrib/irace/irace-config/example.scen
@@ -15,7 +15,7 @@ execDir = "."
## File to save tuning results as an R dataset, either absolute path or
## relative to execDir.
-# logFile = "./irace.Rdata"
+logFile = "" # "./irace.Rdata"
## Previously saved log file to recover the execution of irace, either
## absolute path or relative to the current directory. If empty or NULL,
@@ -62,8 +62,8 @@ targetRunner = "./target-runner"
## Maximum number of runs (invocations of targetRunner) that will be
## performed. It determines the maximum budget of experiments for the
-## tuning.
-maxExperiments = 2000
+## tuning. (minimum: 180)
+maxExperiments = 100000
## Maximum total execution time in seconds for the executions of
## targetRunner. targetRunner must return two values: cost and time.
@@ -129,13 +129,13 @@ digits = 2
## Number of calls to targetRunner to execute in parallel. Values 0 or 1
## mean no parallelization.
-# parallel = 0
+parallel = 0
## Enable/disable load-balancing when executing experiments in parallel.
## Load-balancing makes better use of computing resources, but increases
## communication overhead. If this overhead is large, disabling
## load-balancing may be faster.
-# loadBalancing = 1
+loadBalancing = 0
## Enable/disable MPI. Use Rmpi to execute targetRunner in parallel
## (parameter parallel is the number of slaves).
diff --git a/eo/contrib/irace/irace-config/target-runner b/eo/contrib/irace/irace-config/target-runner
index 6d6e39dd7..87cf07e91 100755
--- a/eo/contrib/irace/irace-config/target-runner
+++ b/eo/contrib/irace/irace-config/target-runner
@@ -25,7 +25,7 @@ error() {
EXE="./fastga"
LOG_DIR="irace_logs"
-FIXED_PARAMS="--problem=0"
+FIXED_PARAMS="--problem={{PROBLEM}}"
CONFIG_ID=$1
INSTANCE_ID=$2
diff --git a/eo/contrib/irace/onlymutga.cpp b/eo/contrib/irace/onlymutga.cpp
new file mode 100644
index 000000000..1c7b0937d
--- /dev/null
+++ b/eo/contrib/irace/onlymutga.cpp
@@ -0,0 +1,770 @@
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+#include
+#include
+#include
+
+#include
+
+/*****************************************************************************
+ * ParadisEO algorithmic grammar definition.
+ *****************************************************************************/
+
+// using Particle = eoRealParticle;
+using Ints = eoInt, size_t>;
+using Bits = eoBit, int>;
+
+// by enumerating candidate operators and their parameters.
+eoAlgoFoundryFastGA& make_foundry(
+ eoFunctorStore& store,
+ eoInit& init,
+ eoEvalFunc& eval,
+ const size_t max_evals,
+ const size_t generations,
+ const double optimum,
+ const size_t pop_size,
+ const size_t offspring_size,
+ std::vector cl_sizes,
+ std::vector cl_values
+ )
+{
+ // FIXME using max_restarts>1 does not allow to honor max evals.
+ auto& foundry = store.pack< eoAlgoFoundryFastGA >(init, eval, max_evals, /*max_restarts=*/1);
+
+ /***** Continuators ****/
+ auto& fitcont = store.pack< eoFitContinue >(optimum);
+ auto& gencont = store.pack< eoGenContinue >(generations);
+ auto combconts = std::make_shared< std::vector*> >();
+ combconts->push_back( &fitcont );
+ combconts->push_back( &gencont );
+ foundry.continuators.add< eoCombinedContinue >( *combconts );
+ // for(size_t i=1; i<10; i++) {
+ // foundry.continuators.add< eoGenContinue >(i);
+ // }
+ // for(size_t i=10; i < 100; i+=2 ) {
+ // foundry.continuators.add< eoSteadyFitContinue >(10,i);
+ // }
+
+ // for(double i=0.0; i<1.0; i+=0.2) {
+ // foundry.crossover_rates.add(i);
+ // foundry.mutation_rates.add(i);
+ // }
+
+ /***** Offsprings size *****/
+ // for(size_t i=5; i<100; i+=10) {
+ // foundry.offspring_sizes.add(i);
+ // }
+
+ foundry.offspring_sizes.setup(0,offspring_size); // 0 = use parents fixed pop size.
+
+ /***** Crossovers ****/
+ for(double i=0.1; i<1.0; i+=0.2) {
+ foundry.crossovers.add< eoUBitXover >(i); // preference over 1
+ }
+ for(size_t i=1; i < 10; i+=2) {
+
+ foundry.crossovers.add< eoNPtsBitXover >(i); // nb of points
+ }
+ // foundry.crossovers.add< eo1PtBitXover >(); // Same as NPts=1
+
+ /***** Mutations ****/
+ /* ######################## Removed by Alexis ######################## */
+ /*
+ double p = 1.0; // Probability of flipping each bit.
+ // proba of flipping k bits, k drawn in uniform distrib
+ foundry.mutations.add< eoUniformBitMutation >(p);
+ // proba of flipping k bits, k drawn in binomial distrib
+ foundry.mutations.add< eoStandardBitMutation >(p);
+ // proba of flipping k bits, k drawn in binomial distrib, minus zero
+ foundry.mutations.add< eoConditionalBitMutation >(p);
+ // proba of flipping k bits, k drawn in binomial distrib, changing zeros to one
+ foundry.mutations.add< eoShiftedBitMutation >(p);
+ // proba of flipping k bits, k drawn in normal distrib
+ foundry.mutations.add< eoNormalBitMutation >(p);
+ // proba of flipping k bits, k drawn in powerlaw distrib
+ foundry.mutations.add< eoFastBitMutation >(p);
+ for(size_t i=1; i < 11; i+=2) {
+ // mutate k bits without duplicates
+ foundry.mutations.add< eoDetSingleBitFlip >(i);
+ }
+ */
+ /* ######################## RbA END ######################## */
+
+ /* ######################## Add by Alexis ######################## */
+ foundry.mutations.add< eoBucketBitMutation >(cl_sizes, cl_values);
+ /* ######################## AbA END ######################## */
+
+ /***** Selectors *****/
+ for(eoOperatorFoundry>& ops :
+ {std::ref(foundry.crossover_selectors),
+ std::ref(foundry.mutation_selectors) }) {
+
+ ops.add< eoRandomSelect >();
+ ops.add< eoStochTournamentSelect >(0.5);
+ ops.add< eoSequentialSelect >();
+ ops.add< eoProportionalSelect >();
+ for(size_t i=2; i < 11; i+=4) {
+ ops.add< eoDetTournamentSelect >(i);
+ }
+ }
+
+ foundry.aftercross_selectors.add< eoRandomSelect >();
+
+
+ /***** Replacements ****/
+ /* ######################## Removed by Alexis ######################## */
+ /*
+ foundry.replacements.add< eoPlusReplacement >();
+ foundry.replacements.add< eoCommaReplacement >();
+ foundry.replacements.add< eoSSGAWorseReplacement >();
+ for(double i=0.51; i<0.92; i+=0.2) {
+ foundry.replacements.add< eoSSGAStochTournamentReplacement >(i);
+ }
+ for(size_t i=2; i < 11; i+=2) {
+ foundry.replacements.add< eoSSGADetTournamentReplacement >(i);
+ }
+ */
+ /* ######################## RbA END ######################## */
+
+ /* ######################## Add by Alexis ######################## */
+ //foundry.replacements.add< eoSSGADetTournamentReplacement >(1);
+ foundry.replacements.add< eoCommaReplacement >();
+ /* ######################## AbA END ######################## */
+
+ return foundry;
+}
+
+/*****************************************************************************
+ * irace helper functions.
+ *****************************************************************************/
+
+Bits::Fitness fake_func(const Bits&) { return 0; }
+
+void print_irace_categorical(const eoParam& param, const size_t slot_size, std::string type="c", std::ostream& out = std::cout)
+{
+ // If there is no choice to be made on this operator, comment it out.
+ if(slot_size - 1 <= 0) {
+ out << "# ";
+ }
+
+ // irace doesn't support "-" in names.
+ std::string irace_name = param.longName();
+ irace_name.erase(std::remove(irace_name.begin(), irace_name.end(), '-'), irace_name.end());
+
+ out << irace_name
+ << "\t\"--" << param.longName() << "=\""
+ << "\t" << type;
+
+ out << "\t(0";
+ for(size_t i=1; i
+void print_irace_ranged(const eoParam& param, const T min, const T max, std::string type="r", std::ostream& out = std::cout)
+{
+ // If there is no choice to be made on this operator, comment it out.
+ if(max - min <= 0) {
+ out << "# ";
+ }
+
+ // irace doesn't support "-" in names.
+ std::string irace_name = param.longName();
+ irace_name.erase(std::remove(irace_name.begin(), irace_name.end(), '-'), irace_name.end());
+
+ out << irace_name
+ << "\t\"--" << param.longName() << "=\""
+ << "\t" << type;
+
+ if(max-min <= 0) {
+ out << "\t(?)";
+ } else {
+ out << "\t(" << min << "," << max << ")";
+ }
+ out << std::endl;
+}
+
+
+template
+void print_irace_oper(const eoParam& param, const eoOperatorFoundry& op_foundry, std::ostream& out = std::cout)
+{
+ print_irace_categorical(param, op_foundry.size(), "c", out);
+}
+
+// FIXME generalize to any scalar type with enable_if
+// template
+void print_irace_param(
+ const eoParam& param,
+ // const eoParameterFoundry::value >::type>& op_foundry,
+ const eoParameterFoundry& op_foundry,
+ std::ostream& out)
+{
+ print_irace_ranged(param, op_foundry.min(), op_foundry.max(), "r", out);
+}
+
+// template
+void print_irace_param(
+ const eoParam& param,
+ // const eoParameterFoundry::value >::type>& op_foundry,
+ const eoParameterFoundry& op_foundry,
+ std::ostream& out)
+{
+ print_irace_ranged(param, op_foundry.min(), op_foundry.max(), "i", out);
+}
+
+
+template
+void print_irace(const eoParam& param, const eoOperatorFoundry& op_foundry, std::ostream& out = std::cout)
+{
+ print_irace_oper(param, op_foundry, out);
+}
+
+template
+void print_irace(const eoParam& param, const eoParameterFoundry& op_foundry, std::ostream& out = std::cout)
+{
+ print_irace_param/**/(param, op_foundry, out);
+}
+
+void print_irace(const eoParam& param, const size_t min, const size_t max, std::ostream& out = std::cout)
+{
+ print_irace_ranged(param, min, max, "i", out);
+}
+
+void print_operator_typed(const eoFunctorBase& op, std::ostream& out)
+{
+ out << op.className();
+}
+
+void print_operator_typed(const double& op, std::ostream& out)
+{
+ out << op;
+}
+
+template
+void print_operators(const eoParam& param, eoOperatorFoundry& op_foundry, std::ostream& out = std::cout, std::string indent=" ")
+{
+ out << indent << op_foundry.size() << " " << param.longName() << ":" << std::endl;
+ for(size_t i=0; i < op_foundry.size(); ++i) {
+ out << indent << indent << i << ": ";
+ auto& op = op_foundry.instantiate(i);
+ print_operator_typed(op, out);
+ out << std::endl;
+ }
+}
+
+template
+void print_operators(const eoParam& param, T min, T max, std::ostream& out = std::cout, std::string indent=" ")
+{
+ out << indent << "[" << min << "," << max << "] " << param.longName() << "." << std::endl;
+}
+
+template