Compare commits

..

No commits in common. "master" and "feat+num_foundry" have entirely different histories.

341 changed files with 1292 additions and 13532 deletions

View file

@ -1,47 +0,0 @@
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}}

14
.gitignore vendored
View file

@ -1,20 +1,11 @@
# ignore generated files
# ignore html 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
@ -38,7 +29,4 @@ debug/*
build/*
website/EO_star.png
website/paradiseo_logo.png
Release/*
Debug/*
Build/*

33
AUTHORS
View file

@ -1,52 +1,41 @@
Current maintainers
===================
Arnaud Liefooghe <arnaud.liefooghe@univ-lille1.fr>
Clive Canape <clive.canape@inria.fr>
Johann Dreo <johann@dreo.fr>
Sébastien Verel <sebastien.verel@inria.fr>
Active developpers
==================
Alexandre Quemy <alexandre.quemy@inria.fr>
Benjamin Bouvier <bnjbouv@gmail.com>
Caner Candan <caner@candan.fr>
Pierre Savéant <pierre.saveant@thalesgroup.com>
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 <joost@dsj.nl>
Juan Julian Merelo Guervos
Jérémie Humeau
Jxtopher
Karima Boufaras
legillono
Leo Bertheas
legillon
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

View file

@ -13,24 +13,13 @@ cmake_minimum_required(VERSION 3.10 FATAL_ERROR)
## Name
project("ParadisEO"
VERSION 3.1.3
VERSION 3.0.0
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
@ -63,16 +52,16 @@ include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Target.cmake)
######################################################################################
## Paths to sources of modules
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( 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(PROBLEMS_SRC_DIR "${PROJECT_SOURCE_DIR}/problems" CACHE INTERNAL "Problems dependant source directory" FORCE)
set(PROBLEMS_SRC_DIR "${CMAKE_SOURCE_DIR}/problems" CACHE INTERNAL "Problems dependant source directory" FORCE)
set(CMAKE_BASE_SOURCE_DIR ${PROJECT_SOURCE_DIR})
set(CMAKE_BASE_SOURCE_DIR ${CMAKE_SOURCE_DIR})
# All libraries are built in <build_dir>/lib/
set( EO_BIN_DIR "${CMAKE_BINARY_DIR}" CACHE INTERNAL "ParadisEO-EO binary directory" FORCE)
@ -92,34 +81,31 @@ set(SMP "false" CACHE BOOL "Build the SMP module")
set(MPI "false" CACHE BOOL "Build the MPI module")
## EO Module
set(MODULE_NAME "Paradiseo")
set(DOXYGEN_CONFIG_DIR ${CMAKE_CURRENT_SOURCE_DIR}/doxygen)
# set(EO_MODULE_NAME "Evolving Objects")
set(EO_MODULE_NAME "Evolving Object")
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(MODULE_NAME "Moving Objects")
set(MO_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()

View file

@ -2,8 +2,7 @@
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.
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
@ -19,11 +18,6 @@ Paradiseo use the CMake build system, so building it should be as simple as:
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
-------
@ -193,13 +187,13 @@ Examples and lessons are generated when `ENABLE_CMAKE_EXAMPLE` is set.
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: `<module>Lesson<number>`.
For instance, make `moLesson4` will build the Lesson 4 from the MO module.
For instance, make `moLesson4` will build the Lesson 4 from the MO module.
Easy, isn't it ?
Tests
-----
By performing tests, you can check your installation.
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 `ENABLE_CMAKE_TESTING` when you run cmake.

10
LICENSE
View file

@ -1,10 +0,0 @@
ParadisEO modules have different licenses, see LICENSE files in each directories:
- eo : LGPL v2.1
- edo : LGPL v2.1
- mo : CeCILL v2+ (GPL-like)
- moeo: CeCILL v2+ (GPL-like)
- smp : CeCILL v2+ (GPL-like)
- problem: depend on each file (usually CeCILL).
You may also double check the headers of source code files.

View file

@ -8,9 +8,7 @@ It focus on the efficiency of the implementation of solvers, by providing:
- tools for ***automated design and selection*** of algorithms,
- a focus on ***speed*** and several ***parallelization*** options.
<div align="center">
<img width="640" alt="Paradiseo logo" src="https://raw.githubusercontent.com/nojhan/paradiseo/master/docs/img/paradiseo_logo_dark.svg"/>
</div>
![Paradiseo logo](https://github.com/nojhan/paradiseo/blob/master/website/paradiseo_logo_200px_dark.png)
# Quick Start
@ -168,7 +166,7 @@ It is, for instance, easy to start with a simple local search, then add multi-ob
Paradiseo is mainly developed under Linux operating systems, where its dependencies and the C++ toolchain are easy to install. Recent versions have been tested with gcc and clang compilers.
Stable versions should however work on Windows and any Unix-like operating system with a standard-conforming C++ development system.
Stable versions should however work on Windows and any Unix-like operating system with a standard-conforming C++ development system.
# Code
@ -195,7 +193,7 @@ The build chain uses the classical workflow of CMake. The recommended method is
Under Linux, the default is make, and a build command is straitghtforward: `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<option>=<value>` argument to cmake.
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<option>=<value>` argument to cmake.
**The first option to consider is `CMAKE_BUILD_TYPE`, which you most probably want to set to `Debug` (during development/tests) or `Release` (for production/validation).**
@ -208,13 +206,6 @@ If you `ENABLE_CMAKE_TESTING` and `BUILD_TESTING`, it will be the tests, which y
If you `ENABLE_CMAKE_EXAMPLE`, it will also build the examples.
If may want to make build scripts more verbose (especially when building the
doc) by enabling `CMAKE_VERBOSE_MAKEFILE`.
If `ccache` installed in your environment, it will try its best to re-use other compilations,
which may speed-up your builds if you manage several compatible builds at the same time.
To clear all cached objects, execute `ccache -C`.
## Licenses
Paradiseo is distributed under the GNU Lesser General Public License and the CeCILL license (depending on the modules).
@ -239,35 +230,11 @@ For academic articles, books, more tutorials, presentations slides,
real life example of solvers and contact information,
please see the web site (available in `paradiseo/website/index.html`).
There is also an [online wiki](https://gitlab.inria.fr/paradiseo/paradiseo/-/wikis/home)
# Citing Paradiseo
If you use Paradiseo, please cite the following publication:
Johann Dreo, Arnaud Liefooghe, Sébastien Verel, Marc Schoenauer, Juan J. Merelo, Alexandre Quemy, Benjamin Bouvier, and Jan Gmys, [Paradiseo: from a modular framework for evolutionary computation to the automated design of metaheuristics —22 years of Paradiseo—](https://doi.org/10.1145/3449726.3463276), GECCO'21: Proceedings of the Genetic and Evolutionary Computation Conference Companion, 15221530 (2021).
BiBTeX entry:
```
@inproceedings{Dreo-al_2021_Paradiseo,
author = {Dreo, Johann and Liefooghe, Arnaud and Verel, S\'{e}bastien and Schoenauer, Marc and Merelo, Juan J. and Quemy, Alexandre and Bouvier, Benjamin and Gmys, Jan},
title = {Paradiseo: From a Modular Framework for Evolutionary Computation to the Automated Design of Metaheuristics: 22 Years of Paradiseo},
year = {2021},
isbn = {9781450383516},
publisher = {Association for Computing Machinery},
address = {Online conference},
url = {https://doi.org/10.1145/3449726.3463276},
booktitle = {Proceedings of the Genetic and Evolutionary Computation Conference Companion},
pages = {15221530},
numpages = {9}
}
```
# Contact
For further information about ParadisEO, help or to report any
problem, you can either:
- Chat with us on our Matrix chatroom: https://app.element.io/#/room/#paradiseo:matrix.org
- Post an issue: https://github.com/nojhan/paradiseo/issues
problem, you can send an e-mail to: `paradiseo-help@lists.gforge.inria.fr`

View file

@ -27,7 +27,7 @@ if(DOXYGEN_FOUND AND DOXYGEN_EXECUTABLE)
# set(DOC_SMP "")
# endif()
# if(MPI)
# set(DOC_MPI "make doc-mpi")
# set(DOC_MPI "make doc-mpi")
# else()
# set(DOC_MPI "")
# endif()
@ -78,7 +78,7 @@ if(DOXYGEN_FOUND AND DOXYGEN_EXECUTABLE)
COMMAND make doc-eo
COMMAND make doc-mo
COMMAND make doc-moeo
# COMMAND make doc-mpi
COMMAND make doc-mpi
)
endif()
@ -89,7 +89,7 @@ if(DOXYGEN_FOUND AND DOXYGEN_EXECUTABLE)
COMMAND make doc-mo
COMMAND make doc-moeo
COMMAND make doc-smp
# COMMAND make doc-mpi
COMMAND make doc-mpi
)
endif()
if(EDO AND NOT SMP AND MPI)
@ -98,7 +98,7 @@ if(DOXYGEN_FOUND AND DOXYGEN_EXECUTABLE)
COMMAND make doc-mo
COMMAND make doc-moeo
COMMAND make doc-edo
# COMMAND make doc-mpi
COMMAND make doc-mpi
)
endif()
if(EDO AND SMP AND NOT MPI)
@ -119,7 +119,7 @@ if(DOXYGEN_FOUND AND DOXYGEN_EXECUTABLE)
COMMAND make doc-moeo
COMMAND make doc-edo
COMMAND make doc-smp
# COMMAND make doc-mpi
COMMAND make doc-mpi
)
endif()
@ -131,7 +131,7 @@ endif(DOXYGEN_FOUND AND DOXYGEN_EXECUTABLE)
######################################################################################
if(PROFILING)
find_program(LCOV
find_program(LCOV
NAMES lcov
PATHS
"/usr/local/bin /usr/bin [HKEY_LOCAL_MACHINE\\SOFTWARE\\Rational Software\\Purify\\Setup;InstallFolder] [HKEY_CURRENT_USER\\Software]"

View file

@ -28,9 +28,9 @@
<p>Shortcuts:</p>
<ul>
<li><a href="#Why">Why choosing <em class="logo">Paradis<span class="logo_eo">eo</span></em>?</a></li>
<li><a href="https://github.com/nojhan/paradiseo/releases">Downloads</a></li>
<li><a href="https://github.com/nojhan/paradiseo">Git repository</a></li>
<li><a href="https://app.element.io/#/room/#paradiseo:matrix.org">Chat with us</a></li>
<li><a href="https://gforge.inria.fr/frs/?group_id=145">Downloads</a></li>
<li><a href="https://gforge.inria.fr/scm/?group_id=145">Git repository</a></li>
<li><a href="http://irc.lc/freenode/paradiseo">Chat with us</a></li>
</ul>
</div>
@ -125,9 +125,9 @@
<div id="Download">
<h2><a name="Download"></a>Download</h2>
Download the <a href="https://github.com/nojhan/paradiseo/releases">latest stable release</a>.
Download the <a href="https://gforge.inria.fr/frs/download.php/31733/Paradiseo-2.0.1.zip">latest stable release</a>.
<p>Or clone the latest version: <code class="command">git clone https://github.com/nojhan/paradiseo.git</code></p>
<p>Or clone the latest version: <code class="command">git clone git://scm.gforge.inria.fr/paradiseo/paradiseo.git</code></p>
</div>
<div id="Build">
@ -147,9 +147,7 @@
<div id="Develop">
<h2><a name="Develop"></a>Develop</h2>
<!--
<p>Download the <a href="https://gforge.inria.fr/frs/download.php/31755/QuickStart.zip">quick start project template</a>, edit the <code>CMakeLists.txt</code> file to indicate where to find <em class="logo">Paradis<span class="logo_eo">eo</span></em> and start developing your own solver.</p>
-->
<p>To show you how does a <em class="logo">Paradis<span class="logo_eo">eo</span></em> code look, you will find here a minimal implementation of the popular <a href="https://en.wikipedia.org/wiki/CMA-ES">CMA-ES algorithm</a>.</p>
@ -238,7 +236,7 @@
answers is to send an email to <a href='mailto:paradiseo-help@lists.gforge.inria.fr'>paradiseo-help@lists.gforge.inria.fr</a>. You can also <a href='http://lists.gforge.inria.fr/pipermail/paradiseo-help/'>consult the help archives</a>, subscribe to our <a href='http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/paradiseo-users'>(low traffic) mailing-list</a> or <a href='http://lists.gforge.inria.fr/pipermail/paradiseo-users/'>consult its archives</a>.
</p>
<p>Alternatively, you can join us on the official chatroom. You can try the <a href="https://app.element.io/#/room/#paradiseo:matrix.org">online webchat app</a>, or if you already use <a href="https://element.io">Element.io</a>, you can directly connect to the <em>#paradiseo:matrix.org</em> multi-user chatroom with your favorite client.</p>
<p>Alternatively, you can join us on the official chatroom. You can try our <a href="http://irc.lc/freenode/paradiseo">webchat interface</a>, or if you already use IRC, you can directly connect to the <a href="irc://irc.freenode.org/#paradiseo">irc.freenode.org/#paradiseo</a> multi-user chatroom with your favorite client.</p>
</div>
</div>
@ -302,7 +300,7 @@
<div id="Why_efficiency">
<h3>Efficient</h3>
<p class="excerpt"><em class="logo">Paradis<span class="logo_eo">eo</span></em> is <em>the fastest</em> framework on the market, which is a crucial feature for modern and robust approach to solver <em>design and validation</em> (especially on combinatorial problems).</p>
<p class="excerpt"><em class="logo">Paradis<span class="logo_eo">eo</span></em> is <em>the fastest</em> framework on the market, which is a crucial feature for modern and robust approach to solver <em>design and validation</em>.</p>
</div>
<div id="Why_efficiency_details">
@ -311,7 +309,6 @@
<p>Another classical criticism against <em class="logo">Paradis<span class="logo_eo">eo</span></em> is that C++ is hard and that a fast language is useless because speed is not a concern when your objective function is dominating all the runtime.</p>
<p>However, we argue that:
<ul>
<li>The numerical optimization community often sees objective functions as monolithic “black-box”, but in combinatorial opimization, it is very often the case that the objective function can be only partially evaluated on neighbor solutions, which allows for (tremendous) speed gains. The Paradiseo-mo module is architectured around that idea, a feature that is not so often found in other frameworks.</li>
<li>During the design phase of your solver, you will need to estimate its performance against synthetic benchmarks that are fast to compute. In that case, fast computation means fast design iterations. And it's even more true if you plan to use automated design to find the best solver for your problem.</li>
<li>Modern C++ makes use of the very same high-level abstractions you would find in more accepted languages like Python. Sure, the syntax is cumbersome, but you will not see it after a while, given that you will work at the algorithm level.</li>
<li>C++ provides full type checking and the largest set of tooling for any modern language, which are your first line of defense against long-term bugs. Sure, it sometimes gives you the impression that you fight against the compiler, but chasing subtle interface bugs across a complex Python code is even harder.</li>
@ -811,32 +808,18 @@
<ul>
<li>
<p>The latest state of the whole <em class="logo">Paradis<span class="logo_eo">eo</span></em> framework is introduced in the following article (see also <a href="https://arxiv.org/abs/2105.00420">the preprint</a>):
<blockquote>Johann Dreo, Arnaud Liefooghe, Sébastien Verel, Marc Schoenauer, Juan J. Merelo, Alexandre Quemy, Benjamin Bouvier, and Jan Gmys,
<a href= "https://doi.org/10.1145/3449726.3463276">Paradiseo: from a modular framework for evolutionary computation to the automated design of metaheuristics —22 years of Paradiseo—</a>, <i>GECCO'21: Proceedings of the Genetic and Evolutionary Computation Conference Companion</i>, 15221530 (2021).</blockquote>
<p>The core EO module is described in the following scientific article:
<blockquote>M. Keijzer, J.J. Merelo, G. Romero, G., M. Schoenauer,
<a href= "http://www.lri.fr/~marc/EO/EO-EA01.ps.gz">Evolving
objects: A general purpose evolutionary computation
library</a>, <i>Artificial Evolution</i>, <b>2310</b>, 829--888 (2002).</blockquote>
</p>
<button class="collapsible">BiBTeX entry for citing <em class="logo">Paradis<span class="logo_eo">eo</span></em></button>
<button class="collapsible">BiBTeX entry for citing EO</button>
<div class="details">
<p>If you used <em class="logo">Paradis<span class="logo_eo">eo</span></em> in a study, please cite the publication above:</p>
<p>If you used EO in a study, please cite it. As of today, it has been <a href="https://scholar.google.com/scholar?cites=900770489172177244&as_sdt=2005&sciodt=0,5&hl=fr">cited more than 250 times.</a></p>
<figure style="text-align:left;">
<p>
<font face="monospace">
@<font color="#f917f3">inproceedings</font>{<font color="#519f50">Dreo-al_2021_Paradiseo</font>,<br>
&nbsp;&nbsp;&nbsp;&nbsp;<font color="#da4939"><b>author</b></font>&nbsp;&nbsp;&nbsp;&nbsp;=&nbsp;{Dreo, Johann and Liefooghe, Arnaud and Verel, S\'{e}bastien and Schoenauer, Marc and Merelo, Juan J. and Quemy, Alexandre and Bouvier, Benjamin and Gmys, Jan},<br>
&nbsp;&nbsp;&nbsp;&nbsp;<font color="#da4939"><b>title</b></font>&nbsp;&nbsp;&nbsp;&nbsp; =&nbsp;{Paradiseo: From a Modular Framework for Evolutionary Computation to the Automated Design of Metaheuristics: 22 Years of Paradiseo},<br>
&nbsp;&nbsp;&nbsp;&nbsp;<font color="#da4939"><b>year</b></font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=&nbsp;{2021},<br>
&nbsp;&nbsp;&nbsp;&nbsp;<font color="#da4939"><b>isbn</b></font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=&nbsp;{9781450383516},<br>
&nbsp;&nbsp;&nbsp;&nbsp;<font color="#da4939"><b>publisher</b></font>&nbsp;=&nbsp;{Association for Computing Machinery},<br>
&nbsp;&nbsp;&nbsp;&nbsp;<font color="#da4939"><b>address</b></font>&nbsp;&nbsp; =&nbsp;{Online conference},<br>
&nbsp;&nbsp;&nbsp;&nbsp;<font color="#da4939"><b>url</b></font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&nbsp;{<a href="https://doi.org/10.1145/3449726.3463276},">https://doi.org/10.1145/3449726.3463276},</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;<font color="#da4939"><b>booktitle</b></font>&nbsp;=&nbsp;{Proceedings of the Genetic and Evolutionary Computation Conference Companion},<br>
&nbsp;&nbsp;&nbsp;&nbsp;<font color="#da4939"><b>pages</b></font>&nbsp;&nbsp;&nbsp;&nbsp; =&nbsp;{15221530},<br>
&nbsp;&nbsp;&nbsp;&nbsp;<font color="#6d9cbe">numpages</font>&nbsp;&nbsp;=&nbsp;{9}<br>
}<br>
</font>
<!--
<font face="monospace">
@<font color="#0000ff">Article</font>{<font color="#ff00ff">Keijzer2001</font>,<br/>
&nbsp;&nbsp;<font color="#a52a2a">title</font>&nbsp;=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;Evolving Objects: A General Purpose Evolutionary Computation Library &quot;,<br/>
@ -848,25 +831,21 @@
&nbsp;&nbsp;<font color="#a020f0">keywords</font>&nbsp;=&nbsp; &quot;genetic algorithms, genetic programming, evolutionary computation, metaheuristic, computational intelligence, optimization&quot;,<br/>
&nbsp;&nbsp;<font color="#a020f0">URL</font>&nbsp;=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;<a href="http://www.lri.fr/~marc/EO/EO-EA01.ps.gz">http://www.lri.fr/~marc/EO/EO-EA01.ps.gz</a>&quot;,<br/>
&nbsp;&nbsp;<font color="#ff00ff">size</font>&nbsp;=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;12 pages&quot;,<br/>
<!-- &nbsp;&nbsp;<font color="#a020f0">abstract</font>&nbsp;=&nbsp; &quot;This paper presents the evolving objects library<br/> -->
<!-- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (EOlib), an object-oriented framework for evolutionary<br/> -->
<!-- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; computation (EC)&nbsp;that aims to provide a flexible set of<br/> -->
<!-- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; classes to build EC applications. EOlib design<br/> -->
<!-- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; objective is to be able to evolve any object in which<br/> -->
<!-- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fitness makes sense.&quot;,<br/> -->
}<br/>
<br/>
</font>
-->
</p>
<figcaption></figcaption>
</figure>
</div>
</li>
<li>
<p>The core EO module is described in the following scientific article:
<blockquote>M. Keijzer, J.J. Merelo, G. Romero, G., M. Schoenauer,
<a href= "http://www.lri.fr/~marc/EO/EO-EA01.ps.gz">Evolving
objects: A general purpose evolutionary computation
library</a>, <i>Artificial Evolution</i>, <b>2310</b>, 829--888 (2002).</blockquote>
</p>
</li>
<!-- <li> -->
<!-- <p>The parallelization modules have been described in: -->
<!-- <blockquote>S. Cahon, N. Melab and E-G. Talbi, <a href="http://www.springerlink.com/content/up02m74726v1526u/"><em class="logo">Paradis<span class="logo_eo">eo</span></em>: A Framework for the Reusable Design of Parallel and Distributed Metaheuristics</a>, Journal of Heuristics, vol. 10(3), pp.357-380, May 2004.</blockquote> -->
@ -927,31 +906,10 @@ ISBN: 978-0-470-27858-1</blockquote>
<ul class="publications">
</ul>
<h3>Accelerator Physics</h3>
<ul>
<li>E. Valetov, G. Dal Maso, P-R. Kettle, A. Knecht, A. Papa, on behalf of the HIMB Project. <a href="https://doi.org/10.3390/particles7030039">Beamline Optimisation for High-Intensity Muon Beams at PSI Using the Heterogeneous Island Model</a>. <i>Particles</i> (2024), <i>7</i>, 683-691.</li>
</ul>
<h3>Bioinformatics</h3>
<ul>
<li> Emile Zakiev, Johann Dreo, Mara Santarelli, Benno Schwikowski, <a href="https://hal.science/hal-04110700">Statistical Discovery of Transcriptomic Cancer Signatures using Multimodal Local Search</a>, <i>PGMO Days</i> (2022).</li>
</ul>
<h3>Metaheuristics Design</h3>
<ul>
<li>Johann Dreo, Carola Doerr, Amine Aziz-Alaoui, Alix Zheng, <a href="https://hal.science/hal-04110704/document">Using irace, paradiseo and iohprofiler for large-scale algorithm configuration</a>, <i>8th COnfiguration and SElection of ALgorithms (COSEAL) workshop</i> (2021).</li>
<li>Amine Aziz-Alaoui, Carola Doerr, Johann Dreo, <a href="https://arxiv.org/abs/2102.06435">Towards large scale automated algorithm design by integrating modular benchmarking frameworks</a>, <i>Proceedings of the Genetic and Evolutionary Computation Conference Companion</i> (2021).</li>
<li>Johann Dréo, Carola Doerr, Yann Semet, <a href="https://hal.sorbonne-universite.fr/hal-02179604/document">Coupling the design of benchmark with algorithm in landscape-aware solver design</a>, <i>Proceedings of the Genetic and Evolutionary Computation Conference Companion</i> (2019).</li>
<li>Johann Dreo, <a href="https://dl.acm.org/doi/10.1145/1570256.1570301">Using Performance Fronts for Parameter Setting of Stochastic Metaheuristics</a>, <i>Genetic and Evolutionary Computation Conference</i>, (2009).</li>
</ul>
<h3>Automated Planning</h3>
<ul>
<li>Mostepha Redouane Khouadjia, Marc Schoenauer, Vincent Vidal, Johann Dreo, Pierre Savéant, <a href="https://arxiv.org/abs/1305.2265v1">Quality measures of parameter tuning for aggregated multi-objective temporal planning</a>, <i>7th International Conference on Learning and Intelligent Optimization (LION 7)</i> (2013).</li>
<li>Mostepha Redouane Khouadjia, Marc Schoenauer, Vincent Vidal, Johann Dreo, Pierre Savéant, <a href="https://arxiv.org/abs/1305.1169v1">Multi-Objective AI Planning: Comparing Aggregation and Pareto Approaches</a>, <i>Conference on Evolutionary Computation in Combinatorial Optimization (EvoCOP)</i> (2013).</li>
<li>Mostepha Redouane Khouadjia, Marc Schoenauer, Vincent Vidal, Johann Dreo, Pierre Savéant, <a href="https://arxiv.org/abs/1212.5276">Multi-Objective AI Planning: Evaluating DAE-YAHSP on a Tunable Benchmark</a>, <i>7th International Conference on Evolutionary Multi-Criterion Optimization</i> (2013).</li>
<li>Jacques Bibaï, Pierre Savéant, Marc Schoenauer, Vincent Vidal, <a href="http://www.aaai.org/ocs/index.php/ICAPS/ICAPS10/paper/view/1414">An Evolutionary Metaheuristic Based on State Decomposition for Domain-Independent Satisficing Planning</a>, <i>Twentieth International Conference on Automated Planning and Scheduling </i> (2010). <strong>Winner of the International Planning Competition</strong></li>
<li>Jacques Bibaï, Pierre Savéant, Marc Schoenauer, Vincent Vidal, <a href="">An Evolutionary Metaheuristic for Domain-Independent Satisficing Planning</a>, <i>Genetic and Evolutionary Computation Conference</i> (2010). <strong>Silver Medal at the Human-Competitive Competition</strong></li>
<li>Jacques Bibaï, Pierre Savéant, Marc Schoenauer, Vincent Vidal, <a href="">An Evolutionary Metaheuristic for Domain-Independent Satisficing Planning</a>, <i>Genetic and Evolutionary Computation Conference</i> (2010). <strong>Silver Medal at the Human-Competitive Competition</strong></li>
</ul>
@ -1015,6 +973,11 @@ undiscovered knowledge.
physics/0603108 (2006)</a>.</li>
</ul>
<h3>Metaheuristics Design</h3>
<ul>
<li>Johann Dreo, <a href="https://dl.acm.org/doi/10.1145/1570256.1570301">Using Performance Fronts for Parameter Setting of Stochastic Metaheuristics</a>, <i>Genetic and Evolutionary Computation Conference</i>, (2009).</li>
</ul>
</div>
</div>
@ -1169,17 +1132,16 @@ undiscovered knowledge.
<div id="Downloads">
<h2><a name="Downloads"></a>Downloads</h2>
<p>The current stable release is version: <a href="https://github.com/nojhan/paradiseo/releases">Paradiseo 3.1.3</a>. Some other releases (older or newer) can be found on <a href="https://github.com/nojhan/paradiseo/tags">GitHub/paradiseo/releases</a>.</p>
<p>The current stable release is version 2.0.1: <a href="https://gforge.inria.fr/frs/download.php/31733/Paradiseo-2.0.1.ziph">ParadisEO 2.0.1</a>. Some other releases (older or newer) can be found on <a href="https://github.com/nojhan/paradiseo/releases">GitHub/paradiseo/releases</a>.</p>
<p> You can obtain the latest stable and beta version directly via the Git repository:
<code class="command">git clone https://github.com/jdreo/paradiseo.git</code>.
<p> You can obtain the latest stable and beta version directly via the official Git repository:
<code class="command">git clone git://scm.gforge.inria.fr/paradiseo/paradiseo.git</code>.
The release are on the "master" branch.
</p>
<p>Or you can use (at your own risks) the development repositories of the developers:
<ul>
<li>Johann Dreo's: <a href="https://github.com/jdreo/paradiseo">on GitHub</a>.</li>
<li>INRIA's: <a href="https://gitlab.inria.fr/paradiseo/paradiseo">on their Gitlab</a>.</li>
<li>Johann Dreo's: <a href="https://github.com/nojhan/paradiseo">on GitHub</b>.</li>
</ul>
</p>
</div>
@ -1221,7 +1183,7 @@ undiscovered knowledge.
</p>
<p>There is, however, several build options which you may want to switch.
To see them, we recommend the use of a CMake gui, like <code>ccmake</code> (available through the <code>cmake-curses-gui</code> package in Debian/Ubuntu) or <a href="https://cmake.org/cmake/help/latest/guide/user-interaction/index.html#cmake-gui-tool">cmake-gui</a>.
To see them, we recommend the use of a CMake gui, like <code>ccmake</code> or <code>cmake-gui</code>.
On the command line, you can see the available options with: <code class="command">cmake -LH ..</code>.
Those options can be set with the <code>-D&lt;option&gt;=&lt;value&gt;</code> argument to cmake.
</p>
@ -1252,7 +1214,7 @@ undiscovered knowledge.
<h2><a name="Contribute"></a>Contribute</h2>
<p><em class="logo">Paradis<span class="logo_eo">eo</span></em> development is open and contributions are welcomed.</p>
<p>The official bug tracker is available on the <a href="https://github.com/nojhan/paradiseo/issues">project page</a>.</p>
<p>The official bug tracker is available on the <a href="https://gforge.inria.fr/projects/paradiseo/">project page</a>. But you may be more confortable using the <a href="https://github.com/nojhan/paradiseo/issues">issue tracker of Johann Dreo's project page on GitHub</a>.</p>
<p>If you have any question about contributing: subscribe to our <a href='http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/paradiseo-users'>(low traffic) mailing-list</a>.</p>
</div>
@ -1269,8 +1231,7 @@ undiscovered knowledge.
<ul>
<li><a href="https://www.inria.fr">INRIA</a> (current maintainer)</li>
<li><a href="https://www.univ-littoral.fr/">University of the Littoral Opal Coast</a> (current maintainer)</li>
<li><a href="https://www.pasteur.fr/">Institut Pasteur</a> (current maintainer)</li>
<li><a href="https://thalesgroup.com">Thales group</a></li>
<li><a href="https://thalesgroup.com">Thales</a> (current maintainer)</li>
<li><a href="https://www.polytechnique.edu/">École Polytechnique</a></li>
<li><a href="https://www.ugr.es">University of Granada</a></li>
<li><a href="https://www.vu.nl">Vrije Universiteit Amsterdam</a></li>

View file

@ -1,226 +0,0 @@
<doxygenlayout version="1.0">
<!-- Generated by doxygen 1.8.17 -->
<!-- Navigation index tabs for HTML output -->
<navindex>
<tab type="mainpage" visible="yes" title=""/>
<tab type="pages" visible="yes" title="" intro=""/>
<tab type="modules" visible="yes" title="" intro=""/>
<tab type="namespaces" visible="yes" title="">
<tab type="namespacelist" visible="yes" title="" intro=""/>
<tab type="namespacemembers" visible="yes" title="" intro=""/>
</tab>
<tab type="interfaces" visible="yes" title="">
<tab type="interfacelist" visible="yes" title="" intro=""/>
<tab type="interfaceindex" visible="$ALPHABETICAL_INDEX" title=""/>
<tab type="interfacehierarchy" visible="yes" title="" intro=""/>
</tab>
<tab type="classes" visible="yes" title="">
<tab type="classlist" visible="yes" title="" intro=""/>
<tab type="classindex" visible="$ALPHABETICAL_INDEX" title=""/>
<tab type="hierarchy" visible="yes" title="" intro=""/>
<tab type="classmembers" visible="yes" title="" intro=""/>
</tab>
<tab type="structs" visible="yes" title="">
<tab type="structlist" visible="yes" title="" intro=""/>
<tab type="structindex" visible="$ALPHABETICAL_INDEX" title=""/>
</tab>
<tab type="exceptions" visible="yes" title="">
<tab type="exceptionlist" visible="yes" title="" intro=""/>
<tab type="exceptionindex" visible="$ALPHABETICAL_INDEX" title=""/>
<tab type="exceptionhierarchy" visible="yes" title="" intro=""/>
</tab>
<tab type="files" visible="yes" title="">
<tab type="filelist" visible="yes" title="" intro=""/>
<tab type="globals" visible="yes" title="" intro=""/>
</tab>
<tab type="examples" visible="yes" title="" intro=""/>
</navindex>
<!-- Layout definition for a class page -->
<class>
<briefdescription visible="yes"/>
<includes visible="$SHOW_INCLUDE_FILES"/>
<inheritancegraph visible="$CLASS_GRAPH"/>
<collaborationgraph visible="$COLLABORATION_GRAPH"/>
<detaileddescription title=""/>
<memberdecl>
<publicmethods title=""/>
<publicstaticmethods title=""/>
<publicattributes title=""/>
<publicstaticattributes title=""/>
<protectedtypes title=""/>
<protectedslots title=""/>
<protectedmethods title=""/>
<protectedstaticmethods title=""/>
<protectedattributes title=""/>
<protectedstaticattributes title=""/>
<nestedclasses visible="yes" title=""/>
<publictypes title=""/>
<services title=""/>
<interfaces title=""/>
<publicslots title=""/>
<signals title=""/>
<packagetypes title=""/>
<packagemethods title=""/>
<packagestaticmethods title=""/>
<packageattributes title=""/>
<packagestaticattributes title=""/>
<properties title=""/>
<events title=""/>
<privatetypes title=""/>
<privateslots title=""/>
<privatemethods title=""/>
<privatestaticmethods title=""/>
<privateattributes title=""/>
<privatestaticattributes title=""/>
<friends title=""/>
<related title="" subtitle=""/>
<membergroups visible="yes"/>
</memberdecl>
<memberdef>
<constructors title=""/>
<functions title=""/>
<related title=""/>
<variables title=""/>
<properties title=""/>
<inlineclasses title=""/>
<typedefs title=""/>
<enums title=""/>
<services title=""/>
<interfaces title=""/>
<events title=""/>
</memberdef>
<allmemberslink visible="yes"/>
<usedfiles visible="$SHOW_USED_FILES"/>
<authorsection visible="yes"/>
</class>
<!-- Layout definition for a namespace page -->
<namespace>
<briefdescription visible="yes"/>
<detaileddescription title=""/>
<memberdecl>
<nestednamespaces visible="yes" title=""/>
<constantgroups visible="yes" title=""/>
<interfaces visible="yes" title=""/>
<classes visible="yes" title=""/>
<structs visible="yes" title=""/>
<exceptions visible="yes" title=""/>
<typedefs title=""/>
<sequences title=""/>
<dictionaries title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
<membergroups visible="yes"/>
</memberdecl>
<memberdef>
<inlineclasses title=""/>
<typedefs title=""/>
<sequences title=""/>
<dictionaries title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
</memberdef>
<authorsection visible="yes"/>
</namespace>
<!-- Layout definition for a file page -->
<file>
<briefdescription visible="yes"/>
<includes visible="$SHOW_INCLUDE_FILES"/>
<includegraph visible="$INCLUDE_GRAPH"/>
<includedbygraph visible="$INCLUDED_BY_GRAPH"/>
<sourcelink visible="yes"/>
<detaileddescription title=""/>
<memberdecl>
<interfaces visible="yes" title=""/>
<classes visible="yes" title=""/>
<structs visible="yes" title=""/>
<exceptions visible="yes" title=""/>
<namespaces visible="yes" title=""/>
<constantgroups visible="yes" title=""/>
<defines title=""/>
<typedefs title=""/>
<sequences title=""/>
<dictionaries title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
<membergroups visible="yes"/>
</memberdecl>
<memberdef>
<inlineclasses title=""/>
<defines title=""/>
<typedefs title=""/>
<sequences title=""/>
<dictionaries title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
</memberdef>
<authorsection/>
</file>
<!-- Layout definition for a group page -->
<group>
<briefdescription visible="yes"/>
<groupgraph visible="$GROUP_GRAPHS"/>
<detaileddescription title=""/>
<memberdecl>
<nestedgroups visible="yes" title=""/>
<namespaces visible="yes" title=""/>
<functions title=""/>
<classes visible="yes" title=""/>
<defines title=""/>
<typedefs title=""/>
<dirs visible="yes" title=""/>
<files visible="yes" title=""/>
<sequences title=""/>
<dictionaries title=""/>
<enums title=""/>
<enumvalues title=""/>
<variables title=""/>
<signals title=""/>
<publicslots title=""/>
<protectedslots title=""/>
<privateslots title=""/>
<events title=""/>
<properties title=""/>
<friends title=""/>
<membergroups visible="yes"/>
</memberdecl>
<memberdef>
<pagedocs/>
<inlineclasses title=""/>
<defines title=""/>
<typedefs title=""/>
<sequences title=""/>
<dictionaries title=""/>
<enums title=""/>
<enumvalues title=""/>
<functions title=""/>
<variables title=""/>
<signals title=""/>
<publicslots title=""/>
<protectedslots title=""/>
<privateslots title=""/>
<events title=""/>
<properties title=""/>
<friends title=""/>
</memberdef>
<authorsection visible="yes"/>
</group>
<!-- Layout definition for a directory page -->
<directory>
<briefdescription visible="yes"/>
<directorygraph visible="yes"/>
<detaileddescription title=""/>
<memberdecl>
<dirs visible="yes"/>
<files visible="yes"/>
</memberdecl>
</directory>
</doxygenlayout>

View file

@ -1,791 +0,0 @@
/* 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%;
}

View file

@ -1,502 +0,0 @@
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.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
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.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

View file

@ -22,8 +22,7 @@ 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("${DOXYGEN_CONFIG_DIR}/doxyfile.cmake"
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/${EDO_DOC_CONFIG_FILE}.cmake"
"${EDO_DOC_DIR}/${EDO_DOC_CONFIG_FILE}")
install(
DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}

View file

@ -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 = @EDO_MODULE_NAME@
PROJECT_NAME = @PACKAGE_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 = @PROJECT_VERSION@
PROJECT_NUMBER = @PACKAGE_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 = NO
GENERATE_LATEX = YES
# 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

View file

@ -45,7 +45,7 @@ class edoEstimatorAdaptive : public edoEstimator<D>
public:
typedef typename D::EOType EOType;
edoEstimatorAdaptive( D& distrib ) : _distrib(distrib) {}
edoEstimatorAdaptive<D>( D& distrib ) : _distrib(distrib) {}
// virtual D operator() ( eoPop< EOT >& )=0 (provided by eoUF< A1, R >)

View file

@ -41,12 +41,12 @@ class edoEstimatorAdaptiveReset : public edoEstimatorAdaptive<D>
public:
typedef typename D::EOType EOType;
edoEstimatorAdaptiveReset( D& distrib ) :
edoEstimatorAdaptiveReset<D>( D& distrib ) :
edoEstimatorAdaptive<D>(distrib),
_dim(0)
{ }
edoEstimatorAdaptiveReset( D& distrib, size_t dim ) :
edoEstimatorAdaptiveReset<D>( D& distrib, size_t dim ) :
edoEstimatorAdaptive<D>(distrib),
_dim(dim)
{ }

View file

@ -43,12 +43,12 @@ class edoEstimatorCombinedAdaptive : public edoEstimatorAdaptive<D>, public std:
public:
typedef typename D::EOType EOType;
edoEstimatorCombinedAdaptive( D& distrib, edoEstimator<D>& estim) :
edoEstimatorCombinedAdaptive<D>( D& distrib, edoEstimator<D>& estim) :
edoEstimatorAdaptive<D>(distrib),
std::vector<edoEstimator<D>*>(1,&estim)
{}
edoEstimatorCombinedAdaptive( D& distrib, std::vector<edoEstimator<D>*> estims) :
edoEstimatorCombinedAdaptive<D>( D& distrib, std::vector<edoEstimator<D>*> estims) :
edoEstimatorAdaptive<D>(distrib),
std::vector<edoEstimator<D>*>(estims)
{}
@ -78,11 +78,11 @@ class edoEstimatorCombinedStateless : public edoEstimatorCombinedAdaptive<D>
public:
typedef typename D::EOType EOType;
edoEstimatorCombinedStateless( edoEstimator<D>& estim ) :
edoEstimatorCombinedStateless<D>( edoEstimator<D>& estim ) :
edoEstimatorCombinedAdaptive<D>(*(new D), estim)
{}
edoEstimatorCombinedStateless( std::vector<edoEstimator<D>*> estims) :
edoEstimatorCombinedStateless<D>( std::vector<edoEstimator<D>*> estims) :
edoEstimatorCombinedAdaptive<D>(*(new D), estims)
{}

View file

@ -233,7 +233,7 @@ public:
Matrix mD = eigensolver.eigenvalues().asDiagonal();
// from variance to standard deviations
mD=mD.cwiseSqrt();
mD.cwiseSqrt();
d.scaling( mD.diagonal() );
d.coord_sys( eigensolver.eigenvectors() );

View file

@ -39,7 +39,7 @@ template < typename EOT >
class edoRepairerModulo: public edoRepairerApplyBinary<EOT>
{
public:
edoRepairerModulo( double denominator ) : edoRepairerApplyBinary<EOT>( std::fmod, denominator ) {}
edoRepairerModulo<EOT>( double denominator ) : edoRepairerApplyBinary<EOT>( std::fmod, denominator ) {}
};

View file

@ -76,7 +76,8 @@ edoFileSnapshot::edoFileSnapshot(std::string dirname,
s = " ";
}
(void)/*ignore returned*/ system(s.c_str());
int dummy;
dummy = system(s.c_str());
// all done
_descOfFiles = new std::ofstream( std::string(dirname + "/list_of_files.txt").c_str() );

View file

@ -108,12 +108,7 @@ public:
if (is) {
virus.resize(bits.size());
std::transform(bits.begin(), bits.end(), virus.begin(),
#if __cplusplus >= 201103L
std::bind(std::equal_to<char>(), std::placeholders::_1, '1'));
#else
// Deprecated since C++11.
std::bind2nd(std::equal_to<char>(), '1'));
#endif
}
}

View file

@ -70,9 +70,6 @@ endif()
######################################################################################
add_executable(fastga fastga.cpp)
# 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)
# target_link_libraries(fastga ${PARADISEO_LIBRARIES} ${IOH_LIBRARY} stdc++fs)
target_link_libraries(fastga ${PARADISEO_LIBRARIES} stdc++fs fmt)

View file

@ -1,80 +0,0 @@
#!/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}

View file

@ -1,86 +0,0 @@
#!/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<len(column)):
del column["pop-size"]
del column["offspring-size"]
configs=[(-1,-1)]*19 #tuple(auc,config)
res=np.zeros((nbparam,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)
pb=int(fastgadir.split("_")[0].split("=")[1])
new_auc=np.mean(average)
if(configs[pb][0]<new_auc):
configs[pb]=(new_auc,fastgadir)
for pb in range(19):
config=configs[pb][1].split("_")
configparam=[p.split("=")[1] for p in config[1:]]
res[:,pb]=configparam
ind=0 #index of param_name
for param_name in column.keys():
#print(map(str,res[ind]),res[ind], ",".join(map(str,res[ind])))
print(param_name+","+str(column[param_name])+",", ",".join(map(str,res[ind])))
ind+=1
#print(str(i)+",",",".join(map(str,np.mean(aucs[i],1))))
if("maxEv" 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(figdir)[0].split("_")))
if( nbparam<len(column)):
del column["pop-size"]
del column["offspring-size"]
configs=[(-1,-1)]*19 #tuple(auc,config)
bests=np.zeros((nbparam,19))
for algodir in os.listdir(figdir): #algodir : directory of one random algo
for fname in os.listdir(os.path.join(figdir,algodir,"data")): #fname : directory of 50 runs of fastga for one pb
average=[]
for res in os.listdir(os.path.join(figdir,algodir,"data",fname)):
with open(os.path.join(figdir,algodir,"data",fname,res)) as fd:
auc = float(fd.readlines()[0]) * -1
average.append(auc)
pb=int(fname.split("_")[0].split("=")[1])
new_auc=np.mean(average)
if(configs[pb][0]<new_auc):
configs[pb]=(new_auc,algodir)
for pb in range(19):
config=configs[pb][1].split("_")
configparam=[p.split("=")[1] for p in config]
bests[:,pb]=configparam
ind=0 #index of param_name
for param_name in column.keys():
#print(map(str,res[ind]),res[ind], ",".join(map(str,res[ind])))
print(param_name+","+str(column[param_name])+",", ",".join(map(str,bests[ind])))
ind+=1

View file

@ -1,40 +0,0 @@
#!/bin/bash
ldata="./fastga_results_all/" #fastga_results_all
figpath="./hist_and_csv/" #hist_and_csv
#get distribution of operators variants of all problems of each plan of fastga_results_all
#fastga_results_all contains all experiments of all plans
ldir=$(echo $(ls ${ldata})) #list of directory of each plan
for plan in ${ldir[@]} ; do #get the directory of each plan
lexperiment=$(echo $(ls ${ldata}/${plan}))
for experiments in ${lexperiment[@]} ; do
path="${ldata}/${plan}/${experiments}"
#----------------average aucs of each algo for each pb only for plan A,F,O ---------------
#myfig=${figpath}/auc_average_${plan}
#mkdir -p ${myfig}
#cmd="python3 parse_auc_average.py ${path} "
#$cmd > "${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---------------

View file

@ -1,16 +0,0 @@
#!/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

View file

@ -1,78 +0,0 @@
#!/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))))

View file

@ -1,87 +0,0 @@
#!/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))))

View file

@ -1,23 +0,0 @@
#!/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

View file

@ -1,34 +0,0 @@
#!/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

View file

@ -1,71 +0,0 @@
#!/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-20T1511+0200_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()

View file

@ -1,88 +0,0 @@
#!/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-20T1511+0200_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()

View file

@ -1,90 +0,0 @@
#!/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-20T1347+0200_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-20T1347+0200_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()

View file

@ -1,68 +0,0 @@
#!/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()

View file

@ -1,46 +0,0 @@
#!/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-20T1511+0200_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()

View file

@ -1,27 +0,0 @@
## 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

View file

@ -1,227 +0,0 @@
###################################################### -*- 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
############################################################################

View file

@ -1,12 +0,0 @@
# 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)

View file

@ -1,13 +0,0 @@
## 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)

View file

@ -1,89 +0,0 @@
#!/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

View file

@ -1,48 +0,0 @@
## 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

View file

@ -1,227 +0,0 @@
###################################################### -*- 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
############################################################################

View file

@ -1,12 +0,0 @@
# 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)

View file

@ -1,15 +0,0 @@
## 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)

View file

@ -1,96 +0,0 @@
#!/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

View file

@ -1,48 +0,0 @@
## 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

View file

@ -1,228 +0,0 @@
###################################################### -*- 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
############################################################################

View file

@ -1,10 +0,0 @@
# 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)

View file

@ -1,88 +0,0 @@
#!/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

View file

@ -1,140 +0,0 @@
#!/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-20T1511+0200_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")

View file

@ -1,31 +0,0 @@
#!/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(" ",""))

View file

@ -1,35 +0,0 @@
#!/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(" ",""))

View file

@ -1,35 +0,0 @@
#!/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(" ",""))

View file

@ -1,34 +0,0 @@
#!/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))))

View file

@ -1,34 +0,0 @@
#!/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)------------------------------"

View file

@ -1,25 +0,0 @@
#!/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

View file

@ -1,37 +0,0 @@
#!/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)---------------"

View file

@ -1,28 +0,0 @@
#!/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)

View file

@ -1,43 +0,0 @@
#!/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)---------------------"

View file

@ -1,23 +0,0 @@
#!/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

View file

@ -1,167 +0,0 @@
############################################
#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

View file

@ -1,55 +0,0 @@
#!/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")

View file

@ -1,61 +0,0 @@
#!/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

View file

@ -1,59 +0,0 @@
#!/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

View file

@ -1,64 +0,0 @@
#!/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

View file

@ -1,13 +0,0 @@
#!/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[@]}

View file

@ -1,67 +0,0 @@
#!/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) "

View file

@ -1,26 +0,0 @@
#!/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

View file

@ -1,18 +0,0 @@
#!/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

View file

@ -1,119 +0,0 @@
#!/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 <configuration_id> <instance_id> <seed> <instance_path_name> <list of parameters>\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)

View file

@ -1,267 +0,0 @@
{
"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
}

View file

@ -1,12 +0,0 @@
#!/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))

View file

@ -1,119 +0,0 @@
#!/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 <configuration_id> <instance_id> <seed> <instance_path_name> <list of parameters>\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)

View file

@ -16,28 +16,24 @@
* ParadisEO algorithmic grammar definition.
*****************************************************************************/
// using Particle = eoRealParticle<eoMaximizingFitness>;
using Ints = eoInt<eoMaximizingFitnessT<int>, size_t>;
using Bits = eoBit<eoMaximizingFitnessT<int>, int>;
// by enumerating candidate operators and their parameters.
eoAlgoFoundryFastGA<Bits>& make_foundry(
eoFunctorStore& store,
eoInit<Bits>& init,
eoEvalFunc<Bits>& eval,
eoEvalFunc<Bits>& eval_onemax,
const size_t max_evals,
const size_t generations,
const double optimum
const size_t generations
)
{
// FIXME using max_restarts>1 does not allow to honor max evals.
auto& foundry = store.pack< eoAlgoFoundryFastGA<Bits> >(init, eval, max_evals, /*max_restarts=*/1);
auto& foundry = store.pack< eoAlgoFoundryFastGA<Bits> >(init, eval_onemax, max_evals, /*max_restarts=*/1);
/***** Continuators ****/
auto& fitcont = store.pack< eoFitContinue<Bits> >(optimum);
auto& gencont = store.pack< eoGenContinue<Bits> >(generations);
auto combconts = std::make_shared< std::vector<eoContinue<Bits>*> >();
combconts->push_back( &fitcont );
combconts->push_back( &gencont );
foundry.continuators.add< eoCombinedContinue<Bits> >( *combconts );
foundry.continuators.add< eoGenContinue<Bits> >(generations);
// for(size_t i=1; i<10; i++) {
// foundry.continuators.add< eoGenContinue<Bits> >(i);
// }
@ -203,17 +199,12 @@ void print_irace(const eoParam& param, const eoOperatorFoundry<ITF>& op_foundry,
{
print_irace_oper<ITF>(param, op_foundry, out);
}
template<class ITF>
void print_irace(const eoParam& param, const eoParameterFoundry<ITF>& op_foundry, std::ostream& out = std::cout)
{
print_irace_param/*<ITF>*/(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)
{
@ -237,16 +228,10 @@ void print_operators(const eoParam& param, eoOperatorFoundry<ITF>& op_foundry, s
}
}
template<class T>
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<class ITF>
void print_operators(const eoParam& param, eoParameterFoundry<ITF>& op_foundry, std::ostream& out = std::cout, std::string indent=" ")
{
print_operators(param, op_foundry.min(), op_foundry.max(), out, indent);
out << indent << "[" << op_foundry.min() << "," << op_foundry.max() << "] " << param.longName() << "." << std::endl;
}
// Problem configuration.
@ -271,26 +256,6 @@ std::ostream& operator<<(std::ostream& os, const Problem& pb)
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.
*****************************************************************************/
@ -339,7 +304,7 @@ int main(int argc, char* argv[])
"problem", "Problem ID",
'p', "Problem", /*required=*/true);
const size_t problem = problem_p.value();
assert(problem < benchmark.size());
assert(0 <= problem and problem < benchmark.size());
// const size_t dimension = parser.getORcreateParam<size_t>(1000,
// "dimension", "Dimension size",
@ -352,7 +317,7 @@ int main(int argc, char* argv[])
const size_t instance = instance_p.value();
const size_t max_evals = parser.getORcreateParam<size_t>(5 * dimension,
"max-evals", "Maximum number of evaluations (default: 5*dim, else the given value)",
"max-evals", "Maximum number of evaluations",
'e', "Stopping criterion").value();
const size_t buckets = parser.getORcreateParam<size_t>(100,
@ -385,19 +350,16 @@ int main(int argc, char* argv[])
"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 offspring_size_p = parser.getORcreateParam<size_t>(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<size_t>(std::floor(
const size_t generations = static_cast<size_t>(std::floor(
static_cast<double>(max_evals) / static_cast<double>(pop_size)));
// const size_t generations = std::numeric_limits<size_t>::max();
if(generations < 1) {
generations = 1;
}
eo::log << eo::debug << "Number of generations: " << generations << std::endl;
/***** metric parameters *****/
auto crossover_rate_p = parser.getORcreateParam<double>(0.5,
@ -457,7 +419,7 @@ int main(int argc, char* argv[])
eoEvalFuncPtr<Bits> fake_eval(fake_func);
eoUniformGenerator<int> fake_gen(0, 1);
eoInitFixedLength<Bits> fake_init(/*bitstring size=*/1, fake_gen);
auto fake_foundry = make_foundry(store, fake_init, fake_eval, max_evals, /*generations=*/ 1, 0);
auto fake_foundry = make_foundry(store, fake_init, fake_eval, max_evals, /*generations=*/ 1);
std::clog << std::endl << "Available operators:" << std::endl;
print_operators( continuator_p, fake_foundry.continuators , std::clog);
@ -470,13 +432,8 @@ int main(int argc, char* argv[])
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_sample_size //crossover_rates
* fake_foundry.crossover_selectors.size()
@ -488,8 +445,8 @@ int main(int argc, char* argv[])
* fake_foundry.replacements.size()
* fake_foundry.continuators.size()
* fake_sample_size //offspring_sizes
* fake_sample_size //pop_size
;
std::clog << std::endl;
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;
@ -506,7 +463,6 @@ int main(int argc, char* argv[])
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;
@ -514,10 +470,6 @@ int main(int argc, char* argv[])
exit(NO_ERROR);
}
eo::log << eo::debug << "Maximum number of evaluations: " << max_evals << std::endl;
eo::log << eo::debug << "Number of generations: " << generations << std::endl;
/*****************************************************************************
* IOH stuff.
*****************************************************************************/
@ -567,8 +519,8 @@ int main(int argc, char* argv[])
ioh::trigger::OnImprovement on_improvement;
ioh::watch::Evaluations evaluations;
ioh::watch::TransformedYBest transformed_y_best;
std::vector<std::reference_wrapper<ioh::logger::Trigger >> t = {on_improvement};
std::vector<std::reference_wrapper<ioh::logger::Property>> w = {evaluations,transformed_y_best};
std::vector<std::reference_wrapper<ioh::logger::Trigger >> t = {std::ref(on_improvement)};
std::vector<std::reference_wrapper<ioh::logger::Property>> w = {std::ref(evaluations),std::ref(transformed_y_best)};
csv_logger = std::make_shared<ioh::logger::FlatFile>(
// {std::ref(on_improvement)},
// {std::ref(evaluations),std::ref(transformed_y_best)},
@ -592,8 +544,7 @@ int main(int argc, char* argv[])
// + "_N" + std::to_string(w_neutrality)
// + "_R" + std::to_string(w_ruggedness);
// ioh::problem::wmodel::WModelOneMax w_model_om(
WModelFlat w_model_om(
ioh::problem::wmodel::WModelOneMax w_model_om(
instance,
dimension,
w_dummy,
@ -611,8 +562,7 @@ int main(int argc, char* argv[])
eoEvalIOHproblem<Bits> onemax_pb(w_model_om, loggers);
// eoEvalPrint<Bits> eval_print(onemax_pb, std::clog, "\n");
// eoEvalFuncCounter<Bits> eval_count(onemax_pb);
eoEvalCounterThrowException<Bits> eval_count(onemax_pb, max_evals);
eoEvalFuncCounter<Bits> eval_count(onemax_pb);
eoPopLoopEval<Bits> onemax_eval(eval_count);
@ -620,9 +570,9 @@ int main(int argc, char* argv[])
eoBooleanGenerator<int> bgen;
eoInitFixedLength<Bits> onemax_init(/*bitstring size=*/dimension, bgen);
auto& foundry = make_foundry(store, onemax_init, eval_count, max_evals, generations, max_target);
auto& foundry = make_foundry(store, onemax_init, eval_count, max_evals - pop_size, generations);
eoAlgoFoundry<Bits>::Encodings encoded_algo(foundry.size());
Ints encoded_algo(foundry.size());
encoded_algo[foundry.crossover_rates .index()] = crossover_rate;
encoded_algo[foundry.crossover_selectors .index()] = crossover_selector;
@ -639,19 +589,24 @@ int main(int argc, char* argv[])
foundry.select(encoded_algo);
std::clog << foundry.name() << std::endl;
// // Evaluation of a forged encoded_algo on the sub-problem
// eoEvalFoundryFastGA<Ints, Bits> 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<Bits> pop;
pop.append(pop_size, onemax_init);
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;
}
onemax_eval(pop,pop);
foundry(pop); // Actually run the selected algorithm.
/***** IOH perf stats *****/
double perf = ioh::logger::eah::stat::under_curve::volume(eah_logger);

View file

@ -1,64 +0,0 @@
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

View file

@ -1,770 +0,0 @@
#include <filesystem>
#include <iostream>
#include <cstdlib>
#include <string>
#include <memory>
#include <eo>
#include <ga.h>
#include <utils/checkpointing>
#include <eoInt.h>
#include <problems/eval/eoEvalIOH.h>
#include <ioh.hpp>
/*****************************************************************************
* ParadisEO algorithmic grammar definition.
*****************************************************************************/
// using Particle = eoRealParticle<eoMaximizingFitness>;
using Ints = eoInt<eoMaximizingFitnessT<int>, size_t>;
using Bits = eoBit<eoMaximizingFitnessT<int>, int>;
// by enumerating candidate operators and their parameters.
eoAlgoFoundryFastGA<Bits>& make_foundry(
eoFunctorStore& store,
eoInit<Bits>& init,
eoEvalFunc<Bits>& 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<double> cl_sizes,
std::vector<double> cl_values
)
{
// FIXME using max_restarts>1 does not allow to honor max evals.
auto& foundry = store.pack< eoAlgoFoundryFastGA<Bits> >(init, eval, max_evals, /*max_restarts=*/1);
/***** Continuators ****/
auto& fitcont = store.pack< eoFitContinue<Bits> >(optimum);
auto& gencont = store.pack< eoGenContinue<Bits> >(generations);
auto combconts = std::make_shared< std::vector<eoContinue<Bits>*> >();
combconts->push_back( &fitcont );
combconts->push_back( &gencont );
foundry.continuators.add< eoCombinedContinue<Bits> >( *combconts );
// for(size_t i=1; i<10; i++) {
// foundry.continuators.add< eoGenContinue<Bits> >(i);
// }
// for(size_t i=10; i < 100; i+=2 ) {
// foundry.continuators.add< eoSteadyFitContinue<Bits> >(10,i);
// }
// for(double i=0.0; i<1.0; i+=0.2) {
// foundry.crossover_rates.add<double>(i);
// foundry.mutation_rates.add<double>(i);
// }
/***** Offsprings size *****/
// for(size_t i=5; i<100; i+=10) {
// foundry.offspring_sizes.add<size_t>(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<Bits> >(i); // preference over 1
}
for(size_t i=1; i < 10; i+=2) {
foundry.crossovers.add< eoNPtsBitXover<Bits> >(i); // nb of points
}
// foundry.crossovers.add< eo1PtBitXover<Bits> >(); // 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<Bits> >(p);
// proba of flipping k bits, k drawn in binomial distrib
foundry.mutations.add< eoStandardBitMutation<Bits> >(p);
// proba of flipping k bits, k drawn in binomial distrib, minus zero
foundry.mutations.add< eoConditionalBitMutation<Bits> >(p);
// proba of flipping k bits, k drawn in binomial distrib, changing zeros to one
foundry.mutations.add< eoShiftedBitMutation<Bits> >(p);
// proba of flipping k bits, k drawn in normal distrib
foundry.mutations.add< eoNormalBitMutation<Bits> >(p);
// proba of flipping k bits, k drawn in powerlaw distrib
foundry.mutations.add< eoFastBitMutation<Bits> >(p);
for(size_t i=1; i < 11; i+=2) {
// mutate k bits without duplicates
foundry.mutations.add< eoDetSingleBitFlip<Bits> >(i);
}
*/
/* ######################## RbA END ######################## */
/* ######################## Add by Alexis ######################## */
foundry.mutations.add< eoBucketBitMutation<Bits> >(cl_sizes, cl_values);
/* ######################## AbA END ######################## */
/***** Selectors *****/
for(eoOperatorFoundry<eoSelectOne<Bits>>& ops :
{std::ref(foundry.crossover_selectors),
std::ref(foundry.mutation_selectors) }) {
ops.add< eoRandomSelect<Bits> >();
ops.add< eoStochTournamentSelect<Bits> >(0.5);
ops.add< eoSequentialSelect<Bits> >();
ops.add< eoProportionalSelect<Bits> >();
for(size_t i=2; i < 11; i+=4) {
ops.add< eoDetTournamentSelect<Bits> >(i);
}
}
foundry.aftercross_selectors.add< eoRandomSelect<Bits> >();
/***** Replacements ****/
/* ######################## Removed by Alexis ######################## */
/*
foundry.replacements.add< eoPlusReplacement<Bits> >();
foundry.replacements.add< eoCommaReplacement<Bits> >();
foundry.replacements.add< eoSSGAWorseReplacement<Bits> >();
for(double i=0.51; i<0.92; i+=0.2) {
foundry.replacements.add< eoSSGAStochTournamentReplacement<Bits> >(i);
}
for(size_t i=2; i < 11; i+=2) {
foundry.replacements.add< eoSSGADetTournamentReplacement<Bits> >(i);
}
*/
/* ######################## RbA END ######################## */
/* ######################## Add by Alexis ######################## */
//foundry.replacements.add< eoSSGADetTournamentReplacement<Bits> >(1);
foundry.replacements.add< eoCommaReplacement<Bits> >();
/* ######################## 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<slot_size; ++i) {
out << "," << i;
}
out << ")" << std::endl;
}
template<class T>
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<class ITF>
void print_irace_oper(const eoParam& param, const eoOperatorFoundry<ITF>& 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<class ITF>
void print_irace_param(
const eoParam& param,
// const eoParameterFoundry<typename std::enable_if< std::is_floating_point<ITF>::value >::type>& op_foundry,
const eoParameterFoundry<double>& op_foundry,
std::ostream& out)
{
print_irace_ranged(param, op_foundry.min(), op_foundry.max(), "r", out);
}
// template<class ITF>
void print_irace_param(
const eoParam& param,
// const eoParameterFoundry<typename std::enable_if< std::is_integral<ITF>::value >::type>& op_foundry,
const eoParameterFoundry<size_t>& op_foundry,
std::ostream& out)
{
print_irace_ranged(param, op_foundry.min(), op_foundry.max(), "i", out);
}
template<class ITF>
void print_irace(const eoParam& param, const eoOperatorFoundry<ITF>& op_foundry, std::ostream& out = std::cout)
{
print_irace_oper<ITF>(param, op_foundry, out);
}
template<class ITF>
void print_irace(const eoParam& param, const eoParameterFoundry<ITF>& op_foundry, std::ostream& out = std::cout)
{
print_irace_param/*<ITF>*/(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<class ITF>
void print_operators(const eoParam& param, eoOperatorFoundry<ITF>& 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<class T>
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<class ITF>
void print_operators(const eoParam& param, eoParameterFoundry<ITF>& 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<size_t, Problem> 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 }},
{19 /*20?*/, {0, 0, 0, 0, 0, 64 }} // Add by Alexis
};
eoFunctorStore store;
eoParser parser(argc, argv, "OnlymutGA interface for iRace");
/***** Problem parameters *****/
auto problem_p = parser.getORcreateParam<size_t>(0,
"problem", "Problem ID",
'p', "Problem", /*required=*/true);
const size_t problem = problem_p.value();
assert(0 <= problem and problem < benchmark.size());
// const size_t dimension = parser.getORcreateParam<size_t>(1000,
// "dimension", "Dimension size",
// 'd', "Problem").value();
const size_t dimension = benchmark[problem].dimension;
auto instance_p = parser.getORcreateParam<size_t>(0,
"instance", "Instance ID",
'i', "Instance", /*required=*/false);
const size_t instance = instance_p.value();
const size_t max_evals = parser.getORcreateParam<size_t>(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<size_t>(100,
"buckets", "Number of buckets for discretizing the ECDF",
'b', "Performance estimation").value();
/***** Generic options *****/
uint32_t seed =
parser.getORcreateParam<uint32_t>(0,
"seed", "Random number seed (0 = epoch)",
'S').value();
if(seed == 0) {
seed = time(0);
}
// rng is a global
rng.reseed(seed);
bool full_log =
parser.getORcreateParam<bool>(0,
"full-log", "Log the full search in CSV files"/* (using the IOH profiler format)"*/,
'F').value();
bool output_mat =
parser.getORcreateParam<bool>(0,
"output-mat", "Output the aggregated attainment matrix instead of its scalar sum (fancy colormap on stderr, parsable CSV on stdout).",
'A').value();
/***** populations sizes *****/
auto pop_size_p = parser.getORcreateParam<size_t>(1,
"pop-size", "Population size",
'P', "Operator Choice", /*required=*/false); // Changed by Alexis: 5 -> 1
const size_t pop_size = pop_size_p.value();
const size_t pop_size_max = 10;
auto offspring_size_p = parser.getORcreateParam<size_t>(10,
"offspring-size", "Offsprings size (0 = same size than the parents pop, see --pop-size)",
'O', "Operator Choice", /*required=*/false); // Single alternative, not required. // Changed by Alexis: 0 -> 10
const size_t offspring_size = offspring_size_p.value();
size_t generations = static_cast<size_t>(std::floor(
static_cast<double>(max_evals) / static_cast<double>(pop_size)));
// const size_t generations = std::numeric_limits<size_t>::max();
if(generations < 1) {
generations = 1;
}
/***** metric parameters *****/
auto crossover_rate_p = parser.getORcreateParam<double>(0,
"crossover-rate", "",
'C', "Operator Choice", /*required=*/false); // Changed by Alexis: 0.5 -> 0 | true -> false
const double crossover_rate = crossover_rate_p.value();
auto mutation_rate_p = parser.getORcreateParam<double>(1,
"mutation-rate", "",
'M', "Operator Choice", /*required=*/false); // Changed by Alexis: 0 -> 1 | true -> false
const double mutation_rate = mutation_rate_p.value();
/***** operators *****/
auto continuator_p = parser.getORcreateParam<size_t>(0,
"continuator", "Stopping criterion",
'o', "Operator Choice", /*required=*/false); // Single alternative, not required.
const size_t continuator = continuator_p.value();
auto crossover_selector_p = parser.getORcreateParam<size_t>(0,
"cross-selector", "How to selects candidates for cross-over",
's', "Operator Choice", /*required=*/false); // Changed by Alexis: true -> false
const size_t crossover_selector = crossover_selector_p.value();
auto crossover_p = parser.getORcreateParam<size_t>(0,
"crossover", "",
'c', "Operator Choice", /*required=*/false); // Changed by Alexis: true -> false
const size_t crossover = crossover_p.value();
auto aftercross_selector_p = parser.getORcreateParam<size_t>(0,
"aftercross-selector", "How to selects between the two individuals altered by cross-over which one will mutate",
'a', "Operator Choice", /*required=*/false); // Single alternative, not required.
const size_t aftercross_selector = aftercross_selector_p.value();
auto mutation_selector_p = parser.getORcreateParam<size_t>(0,
"mut-selector", "How to selects candidate for mutation",
'u', "Operator Choice", /*required=*/false); // Changed by Alexis: true -> false
const size_t mutation_selector = mutation_selector_p.value();
auto mutation_p = parser.getORcreateParam<size_t>(0,
"mutation", "",
'm', "Operator Choice", /*required=*/false); // Changed by Alexis: true -> false
const size_t mutation = mutation_p.value();
auto replacement_p = parser.getORcreateParam<size_t>(0,
"replacement", "",
'r', "Operator Choice", /*required=*/false); // Changed by Alexis: true -> false
const size_t replacement = replacement_p.value();
/* ######################## Add by Alexis ######################## */
auto cl_values_p = parser.getORcreateParam<std::string>("0.8,0.2",
"cl-probs", "Probabilities of each part for the custom law (sum = 1)",
'y', "Operator Choice", false);
std::string cl_v = cl_values_p.value();
std::vector<double> cl_probs = std::vector<double>();
std::string sep = ",";
size_t pos = 0;
std::string token;
while ((pos = cl_v.find(sep)) != std::string::npos) {
token = cl_v.substr(0, pos);
cl_probs.push_back(std::stod(token));
cl_v.erase(0, pos + sep.length());
}
cl_probs.push_back(std::stod(cl_v));
auto cl_sizes_p = parser.getORcreateParam<std::string>("0.5,0.5",
"cl-sizes", "Proportion sizes of each part for the custom law (sum = 1)",
'x', "Operator Choice", false);
std::string cl_s = cl_sizes_p.value();
std::vector<double> cl_sizes = std::vector<double>();
pos = 0;
while ((pos = cl_s.find(sep)) != std::string::npos) {
token = cl_s.substr(0, pos);
cl_sizes.push_back(std::stod(token));
cl_s.erase(0, pos + sep.length());
}
cl_sizes.push_back(std::stod(cl_s));
/* ######################## AbA END ######################## */
// Help + Verbose routines
make_verbose(parser);
make_help(parser, /*exit_after*/false, std::clog);
if(parser.userNeedsHelp()) {
// Fake operators, just to be able to call make_foundry
// to get the configured operators slots.
eoEvalFuncPtr<Bits> fake_eval(fake_func);
eoUniformGenerator<int> fake_gen(0, 1);
eoInitFixedLength<Bits> fake_init(/*bitstring size=*/1, fake_gen);
auto fake_foundry = make_foundry(store, fake_init, fake_eval, max_evals, /*generations=*/ 1, 0, pop_size_max, offspring_size, cl_sizes, cl_probs);
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);
/* ######################## Add by Alexis ######################## */
print_operators( cl_values_p, "(1)", "(0.01,...,0.99)" , std::clog);
print_operators( cl_sizes_p, "(1)", "(0.01,...,0.99)" , std::clog);
/* ######################## AbA END ######################## */
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_sample_size //crossover_rates
* fake_foundry.crossover_selectors.size()
* fake_foundry.crossovers.size()
* fake_foundry.aftercross_selectors.size()
* fake_sample_size //mutation_rates
* fake_foundry.mutation_selectors.size()
* fake_foundry.mutations.size()
* fake_foundry.replacements.size()
* fake_foundry.continuators.size()
* 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;
/* ######################## Removed by Alexis ######################## */
/*
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);
*/
/* ######################## RbA END ######################## */
//std::ofstream irace_param("fastga.params");
//irace_param << "# name\tswitch\ttype\tvalues" << std::endl;
exit(NO_ERROR);
}
eo::log << eo::debug << "Maximum number of evaluations: " << max_evals << std::endl;
eo::log << eo::debug << "Number of generations: " << generations << std::endl;
/*****************************************************************************
* IOH stuff.
*****************************************************************************/
/***** IOH logger *****/
auto max_target = benchmark[problem].max_target;
ioh::logger::eah::Log10Scale<double> target_range(0, max_target, buckets);
ioh::logger::eah::Log10Scale<size_t> budget_range(0, max_evals, buckets);
ioh::logger::EAH eah_logger(target_range, budget_range);
ioh::logger::Combine loggers(eah_logger);
std::shared_ptr<ioh::logger::FlatFile> csv_logger = nullptr;
if(full_log) {
// Build up an algorithm name from main parameters.
std::ostringstream name;
name << "OnlymutGA";
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<std::reference_wrapper<ioh::logger::Trigger >> t = {on_improvement};
std::vector<std::reference_wrapper<ioh::logger::Property>> w = {evaluations,transformed_y_best};
csv_logger = std::make_shared<ioh::logger::FlatFile>(
// {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_dummy = benchmark[problem].dummy;
int w_epitasis = benchmark[problem].epistasis;
int w_neutrality = benchmark[problem].neutrality;
int w_ruggedness = benchmark[problem].ruggedness;
// 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);
// ioh::problem::wmodel::WModelOneMax w_model_om(
WModelFlat w_model_om(
instance,
dimension,
w_dummy,
w_epitasis,
w_neutrality,
w_ruggedness);
/***** Bindings *****/
w_model_om.attach_logger(loggers);
/*****************************************************************************
* Binding everything together.
*****************************************************************************/
eoEvalIOHproblem<Bits> onemax_pb(w_model_om, loggers);
// eoEvalPrint<Bits> eval_print(onemax_pb, std::clog, "\n");
// eoEvalFuncCounter<Bits> eval_count(onemax_pb);
eoEvalCounterThrowException<Bits> eval_count(onemax_pb, max_evals);
eoPopLoopEval<Bits> onemax_eval(eval_count);
/***** Instanciate and run the algo *****/
eoBooleanGenerator<int> bgen;
eoInitFixedLength<Bits> onemax_init(/*bitstring size=*/dimension, bgen);
auto& foundry = make_foundry(store, onemax_init, eval_count, max_evals, generations, max_target, pop_size_max, offspring_size, cl_sizes, cl_probs);
Ints encoded_algo(foundry.size());
encoded_algo[foundry.crossover_rates .index()] = crossover_rate;
encoded_algo[foundry.crossover_selectors .index()] = crossover_selector;
encoded_algo[foundry.crossovers .index()] = crossover;
encoded_algo[foundry.aftercross_selectors.index()] = aftercross_selector;
encoded_algo[foundry.mutation_rates .index()] = mutation_rate;
encoded_algo[foundry.mutation_selectors .index()] = mutation_selector;
encoded_algo[foundry.mutations .index()] = mutation;
encoded_algo[foundry.replacements .index()] = replacement;
encoded_algo[foundry.continuators .index()] = continuator;
encoded_algo[foundry.offspring_sizes .index()] = offspring_size;
// 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<Ints, Bits> 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<Bits> pop;
pop.append(pop_size, onemax_init);
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 *****/
double perf = ioh::logger::eah::stat::under_curve::volume(eah_logger);
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;
if(output_mat) {
std::vector<std::vector<double>> 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;
}
}

View file

@ -32,9 +32,8 @@ IF (DOXYGEN_FOUND)
ENDIF (DOXYGEN_EXECUTABLE)
# configure cfg file
# "${CMAKE_CURRENT_SOURCE_DIR}/${EO_DOC_CONFIG_FILE}.cmake"
CONFIGURE_FILE(
"${DOXYGEN_CONFIG_DIR}/doxyfile.cmake"
"${CMAKE_CURRENT_SOURCE_DIR}/${EO_DOC_CONFIG_FILE}.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/${EO_DOC_CONFIG_FILE}"
)

View file

@ -25,21 +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 = @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
PROJECT_NAME = @PACKAGE_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 = @PROJECT_VERSION@
PROJECT_NUMBER = @PACKAGE_VERSION@
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
# base path where the generated documentation will be put.
@ -280,6 +272,22 @@ 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
#---------------------------------------------------------------------------
@ -492,7 +500,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 = @CMAKE_SOURCE_DIR@/doxygen/DoxygenLayout.xml
LAYOUT_FILE =
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
@ -586,7 +594,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@/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
EXCLUDE = @CMAKE_SOURCE_DIR@/src/obsolete @CMAKE_SOURCE_DIR@/test @CMAKE_SOURCE_DIR@/tutorial @CMAKE_SOURCE_DIR@/contrib @CMAKE_SOURCE_DIR@/app
# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
# directories that are symbolic links (a Unix filesystem feature) are excluded
@ -600,7 +608,7 @@ EXCLUDE_SYMLINKS = NO
# against the file with absolute path, so to exclude all test directories
# for example use the pattern */test/*
EXCLUDE_PATTERNS = *.sif/*
EXCLUDE_PATTERNS =
# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
# (namespaces, classes, functions, etc.) that should be excluded from the
@ -614,7 +622,7 @@ EXCLUDE_SYMBOLS =
# directories that contain example code fragments that are included (see
# the \include command).
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
EXAMPLE_PATH = @CMAKE_SOURCE_DIR@/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
@ -776,14 +784,14 @@ HTML_HEADER =
HTML_FOOTER =
# The HTML_EXTRA_STYLESHEET tag can be used to specify a user-defined cascading
# The HTML_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_EXTRA_STYLESHEET = @CMAKE_SOURCE_DIR@/doxygen/doxygen-style.css
HTML_STYLESHEET =
# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
@ -792,7 +800,7 @@ HTML_EXTRA_STYLESHEET = @CMAKE_SOURCE_DIR@/doxygen/doxygen-style.css
# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
HTML_DYNAMIC_SECTIONS = YES
HTML_DYNAMIC_SECTIONS = NO
# 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
@ -962,7 +970,7 @@ SEARCHENGINE = YES
# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
# generate Latex output.
GENERATE_LATEX = NO
GENERATE_LATEX = YES
# 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
@ -1121,6 +1129,18 @@ 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
@ -1281,6 +1301,11 @@ 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
#---------------------------------------------------------------------------
@ -1294,6 +1319,15 @@ EXTERNAL_GROUPS = YES
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.
@ -1316,7 +1350,7 @@ HAVE_DOT = YES
# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
# containing the font.
DOT_FONTNAME =
DOT_FONTNAME = FreeSans
# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
# The default size is 10pt.
@ -1358,7 +1392,7 @@ UML_LOOK = NO
# If set to YES, the inheritance and collaboration graphs will show the
# relations between templates and their instances.
TEMPLATE_RELATIONS = YES
TEMPLATE_RELATIONS = NO
# 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
@ -1406,18 +1440,7 @@ DIRECTORY_GRAPH = YES
# generated by dot. Possible values are png, jpg, or gif
# If left blank png will be used.
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
DOT_IMAGE_FORMAT = png
# 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.
@ -1463,7 +1486,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 = YES
DOT_MULTI_TARGETS = NO
# 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

View file

@ -64,8 +64,6 @@ template<class F = double> class EO: public eoObject, public eoPersistent
public:
typedef F Fitness;
static constexpr const char* invalidTag = "INVALID";
/** Default constructor.
*/
EO(): repFitness(Fitness()), invalidFitness(true) { }
@ -74,9 +72,7 @@ public:
virtual ~EO() {};
/// Return fitness value.
// virtual const Fitness& fitness() const { // This would be impossible with MOEO.
// virtual Fitness fitness() const { // Cannot do that either, MOEO changes the interface.
Fitness fitness() const {
const Fitness& fitness() const {
if (invalid())
throw eoInvalidFitnessError("Cannot retrieve unevaluated fitness");
return repFitness;
@ -90,7 +86,7 @@ public:
}
// Set fitness as invalid.
virtual void invalidate() { invalidFitness = true; repFitness = Fitness(); }
void invalidate() { invalidFitness = true; repFitness = Fitness(); }
/** Set fitness. At the same time, validates it.
* @param _fitness New fitness value.
@ -126,21 +122,25 @@ public:
* The read and print methods should be compatible and have the same format.
* In principle, format is "plain": they just print a number
* @param _is a std::istream.
* @throw eoInvalidFitnessError If a valid object can't be read.
*/
virtual void readFrom(std::istream& _is)
{
virtual void readFrom(std::istream& _is) {
// the new version of the reafFrom function.
// It can distinguish between valid and invalid fitness values.
std::string fitness_str;
int pos = _is.tellg();
_is >> fitness_str;
if (fitness_str == invalidTag)
if (fitness_str == "INVALID")
{
invalidFitness = true;
}
else
{
invalidFitness = false;
std::istringstream iss(fitness_str);
iss >> repFitness;
_is.seekg(pos); // rewind
_is >> repFitness;
}
}
@ -148,11 +148,12 @@ public:
* Write object. Called printOn since it prints the object _on_ a stream.
* @param _os A std::ostream.
*/
virtual void printOn(std::ostream& _os) const
{
if (invalid())
{
_os << invalidTag << ' ';
virtual void printOn(std::ostream& _os) const {
// the latest version of the code. Very similar to the old code
if (invalid()) {
_os << "INVALID ";
}
else
{

View file

@ -65,7 +65,7 @@ eoCheckPoint<EOT>& do_make_checkpoint(eoParser& _parser, eoState& _state, eoValu
#ifndef _MSC_VER
// the CtrlC monitoring interception
eoSignal<EOT> *mon_ctrlCCont = nullptr;
eoSignal<EOT> *mon_ctrlCCont;
eoValueParam<bool>& mon_ctrlCParam = _parser.createParam(false, "monitor-with-CtrlC", "Monitor current generation upon Ctrl C",0, "Stopping criterion");
if (mon_ctrlCParam.value())
{

View file

@ -224,11 +224,6 @@
#include "utils/eoLogger.h"
#include "utils/eoParallel.h"
#include "eoInt.h"
#include "eoRealToIntMonOp.h"
#include "eoRealToIntQuadOp.h"
#include "eoRealToIntInit.h"
#endif
// Local Variables:

View file

@ -15,7 +15,6 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
© 2020 Thales group
© 2022 Institut Pasteur
Authors:
Johann Dreo <johann.dreo@thalesgroup.com>
@ -25,7 +24,6 @@
#define _eoAlgoFoundry_H_
#include <vector>
#include <variant>
/** A vector of eoForge which hold an index.
*
@ -38,13 +36,13 @@
* which takes the class name as template and its constructor's parameters
* as arguments. For example:
* @code
* eoOperatorFoundry< eoSelectOne<EOT> > selectors;
* selectors.add< eoStochTournamentSelect<EOT> >( 0.5 );
* eoOperatorFoundry< eoSelectOne<EOT> > selectors;
* selectors.add< eoStochTournamentSelect<EOT> >( 0.5 );
* @endcode
*
* @warning If the managed constructor takes a reference YOU SHOULD ABSOLUTELY wrap it
* in a `std::ref` when using `add` or `setup`, or it will silently be passed as a copy,
* which would effectively disable any link between operators.
* in a `std::ref` when using `add` or `setup`, or it will silently be passed as a copy,
* which would effectively disable any link between operators.
*
* @ingroup Core
* @ingroup Foundry
@ -53,18 +51,11 @@ template<class Itf>
class eoOperatorFoundry : public eoForgeVector< Itf >
{
public:
/** Constructor
*
* @param encoding_index The slot position in the encodings, at which this operator is held.
* @param always_reinstantiate If false, will enable cache for the forges in this container.
*/
eoOperatorFoundry(size_t encoding_index, bool always_reinstantiate = true ) :
eoForgeVector<Itf>(always_reinstantiate),
_index(encoding_index)
{ }
/** Returns the slot index at which this is registered.
*/
size_t index() const { return _index; }
protected:
@ -72,24 +63,6 @@ class eoOperatorFoundry : public eoForgeVector< Itf >
size_t _index;
};
/** A vector of eoForge which hold a scalar numeric value.
*
* To be used in conjunction with a subclass of an eoAlgoFoundry,
* where it can hold a range of parameter values
* and hold the link to the encoding. @see eoAlgoFoundryEA
*
* As with eoForgeScalar, managed parameters
* are represented through a [min,max] range.
*
* For example:
* @code
* eoParameterFoundry< double > proba(0.0, 1.0);
* @endcode
*
* @ingroup Core
* @ingroup Foundry
*/
template<class Itf>
class eoParameterFoundry : public eoForgeScalar< Itf >
{
@ -97,26 +70,11 @@ class eoParameterFoundry : public eoForgeScalar< Itf >
"eoParameterFoundry should only be used on arithmetic types (i.e. integer or floating point types)");
public:
/** Underlying type of the parameter.
*
* @note You probably only want to use either `double` or `size_t`.
* @see eoAlgoFoundry
*/
using Type = Itf;
/** Constructor
*
* @param encoding_index The slot position in the encodings, at which this parameter is held.
* @param min Minimium possible value.
* @param max Maximum possible value.
*/
eoParameterFoundry(size_t encoding_index, Itf min, Itf max) :
eoForgeScalar<Itf>(min, max),
_index(encoding_index)
{ }
/** Returns the slot index at which this is registered.
*/
size_t index() const { return _index; }
protected:
@ -126,55 +84,48 @@ class eoParameterFoundry : public eoForgeScalar< Itf >
/** Interface of a Foundry: a class that instantiate an eoAlgo on-the-fly, given a choice of its operators.
*
* The chosen operators are encoded in a vector of numbers.
* The chosen operators are encoded in a vector of indices.
*
* The foundry subclass should first be set up with sets of operators of the same interface,
* held within an eoOperatorFoundry member.
* @code
* eoOperatorFoundry< eoSelectOne<EOT> > selectors;
* eoOperatorFoundry< eoSelectOne<EOT> > selectors;
* @endcode
*
* In a second step, the operators to be used should be selected
* by indicating their index, just like if the foundry was an array:
* @code
* foundry.select({size_t{0}, size_t{1}, size_t{2}});
* // ^ ^ ^
* // | | |
* // | | + 3d operator
* // | + 2d operator
* // + 1st operator
* foundry.select({0, 1, 2});
* // ^ ^ ^
* // | | |
* // | | + 3d operator
* // | + 2d operator
* // + 1st operator
* @endcode
*
* If you don't (want to) recall the order of the operators in the encoding,
* you can use the `index()` member of eoOperatorFoundry, for example:
* @code
* foundry.at(foundry.continuators.index()) = size_t{2}; // select the third continuator
* foundry.at(foundry.continuators.index()) = 2; // select the third continuator
* @endcode
*
* Now, you must implement the foundry just like any eoAlgo, by using the eoPop interface:
* @code
* foundry(pop);
* @endcode
*
* foundry(pop);
* @encode
* It will instantiate the needed operators (only) and the algorithm itself on-the-fly,
* and then run it.
*
* @note The "encoding" which represent the selected options, figuring the actual meta-algorithm,
* is a vector of `std::variant`, which can hold either a `size_t` or a `double`.
* The first one is used to indicate the index of an operator class
* *or* a parameter which is a size.
* The second is used to store numerical parameters values.
*
* @note Thanks to the underlying eoOperatorFoundry, not all the added operators are instantiated.
* Every instantiation is deferred upon actual use. That way, you can still reconfigure them
* at any time with `eoForgeOperator::setup`, for example:
* @code
* foundry.selector.at(0).setup(0.5); // using constructor's arguments
* @endcode
* @note: Thanks to the underlying eoOperatorFoundry, not all the added operators are instantiated.
* Every instantiation is deferred upon actual use. That way, you can still reconfigure them
* at any time with `eoForgeOperator::setup`, for example:
* @code
* foundry.selector.at(0).setup(0.5); // using constructor's arguments
* @endcode
*
* @warning If the managed constructor takes a reference *YOU SHOULD ABSOLUTELY* wrap it
* in a `std::ref` when using `add` or `setup`, or it will silently be passed as a copy,
* which would effectively disable any link between operators.
* @warning If the managed constructor takes a reference YOU SHOULD ABSOLUTELY wrap it
* in a `std::ref` when using `add` or `setup`, or it will silently be passed as a copy,
* which would effectively disable any link between operators.
*
* @ingroup Core
* @ingroup Foundry
@ -184,104 +135,30 @@ template<class EOT>
class eoAlgoFoundry : public eoAlgo<EOT>
{
public:
// We could use `std::any` instead of a variant,
// but this would be more prone to errors from the end user, at the end.
// Either the encoding is an index (of the operator within the list of instances)
// either it's a real-valued parameter,
// either it's a size.
// So there's no need for more types (AFAIK).
/** The type use to represent a selected option in the meta-algorithm.
*
* This can figure, either:
* - the index of an operator in the list of possible ones,
* - the actual value of a numeric paramater,
* - the value of a parameter which is a size.
/**
*/
using Encoding = std::variant<size_t, double>;
/** The type use to store all selected options.
*/
using Encodings = std::vector<Encoding>;
/** Constructor.
*
* @param nb_slots Number of operators or parameters that are assembled to make an algorithm.
*/
eoAlgoFoundry( size_t nb_slots ) :
_size(nb_slots)
eoAlgoFoundry( size_t nb_operators ) :
_size(nb_operators),
_encoding(_size,0)
{ }
/** Select indices of all the operators.
*
* i.e. Select an algorithm to instantiate.
*
* @note You need to indicate the type of each item
* if you want to call this with a brace-initialized vector.
*
* For example:
* @code
* foundry.select({ size_t{1}, double{0.5}, size_t{3} });
* @endcode
*
* Or you can initialize the vector first:
* @code
* double crossover_rate = 0.5;
* size_t crossover_oper = 3;
* eoAlgoFoundry<EOT>::Encodings encoded_algo(foundry.size());
* encoded_algo[foundry.crossover_rates.index()] = crossover_rate;
* encoded_algo[foundry.crossover_opers.index()] = crossover_oper;
* @endcode
*/
void select( Encodings encodings )
void select( std::vector<size_t> encoding )
{
assert(encodings.size() == _size);
_encodings = encodings;
assert(encoding.size() == _encoding.size());
_encoding = encoding;
}
/** Access to the encoding of the currently selected operator.
*
* @warning This returns a `std::variant`, which you should `std::get<T>`.
*
* For example:
* @code
* size_t opera_id = std::get<size_t>(foundry.at(2));
* double param_id = std::get<double>(foundry.at(3));
* @endcode
*
* @see rank, @see value or @see len to have automatic casting.
/** Access to the index of the currently selected operator.
*/
Encoding & at(size_t i)
size_t& at(size_t i)
{
return _encodings.at(i);
return _encoding.at(i);
}
/** Access to the currently selected ID of an operator.
*/
template<class OP>
size_t rank(const OP& op)
{
return std::get<size_t>( at(op.index()) );
}
/** Access to the currently selected value of a numeric parameter.
*/
template<class OP>
double value(const OP& param)
{
return std::get<double>( at(param.index()) );
}
/** Access to the currently selected value of a unsigned integer parameter.
*/
template<class OP>
size_t len(const OP& param)
{
return std::get<size_t>( at(param.index()) );
}
/** Returns the number of slots that makes this algorithm.
*/
size_t size() const
{
return _size;
@ -289,14 +166,14 @@ class eoAlgoFoundry : public eoAlgo<EOT>
/** Return the underlying encoding vector.
*/
Encodings encodings() const
std::vector<size_t> encoding() const
{
return _encodings;
return _encoding;
}
protected:
const size_t _size;
std::vector<Encoding> _encodings;
std::vector<size_t> _encoding;
};

View file

@ -15,10 +15,9 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
© 2020 Thales group
© 2022 Institut Pasteur
Authors:
Johann Dreo <johann@dreo.fr>
Johann Dreo <johann.dreo@thalesgroup.com>
*/
#ifndef _eoAlgoFoundryEA_H_
@ -37,7 +36,7 @@
* which takes the class name as template and its constructor's parameters
* as arguments. For example:
* @code
* foundry.selectors.add< eoStochTournamentSelect<EOT> >( 0.5 );
* foundry.selectors.add< eoStochTournamentSelect<EOT> >( 0.5 );
* @endcode
*
* @warning If the constructor takes a reference YOU SHOULD ABSOLUTELY wrap it
@ -47,34 +46,34 @@
* In a second step, the operators to be used should be selected
* by indicating their index, just like the foundry was a array of five elements:
* @code
* foundry = {size_t{0}, size_t{1}, size_t{2}, size_t{0}, size_t{3}};
* // ^ ^ ^ ^ ^ replacement
* // | | | + selection
* // | | + mutation
* // | + crossover
* // + continue
* foundry = {0, 1, 2, 0, 3};
* // ^ ^ ^ ^ ^ replacement
* // | | | + selection
* // | | + mutation
* // | + crossover
* // + continue
* @endcode
*
* @note by default, the firsts of the five operators are select ed.
* @note: by default, the firsts of the five operators are selected.
*
* If you don't (want to) recall the order of the operators in the encoding,
* you can use the `index()` member, for example:
* @code
* foundry.at(foundry.continuators.index()) = size_t{2}; // select the third continuator
* foundry.at(foundry.continuators.index()) = 2; // select the third continuator
* @endcode
*
* Now, you can call the fourdry just like any eoAlgo, by passing it an eoPop:
* @code
* foundry(pop);
* @endcode
* foundry(pop);
* @encode
* It will instantiate the needed operators (only) and the algorithm itself on-the-fly,
* and then run it.
*
* @note Thanks to the underlying eoOperatorFoundry, not all the added operators are instantiated.
* Every instantiation is deferred upon actual use. That way, you can still reconfigure them
* @note: Thanks to the underlying eoOperatorFoundry, not all the added operators are instantiated.
* Every instantiation is deferred upon actual use. That way, you can still reconfigure them
* at any time with `eoForgeOperator::setup`, for example:
* @code
* foundry.selectors.at(0).setup(0.5); // using constructor's arguments
* foundry.selector.at(0).setup(0.5); // using constructor's arguments
* @endcode
*
* @ingroup Foundry
@ -112,11 +111,11 @@ class eoAlgoFoundryEA : public eoAlgoFoundry<EOT>
*/
void operator()(eoPop<EOT>& pop)
{
assert(continuators.size() > 0); assert(this->rank(continuators) < continuators.size());
assert( crossovers.size() > 0); assert(this->rank( crossovers) < crossovers.size());
assert( mutations.size() > 0); assert(this->rank( mutations) < mutations.size());
assert( selectors.size() > 0); assert(this->rank( selectors) < selectors.size());
assert(replacements.size() > 0); assert(this->rank(replacements) < replacements.size());
assert(continuators.size() > 0); assert(this->at(continuators.index()) < continuators.size());
assert( crossovers.size() > 0); assert(this->at( crossovers.index()) < crossovers.size());
assert( mutations.size() > 0); assert(this->at( mutations.index()) < mutations.size());
assert( selectors.size() > 0); assert(this->at( selectors.index()) < selectors.size());
assert(replacements.size() > 0); assert(this->at(replacements.index()) < replacements.size());
eoSequentialOp<EOT> variator;
variator.add(this->crossover(), 1.0);
@ -135,17 +134,17 @@ class eoAlgoFoundryEA : public eoAlgoFoundry<EOT>
/** Return an approximate name of the seected algorithm.
*
* @note does not take into account parameters of the operators,
* only show class names.
* @note: does not take into account parameters of the operators,
* only show class names.
*/
std::string name()
{
std::ostringstream name;
name << this->continuator().className() << " [" << this->rank(continuators) << "] + ";
name << this->crossover() .className() << " [" << this->rank(crossovers) << "] + ";
name << this->mutation() .className() << " [" << this->rank(mutations) << "] + ";
name << this->selector() .className() << " [" << this->rank(selectors) << "] + ";
name << this->replacement().className() << " [" << this->rank(replacements) << "]";
name << this->at(continuators.index()) << " (" << this->continuator().className() << ") + ";
name << this->at(crossovers.index()) << " (" << this->crossover().className() << ") + ";
name << this->at(mutations.index()) << " (" << this->mutation().className() << ") + ";
name << this->at(selectors.index()) << " (" << this->selector().className() << ") + ";
name << this->at(replacements.index()) << " (" << this->replacement().className() << ")";
return name.str();
}
@ -154,44 +153,34 @@ class eoAlgoFoundryEA : public eoAlgoFoundry<EOT>
const size_t _max_gen;
public:
/** Currently selected continuator.
*/
eoContinue<EOT>& continuator()
{
assert(this->rank(continuators) < continuators.size());
return continuators.instantiate(this->rank(continuators));
assert(this->at(continuators.index()) < continuators.size());
return continuators.instantiate(this->at(continuators.index()));
}
/** Currently selected crossover.
*/
eoQuadOp<EOT>& crossover()
{
assert(this->rank(crossovers) < crossovers.size());
return crossovers.instantiate(this->rank(crossovers));
assert(this->at(crossovers.index()) < crossovers.size());
return crossovers.instantiate(this->at(crossovers.index()));
}
/** Currently selected mutation.
*/
eoMonOp<EOT>& mutation()
{
assert(this->rank(mutations) < mutations.size());
return mutations.instantiate(this->rank(mutations));
assert(this->at(mutations.index()) < mutations.size());
return mutations.instantiate(this->at(mutations.index()));
}
/** Currently selected selector.
*/
eoSelectOne<EOT>& selector()
{
assert(this->rank(selectors) < selectors.size());
return selectors.instantiate(this->rank(selectors));
assert(this->at(selectors.index()) < selectors.size());
return selectors.instantiate(this->at(selectors.index()));
}
/** Currently selected replacement.
*/
eoReplacement<EOT>& replacement()
{
assert(this->rank(replacements) < replacements.size());
return replacements.instantiate(this->rank(replacements));
assert(this->at(replacements.index()) < replacements.size());
return replacements.instantiate(this->at(replacements.index()));
}
};

View file

@ -29,61 +29,48 @@
/** A class that assemble an eoFastGA on the fly, given a combination of available operators.
*
* The foundry should first be set up with sets of operators/parameters
* The foundry should first be set up with sets of operators
* for the main modules of a FastGA:
* continuators, crossovers (and rate of call), mutations (and rate of call),
* selections, replacement operators, offspring size, etc.
* continuators, crossovers, mutations, selections, replacement operators, etc.
*
* This is done through public member variable's `add` method,
* which takes the class name as template and its constructor's parameters
* as arguments. For example:
* @code
* foundry.selectors.add< eoRandomSelect<EOT> >();
* foundry.selectors.add< eoRandomSelect<EOT> >();
* @endcode
*
* @warning If the constructor takes a reference YOU SHOULD ABSOLUTELY wrap it
* in a `std::ref`, or it will silently be passed as a copy,
* which would effectively disable any link with other operator(s).
* in a `std::ref`, or it will silently be passed as a copy,
* which would effectively disable any link with other operator(s).
*
* In a second step, the operators to be used should be selected
* by indicating their wanted index or value, passing an array of 10 elements:
* by indicating their index, passing an array of 10 elements:
* @code
* foundry.select({
* double{0.1}, // crossover rate
* size_t{1}, // crossover selector
* size_t{2}, // crossover
* size_t{3}, // selector after crossover
* double{0.4}, // mutation rate
* size_t{5}, // mutation selector
* size_t{6}, // mutation
* size_t{7}, // replacement
* size_t{8}, // continuator
* size_t{9} // nb of offsprings
* });
* foundry.select({0, 1, 2, 3, 4, 5, 6, 7, 8, 9});
* @endcode
*
* @note by default, the firsts of the 10 operators are selected.
* @note: by default, the firsts of the 10 operators are selected.
*
* If you don't (want to) recall the order of the operators in the encoding,
* you can use the `index()` member, for example:
* @code
* foundry.at(foundry.continuators.index()) = size_t{2}; // select the third continuator
* foundry.at(foundry.continuators.index()) = 2; // select the third continuator
* @endcode
*
* Now, you can call the foundry just like any eoAlgo, by passing it an eoPop:
* @code
* foundry(pop);
* @endcode
*
* foundry(pop);
* @encode
* It will instantiate the needed operators (only) and the algorithm itself on-the-fly,
* and then run it.
*
* @note Thanks to the underlying eoOperatorFoundry, not all the added operators are instantiated.
* Every instantiation is deferred upon actual use. That way, you can still reconfigure them
* at any time with `eoForgeOperator::setup`, for example:
* @code
* foundry.selector.at(0).setup(0.5); // Will call constructor's arguments
* @endcode
* @note: Thanks to the underlying eoOperatorFoundry, not all the added operators are instantiated.
* Every instantiation is deferred upon actual use. That way, you can still reconfigure them
* at any time with `eoForgeOperator::setup`, for example:
* @code
* foundry.selector.at(0).setup(0.5); // Will call constructor's arguments
* @endcode
*
* @ingroup Foundry
* @ingroup Algorithms
@ -98,8 +85,8 @@ class eoAlgoFoundryFastGA : public eoAlgoFoundry<EOT>
eoAlgoFoundryFastGA(
eoInit<EOT> & init,
eoEvalFunc<EOT>& eval,
const size_t max_evals = 10000,
const size_t max_restarts = std::numeric_limits<size_t>::max()
size_t max_evals = 10000,
size_t max_restarts = std::numeric_limits<size_t>::max()
) :
eoAlgoFoundry<EOT>(10),
@ -124,31 +111,31 @@ class eoAlgoFoundryFastGA : public eoAlgoFoundry<EOT>
public:
/* Operators containers @{ */
eoParameterFoundry< double > crossover_rates;
eoParameterFoundry< double > crossover_rates;
eoOperatorFoundry< eoSelectOne<EOT> > crossover_selectors;
eoOperatorFoundry< eoQuadOp<EOT> > crossovers;
eoOperatorFoundry< eoSelectOne<EOT> > aftercross_selectors;
eoParameterFoundry< double > mutation_rates;
eoParameterFoundry< double > mutation_rates;
eoOperatorFoundry< eoSelectOne<EOT> > mutation_selectors;
eoOperatorFoundry< eoMonOp<EOT> > mutations;
eoOperatorFoundry< eoReplacement<EOT> > replacements;
eoOperatorFoundry< eoContinue<EOT> > continuators;
eoParameterFoundry< size_t > offspring_sizes;
eoParameterFoundry< size_t > offspring_sizes;
/* @} */
/** instantiate and call the pre-selected algorithm.
*/
void operator()(eoPop<EOT>& pop)
{
assert( crossover_selectors.size() > 0); assert(this->rank( crossover_selectors) < crossover_selectors.size());
assert( crossovers.size() > 0); assert(this->rank( crossovers) < crossovers.size());
assert(aftercross_selectors.size() > 0); assert(this->rank(aftercross_selectors) < aftercross_selectors.size());
assert( mutation_selectors.size() > 0); assert(this->rank( mutation_selectors) < mutation_selectors.size());
assert( mutations.size() > 0); assert(this->rank( mutations) < mutations.size());
assert( replacements.size() > 0); assert(this->rank( replacements) < replacements.size());
assert( continuators.size() > 0); assert(this->rank( continuators) < continuators.size());
assert( crossover_selectors.size() > 0); assert(this->at( crossover_selectors.index()) < crossover_selectors.size());
assert( crossovers.size() > 0); assert(this->at( crossovers.index()) < crossovers.size());
assert(aftercross_selectors.size() > 0); assert(this->at(aftercross_selectors.index()) < aftercross_selectors.size());
assert( mutation_selectors.size() > 0); assert(this->at( mutation_selectors.index()) < mutation_selectors.size());
assert( mutations.size() > 0); assert(this->at( mutations.index()) < mutations.size());
assert( replacements.size() > 0); assert(this->at( replacements.index()) < replacements.size());
assert( continuators.size() > 0); assert(this->at( continuators.index()) < continuators.size());
// Objective function calls counter
eoEvalCounterThrowException<EOT> eval(_eval, _max_evals);
@ -178,7 +165,7 @@ class eoAlgoFoundryFastGA : public eoAlgoFoundry<EOT>
try {
// restart(pop);
algo(pop);
} catch(eoMaxEvalException & e) {
} catch(eoMaxEvalException e) {
#ifndef NDEBUG
eo::log << eo::debug << "Reached maximum evaluations: " << eval.getValue() << " / " << _max_evals << std::endl;
#endif
@ -194,18 +181,17 @@ class eoAlgoFoundryFastGA : public eoAlgoFoundry<EOT>
std::string name()
{
std::ostringstream name;
name << "crossover_rate: " << this-> crossover_rate() << " + ";
name << "crossover_selector: " << this-> crossover_selector().className() << " [" << this->rank( crossover_selectors) << "] + ";
name << "aftercross_selector: " << this->aftercross_selector().className() << " [" << this->rank(aftercross_selectors) << "] + ";
name << "crossover: " << this-> crossover().className() << " [" << this->rank( crossovers) << "] + ";
name << "mutation_rate: " << this-> mutation_rate() << " + ";
name << "mutation_selector: " << this-> mutation_selector().className() << " [" << this->rank( mutation_selectors) << "] + ";
name << "mutation: " << this-> mutation().className() << " [" << this->rank( mutations) << "] + ";
name << "replacement: " << this-> replacement().className() << " [" << this->rank( replacements) << "] + ";
name << "continuator: " << this-> continuator().className() << " [" << this->rank( continuators) << "] + ";
name << "offspring_size: " << this-> offspring_size() << "";
return name.str();
name << "crossover_rates: " << this->at( crossover_rates.index()) << " (" << this-> crossover_rate() << ") + ";
name << "crossover_selectors: " << this->at( crossover_selectors.index()) << " (" << this-> crossover_selector().className() << ") + ";
name << "aftercross_selector: " << this->at(aftercross_selectors.index()) << " (" << this->aftercross_selector().className() << ") + ";
name << "crossovers: " << this->at( crossovers.index()) << " (" << this-> crossover().className() << ") + ";
name << "mutation_rates: " << this->at( mutation_rates.index()) << " (" << this-> mutation_rate() << ") + ";
name << "mutation_selectors: " << this->at( mutation_selectors.index()) << " (" << this-> mutation_selector().className() << ") + ";
name << "mutations: " << this->at( mutations.index()) << " (" << this-> mutation().className() << ") + ";
name << "replacements: " << this->at( replacements.index()) << " (" << this-> replacement().className() << ") + ";
name << "continuators: " << this->at( continuators.index()) << " (" << this-> continuator().className() << ") + ";
name << "offspring_sizes: " << this->at( offspring_sizes.index()) << " (" << this-> offspring_size() << ")";
return name.str();
}
protected:
@ -215,97 +201,61 @@ class eoAlgoFoundryFastGA : public eoAlgoFoundry<EOT>
const size_t _max_restarts;
public:
/** Currently selected continuator.
*/
eoContinue<EOT>& continuator()
{
const size_t r = this->rank(continuators);
assert(r < continuators.size());
return continuators.instantiate(r);
assert(this->at(continuators.index()) < continuators.size());
return continuators.instantiate(this->at(continuators.index()));
}
/** Currently selected crossover_rate.
*/
double& crossover_rate()
{
// We could have used `decltype(crossover_rates)::Type` instead of `double`, here,
// but this is less readable and the type is declared just above,
// so we are supposed to know it.
const double val = this->value(crossover_rates);
assert(crossover_rates.min() <= val and val <= crossover_rates.max());
return crossover_rates.instantiate(val);
return crossover_rates.instantiate(this->at(crossover_rates.index()));
}
/** Currently selected crossover.
*/
eoQuadOp<EOT>& crossover()
{
const size_t r = this->rank(crossovers);
assert(r < crossovers.size());
return crossovers.instantiate(r);
assert(this->at(crossovers.index()) < crossovers.size());
return crossovers.instantiate(this->at(crossovers.index()));
}
/** Currently selected mutation_rate.
*/
double& mutation_rate()
{
const double val = this->value(mutation_rates);
assert(mutation_rates.min() <= val and val <= mutation_rates.max());
return mutation_rates.instantiate(val);
return mutation_rates.instantiate(this->at(mutation_rates.index()));
}
/** Currently selected mutation.
*/
eoMonOp<EOT>& mutation()
{
const size_t r = this->rank(mutations);
assert(r < mutations.size());
return mutations.instantiate(r);
assert(this->at(mutations.index()) < mutations.size());
return mutations.instantiate(this->at(mutations.index()));
}
/** Currently selected crossover_selector.
*/
eoSelectOne<EOT>& crossover_selector()
{
const size_t r = this->rank(crossover_selectors);
assert(r < crossover_selectors.size());
return crossover_selectors.instantiate(r);
assert(this->at(crossover_selectors.index()) < crossover_selectors.size());
return crossover_selectors.instantiate(this->at(crossover_selectors.index()));
}
/** Currently selected aftercross_selector.
*/
eoSelectOne<EOT>& aftercross_selector()
{
const size_t r = this->rank(aftercross_selectors);
assert(r < aftercross_selectors.size());
return aftercross_selectors.instantiate(r);
assert(this->at(aftercross_selectors.index()) < aftercross_selectors.size());
return aftercross_selectors.instantiate(this->at(aftercross_selectors.index()));
}
/** Currently selected mutation_selector.
*/
eoSelectOne<EOT>& mutation_selector()
{
const size_t r = this->rank(mutation_selectors);
assert(r < mutation_selectors.size());
return mutation_selectors.instantiate(r);
assert(this->at(mutation_selectors.index()) < mutation_selectors.size());
return mutation_selectors.instantiate(this->at(mutation_selectors.index()));
}
/** Currently selected offspring_size.
*/
size_t& offspring_size()
{
const size_t val = this->len(offspring_sizes);
assert(offspring_sizes.min() <= val and val <= offspring_sizes.max());
return offspring_sizes.instantiate(val);
return offspring_sizes.instantiate(this->at(offspring_sizes.index()));
}
/** Currently selected replacement.
*/
eoReplacement<EOT>& replacement()
{
const size_t r = this->rank(replacements);
assert(r < replacements.size());
return replacements.instantiate(r);
assert(this->at(replacements.index()) < replacements.size());
return replacements.instantiate(this->at(replacements.index()));
}
};

View file

@ -54,11 +54,8 @@ public:
/// Ctor, make sure that at least on continuator is present
eoCombinedContinue( eoContinue<EOT>& _cont)
: eoContinue<EOT>(), std::vector<eoContinue<EOT>* >(1, &_cont)
{ }
eoCombinedContinue( std::vector<eoContinue<EOT>*> _conts )
: eoContinue<EOT>(), std::vector<eoContinue<EOT>* >(_conts)
{ }
{
}
/* FIXME remove in next release
/// Ctor - for historical reasons ... should disspear some day

View file

@ -174,18 +174,18 @@ protected:
// if the flight does not need to be used, use the dummy flight instance
class eoDummyFlight:public eoFlight < POT >
{
public:
eoDummyFlight () {}
void operator() (POT &) override {}
} dummyFlight;
public:
eoDummyFlight () {}
void operator () (POT &) {}
}dummyFlight;
// if the initializer does not need to be used, use the dummy one instead
class eoDummyInitializer:public eoInitializerBase < POT >
{
public:
eoDummyInitializer () {}
void operator() () override {}
} dummyInit;
public:
eoDummyInitializer () {}
void operator () (POT &) {}
}dummyInit;
};
/**

View file

@ -15,10 +15,9 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
© 2020 Thales group
© 2022 Institut Pasteur
Authors:
Johann Dreo <johann@dreo.fr>
Johann Dreo <johann.dreo@thalesgroup.com>
*/
#ifndef _eoEvalFoundryEA_H_
@ -71,6 +70,13 @@ public:
i_repl(foundry.replacements.index())
{ }
protected:
const size_t i_cont;
const size_t i_cros;
const size_t i_muta;
const size_t i_sele;
const size_t i_repl;
public:
/** Decode the high-level problem encoding as an array of indices.
@ -84,7 +90,7 @@ public:
* auto& cont = foundry.continuator(); // Get the configured operator
* @encode
*/
typename eoAlgoFoundry<SUB>::Encodings decode( const EOT& sol ) const
std::vector<size_t> decode( const EOT& sol ) const
{
// // Denormalize
// size_t cont = static_cast<size_t>(std::ceil( sol[i_cont] * _foundry.continuators.size() ));
@ -119,18 +125,18 @@ public:
_subpb_eval(pop,pop);
auto config = decode(sol);
size_t cont = std::get<size_t>(config[i_cont]);
size_t cros = std::get<size_t>(config[i_cros]);
size_t muta = std::get<size_t>(config[i_muta]);
size_t sele = std::get<size_t>(config[i_sele]);
size_t repl = std::get<size_t>(config[i_repl]);
double cont = config[i_cont];
double cros = config[i_cros];
double muta = config[i_muta];
double sele = config[i_sele];
double repl = config[i_repl];
if(
cont < _foundry.continuators.size()
and cros < _foundry.crossovers .size()
and muta < _foundry.mutations .size()
and sele < _foundry.selectors .size()
and repl < _foundry.replacements.size()
0 <= cont and cont < _foundry.continuators.size()
and 0 <= cros and cros < _foundry.crossovers .size()
and 0 <= muta and muta < _foundry.mutations .size()
and 0 <= sele and sele < _foundry.selectors .size()
and 0 <= repl and repl < _foundry.replacements.size()
) {
_foundry.select(config);
@ -149,13 +155,6 @@ protected:
eoAlgoFoundryEA<SUB>& _foundry;
const typename EOT::Fitness _penalization;
const size_t _pop_size;
const size_t i_cont;
const size_t i_cros;
const size_t i_muta;
const size_t i_sele;
const size_t i_repl;
};
/** Helper function to instanciate an eoEvalFoundryEA without having to indicate the template for the sub-problem encoding.

Some files were not shown because too many files have changed in this diff Show more