Compare commits

..

164 commits

Author SHA1 Message Date
Johann Dreo
3259d1b452 doc: bump version + clean authors list 2025-04-16 13:42:29 +02:00
Alessandro Sidero
c660489eaf
Optimize eoRanking: Add caching and index vector (#80)
* Adds eoRankingCached with better documentation
* Optimize eoRanking with caching and index vector
* Adds t-eoRankingCached.cpp
2025-04-15 18:04:35 +02:00
Johann Dreo
400c69c49a doc: mention Apptainer in INSTALL 2025-04-08 19:45:59 +02:00
Johann Dreo
bee47592af doc: adds howto_build_paradiseo script for apptainer 2025-04-07 23:06:52 +02:00
Johann Dreo
e14220ff69 fix(checkpoint): initialize a pointer 2025-04-07 22:57:21 +02:00
Johann Dreo
c218a19de6 fix(doc): disable doc-mpi 2025-04-07 22:56:58 +02:00
Johann Dreo
4b4344664b update(README): link to cmake-gui, citation ref 2025-04-07 14:50:03 +02:00
Johann Dreo
b8efdda6a2 Merge branch 'setup-ccache' of github.com:Jxtopher/nojhan_paradiseo 2025-04-07 14:18:58 +02:00
Johann Dreo
22275e434b fix several warnings
Probably fixes a bug in es/CMA, which has been deprecated for a long time in favor of the EDO module anyway.
2025-04-07 14:16:37 +02:00
Jxtopher
cfcd6e22bb Ccache setup
The goal is to speed up recompilation using ccache.

Ccache is a tool that speeds up recompilation of C/C++ code. It does this by caching the results of previous compilations.
When you recompile code, ccache checks if it has already compiled the same code with the same compiler flags. If so, it uses the cached result instead of recompiling.
2025-04-04 21:59:27 +02:00
48ca0fa5b8 Merge branch 'master' of github.jdreo:jdreo/paradiseo 2025-04-04 21:46:33 +02:00
172798a637 revert 399b22266 (virtual fitness interface temptative)
Incompatible with MOEO's change of interface.
2025-04-04 21:46:04 +02:00
7c88ec4fa7 feat(EO): allow overriding fitness accessors
May be useful for debugging, by tracing when fitness assignement occurs.
2025-04-04 21:45:56 +02:00
aa242bd4d6 Merge tag 'v3.0.0' 2025-04-04 21:23:53 +02:00
3dc2058400
Merge pull request #78 from Alessandro624/fix-mpi-ale
fix(MPI): resolved cyclic inclusion and MPI issue
2025-03-21 09:05:54 +01:00
Alessandro Sidero
77148b5a97 fix(MPI): resolved cyclic inclusion and MPI issue 2025-02-24 19:07:10 +01:00
Johann Dreo
d3a2ab5e84 fix(EDO): constructor declarations without templates 2024-10-03 10:08:00 +02:00
Johann Dreo
190a30495e fix(EO): allow readFrom to work on std::cin + invalidTag
- std::cin does not allow seekg/tellg, so instead one wrap the read string
  in a istringstream, and then read from it.
  This allows to read from any istream, with or without seekg.
- Adds an EO::invalidTag member, in case someone would need to use it
  (for instance as a regexp to sanitize inputs).
2024-09-30 20:42:20 +02:00
Johann Dreo
8ea6e2b680 feat(eo): adds eoRealToIntInit 2024-09-27 12:20:10 +02:00
Johann Dreo
19ec4c4ff7 feat(eo): wrap ops on float vecs into ops on int vecs
Adds wrapper classes to make any MonOp or QuadOp that operates on eoReal embbedable in any operator needing an eoInt.
2024-09-26 13:24:10 +02:00
Johann Dreo
846006c613 feat(moSA): adds a constructor without cool but with cont 2024-09-21 13:53:38 +02:00
Johann Dreo
db24e611b7 refactor(tests): reduce runtime for foundry tests 2024-09-11 11:04:29 +02:00
cf086ea9b9 fix(moBinaryPartition): finalize integration in <mo> 2024-09-10 20:26:36 +02:00
1c853ecdb9 revert 399b22266 (virtual fitness interface temptative)
Incompatible with MOEO's change of interface.
2023-02-10 11:54:45 +01:00
dcac78cdf5 fix(mo): missing include 2023-02-10 11:54:18 +01:00
e5c387b567 fix(eoStandardBitMutation):
- Fix all operators in eoStandardBitMutation.h
- Bitflip componennt was not bound, use explicit assignement of rates.
- Fix normal and fast operators algorithms.

Co-authored-by: Potalas <potalas@free.fr>
2023-02-10 11:53:53 +01:00
ab375d55ac refactor(mo): use clog instead of cout & use at accessors in Debug builds
Should really use eo::log, but waiting for logger refactoring.
2023-02-10 09:52:59 +01:00
399b222661 feat(EO): allow overriding fitness accessors
May be useful for debugging, by tracing when fitness assignement occurs.
2023-02-10 09:52:59 +01:00
BertheasLeo
afa0d18d1e Update edoEstimatorNormalAdaptive.h
Correction aliasing errror on Eigen
2023-02-10 09:45:06 +01:00
BertheasLeo
7b8e393670 Update eoSIGContinue.h
Correction sighandler is not defined on Windows
2023-02-10 09:45:06 +01:00
Johann Dreo
e23151d666 feat: prepare the use of binary partitions for signatures 2022-09-12 15:20:05 +02:00
Johann Dreo
b96b537ed1 fix(nbhood): make accessors const 2024-09-10 16:47:28 +02:00
Johann Dreo
a376921f07 add save-sol to output all solutions to a file 2023-03-28 18:58:51 +02:00
Johann Dreo
d64f2b38ed refactor: put cache in lib + clean doc 2023-02-06 23:12:36 +01:00
Johann Dreo
e57b504cd6 refactor(app): usable output 2023-02-03 11:46:17 +01:00
Johann Dreo
79e2c01ca8 refactor(app): separate main exe and datatester
better log
2023-02-03 10:35:10 +01:00
Johann Dreo
df723331be refactor(fitness): store cache with the fitness
to allow rollback with minimal mem footprint
2023-02-02 14:48:02 +01:00
Johann Dreo
237426a6b4 refactor while hunting a bug 2023-01-26 11:48:44 +01:00
Johann Dreo
36fe6e6f7d fix a warning 2023-01-18 11:28:50 +01:00
Johann Dreo
86c750618f more doc 2023-01-18 11:14:13 +01:00
Johann Dreo
bfce997ce8 first part of partial signature evaluation 2022-10-18 11:12:38 +02:00
Johann Dreo
1d640b3251 feat: adds partial eval and tests 2022-10-03 16:11:37 +02:00
Johann Dreo
2accb17599 document everything and remove dead code 2022-09-13 15:25:33 +02:00
Johann Dreo
11f49e58d7 feat: prepare the use of binary partitions for signatures 2022-09-12 15:20:05 +02:00
Johann Dreo
a6a3f799e7 fix(eoParallel): declutch _t_start under _OPENMP 2024-09-10 10:57:50 +02:00
Johann Dreo
df8c457f75 fix(moeoSPEA2Archive): correct members init order 2024-09-10 10:45:18 +02:00
Johann Dreo
867b1c289b fix(eoEvalUserTimeThrowException): preprocessor test for POSIX and UNIX 2024-09-10 10:44:42 +02:00
Johann Dreo
32195a480b fix(selectors): comment out unused variable 2024-09-10 09:26:00 +02:00
Johann Dreo
c23b9c160a fix(selectors): correctly initialize rawTotal 2024-09-10 09:22:16 +02:00
Johann Dreo
1a61cd1f1c fix(eoGnuplot): get rid of warnings about unused variables 2024-09-10 09:21:51 +02:00
Johann Dreo
8dd4f529f2 fix(eoExceptions): do not return a ref from a temp 2024-09-10 09:21:15 +02:00
Johann Dreo
51be7e324b fix(moRndVectorVNSelection): use shuffle for modern compilers 2024-09-05 14:42:40 +02:00
Johann Dreo
732fe097cb fix(doc): use current source dir and not the root one.
Allow Paradiseo to be built as a Git submodule of another project.
2024-09-04 08:55:48 +02:00
Johann Dreo
84148824e0 fix: remove a lot of trivial warnings 2024-08-23 18:00:31 +02:00
Johann Dreo
a16298c58b Merge branch 'master' of https://gitlab.inria.fr/paradiseo/paradiseo 2024-08-23 16:25:23 +02:00
Johann Dreo
332d078902 feat(doc): recent articles first 2024-08-23 16:21:05 +02:00
Johann Dreo
dde057b12b feat(doc): mention partial evaluation for combinatorics 2024-08-23 15:22:17 +02:00
Eremey Valetov
a5d3bf8601 docs: add accelerator physics paper to publications list 2024-08-23 14:55:58 +02:00
Johann Dreo
22b74e9c07 fix(eoEvalFoundryEA): reorder members to avoid warning 2024-08-23 14:53:01 +02:00
Johann Dreo
fefb2af4dd REFACTOR!eoForge*): separate raw pointres from shared ones
- Move the instantiate(double) interfaces of eoForgeVector as instantiate_from.
- Adds two separated sets members for instantiation.

BREAKING CHANGE
2024-08-23 14:53:01 +02:00
Johann Dreo
3cc374ce5c fix(warnings): do not ignore return from system 2024-08-23 14:53:01 +02:00
Johann Dreo
b4e89d8f51 fix(deprecated): guard from bind and *_function
Deprecated since C++11, removed in C++17.
2024-08-23 14:53:01 +02:00
Johann Dreo
09a26fdc62 fix(eoForge): missing header 2024-08-23 14:53:01 +02:00
Johann Dreo
4bbb4a595e fix(mpi): fix some namespaces issues with mpi 2024-08-23 14:53:01 +02:00
Johann Dreo
c442d8a0a2 Revert "fix!(eoBit): defaults to char for scalar type"
This reverts commit 06e0cc0162b6f753d92076c510d7124d82a3def1.
2024-08-23 14:53:01 +02:00
Jxtopher
93e89828b8 Fix CI: random class issue, t-eoRoulette and update the workflow 2024-08-23 14:52:58 +02:00
Johann Dreo
ec1a0f0c62 fix(eoForgeVector): use shared_ptr insteadof raw ones + adds instantiate_ptr interface 2024-08-22 22:21:57 +02:00
Johann Dreo
6f7d505a2a fix(rnd): use STL's rand gen for shuffles
Previous implementation used Paradiseo's own random generator system,
now superseeded by the STL's one.
2024-08-19 11:14:21 +02:00
Johann Dreo
55b2f57d19 fix!(eoBit): defaults to char for scalar type
Since STL's vector of bool is not a vector of bool, `swap`ing bool elements in an eoBit can lead to errors.
Using `char` is a saner default.

Potential BREAKING CHANGE.
2024-08-19 11:13:53 +02:00
e643468de8 revert 399b22266 (virtual fitness interface temptative)
Incompatible with MOEO's change of interface.
2024-04-08 22:20:00 +02:00
f30240cb44 fix(mo): missing include 2024-04-08 22:20:00 +02:00
ff744aea7c fix(eoStandardBitMutation):
- Fix all operators in eoStandardBitMutation.h
- Bitflip componennt was not bound, use explicit assignement of rates.
- Fix normal and fast operators algorithms.

Co-authored-by: Potalas <potalas@free.fr>
2024-04-08 22:20:00 +02:00
9cb60e4b10 refactor(mo): use clog instead of cout & use at accessors in Debug builds
Should really use eo::log, but waiting for logger refactoring.
2024-04-08 22:20:00 +02:00
5a7fdf7ed3 feat(EO): allow overriding fitness accessors
May be useful for debugging, by tracing when fitness assignement occurs.
2024-04-08 22:20:00 +02:00
BertheasLeo
bad5d6cbb8 Update edoEstimatorNormalAdaptive.h
Correction aliasing errror on Eigen
2024-04-08 22:20:00 +02:00
BertheasLeo
5e0e6fcd79 Update eoSIGContinue.h
Correction sighandler is not defined on Windows
2024-04-08 22:20:00 +02:00
c2a3ed4e7f fix(mo): comment out unused parameters
Removes -Wunused-parameters warnings.
2022-09-10 06:27:58 +02:00
843aa6fc37 fix(mo): comment out unused parameters
Removes -Wunused-parameters warnings.
2022-09-10 06:27:46 +02:00
1a980c442d feat: add an eoForgeMap
Same features than an eoForgeVector,
but allowing to bind a string name to the instance.
2022-09-10 06:02:15 +02:00
ff09b4bcc7 fix logo display in readme 2022-09-10 06:02:15 +02:00
AI Xin
1f1f598314 add mo tutorial doc in Markdown format
The original tutorial link[http://paradiseo.gforge.inria.fr/index.php?n=Doc.Tutorials] is broken. I found the archive from here: https://web.archive.org/web/20210119160107/http://paradiseo.gforge.inria.fr/index.php?n=Doc.Tutorials
2022-09-10 06:02:15 +02:00
80140ddcc3 feat: add an eoForgeMap
Same features than an eoForgeVector,
but allowing to bind a string name to the instance.
2022-09-10 06:01:37 +02:00
c2f2e635c8 fix Ubuntu-related memory allocation bug 2022-09-10 06:01:37 +02:00
023cb45ca5
fix logo display in readme 2022-08-31 23:46:46 +02:00
c8d02c23cf
Merge pull request #65 from Scicomath/add-mo-tuturial-doc
Add mo tutorial doc in Markdown format
2022-05-09 10:21:33 +03:00
AI Xin
0d3580ae2d add mo tutorial doc in Markdown format
The original tutorial link[http://paradiseo.gforge.inria.fr/index.php?n=Doc.Tutorials] is broken. I found the archive from here: https://web.archive.org/web/20210119160107/http://paradiseo.gforge.inria.fr/index.php?n=Doc.Tutorials
2022-05-08 18:59:34 +08:00
3b7ffbbfae fix Ubuntu-related memory allocation bug 2022-01-31 20:14:38 +01:00
132eb4f50e refactor doc style 2022-01-27 13:11:20 +01:00
8948f0a3dc fix doc: big update
- use single doxyfile instead of one per module
- use a cleaner and more modern style
- reorder sections to put details first
- hide diagrams by default
- remove deprecated doxygen variables
- disable latex generation by default
- fix some doc typos
2022-01-26 16:45:51 +01:00
02eb0e967d fix eoAlgoFoundry management of numeric parameters
- Use a variant to avoid implicit casting to integer when selecting with brace-initialization.
- Add more doc around parameter forges.
2022-01-26 10:40:50 +01:00
3a6236594e fix foundries examples
Were declaring forges for parameters, the old way.
2022-01-23 18:18:40 +01:00
4ee48e760b refactor UF_random_generator to fit the new std::shuffle 2022-01-23 18:17:48 +01:00
009ef5e1d8 fix warning about useless arg 2022-01-23 18:17:14 +01:00
ef0e6531ee fix warnings about useless typedef 2022-01-23 18:15:38 +01:00
dfb6f7c2d9 fix warning on signedess of comparison 2022-01-22 18:40:02 +01:00
Potalas
e5b5e8807d The new feature onlymutga with new mutation and experiments 2022-01-05 10:57:49 +01:00
345dc16df6 Merge branch 'master' of github.jdreo:jdreo/paradiseo 2022-01-04 11:05:49 +01:00
a96db239c4 update the doc index
- get rid of several INRIA's gforge links
- update the last reference
2022-01-04 11:04:11 +01:00
00b66afcaa fix a missing update in fastga.sindef 2022-01-04 11:03:53 +01:00
Johann Dreo
75fd06abc1
fix missing dep in action 2021-12-11 21:25:17 +01:00
Johann Dreo
069a05edc9
Fix ubuntu debug action 2021-12-11 18:25:53 +01:00
Johann Dreo
62d3b2f68f
Add a Github action 2021-12-11 18:14:16 +01:00
63d176c7fa Merge branch 'master' of github.jdreo:jdreo/paradiseo 2021-11-10 09:38:45 +01:00
00c6a8c454 change the chat address 2021-11-10 09:37:21 +01:00
104d5dc717 fix signal management on MacOS 2021-11-03 16:56:23 +01:00
ef3e78b6dc Merge branch 'feat+num_foundry' of github.jdreo:jdreo/paradiseo 2021-11-03 16:22:58 +01:00
2d41e2c035 fix licenses
- summary of licenses at root
- license files in modules
2021-11-03 15:28:52 +01:00
a08a8dbd42 Merge branch 'master' of gitlab.inria.fr:paradiseo/paradiseo 2021-11-03 15:13:05 +01:00
27a8a6f754 Merge branch 'feat+num_foundry' 2021-11-03 14:59:55 +01:00
GMYS Jan
f89bad4aec Add LICENSE 2021-09-29 08:39:18 +00:00
Johann Dreo
9e672182a8
Merge pull request #2 from AlixZh/feat+num_foundry
[fastga] Add scripts for parsing and archive link
2021-09-07 09:45:23 +02:00
Alix ZHENG
807be1b3c2 Add scripts for parsing and archive link 2021-09-07 00:27:44 +02:00
Johann Dreo
9164ecf8c6
Merge pull request #1 from AlixZh/feat+num_foundry
Merge some experimental scripts for irace/fastga
2021-09-06 10:07:32 +02:00
Alix ZHENG
6f0f2fb2e6 Add the final experimental scripts 2021-09-05 20:49:47 +02:00
Alix ZHENG
6febf4cceb Add experimental scripts for irace/fastga 2021-08-30 09:44:06 +02:00
c9cbd4ee14 move scripts in irace/expe/alpha/ 2021-08-25 09:18:20 +02:00
e2b74349e1 [fastga] adds a fitness stoping criterion 2021-07-30 11:16:30 +02:00
558d476ef3 feat: adds a constructor taking a vector to eoCombinedContinue 2021-07-30 11:15:59 +02:00
eb9bd4a405 make some eoAlgoFoundryFastGA's parameters const 2021-07-30 10:30:37 +02:00
6c3bffd8c2 [fastga] fix budget-related issues
Was overridding the max-evals budget in certain cases.
2021-07-30 10:29:03 +02:00
83452f8939 Merge branch 'allow-submodule' of https://github.com/pinho/paradiseo 2021-07-21 08:29:47 +02:00
648357de64 disable objective transformation in W-Model of fastga 2021-07-19 16:34:25 +02:00
864bbf697d adds the pop_size parameters as managed by fastga 2021-07-19 12:08:04 +02:00
Ronaldd Pinho
b7542ef73b replace base directory references in main CMakeLists.txt 2021-07-16 11:12:32 -03:00
f4a8f97f70 add an example of complex build script for fastga 2021-07-15 19:20:04 +02:00
18fec047ad fix clang 10 compatibility
- random_shuffle is replaced by shuffle
- get rid of EO stuff in eoPop, superseeded by stdlib random
- get rid of bind2nd and use lambdas
2021-07-15 18:52:21 +02:00
949b5818a2 adds a definition file for building fastga as a Singularity container 2021-07-08 12:19:10 +02:00
cd7787bbab feat: adds eoForgeScalar and eoParameterFoundry
- Get arithmetic types out of eoOperatorFoundry in eoParameterFoundry.
- Allow for metric space variables management within irace.
2021-07-08 08:17:30 +02:00
8e960b23f3 update irace/fastga to follow recent IOH refactoring 2021-07-07 13:07:38 +02:00
da44681fd7 redact name in doc 2021-07-07 12:59:16 +02:00
afc28931e4 Merge branch 'master' of gitlab.inria.fr:paradiseo/paradiseo
Just a merge of the READMEs
2021-03-26 09:25:14 +01:00
1e93e8d3c2 [irace] add script to run random algorithms 2021-02-16 15:25:21 +01:00
425a71d6a6 [irace] script to run all elites on all problems 2021-02-16 09:04:56 +01:00
58e206cb40 [irace] feat more parse scripts 2021-02-03 16:58:26 +01:00
202246be02 [irace] add FastGA grammar diagram 2021-02-03 10:05:07 +01:00
1c940d6ec4 [irace]_add architecture diagram 2021-02-03 10:01:17 +01:00
Amine Aziz-Alaoui
2da4a02092 [irace] fix default configuration 2021-02-03 10:00:32 +01:00
Amine Aziz-Alaoui
a959a3b57e [irace] add expe run scripts 2021-02-03 10:00:04 +01:00
2326fd8c8b fix irace.log parser
Was parsing the ID as the performance.
2021-01-28 19:10:09 +01:00
e617916e98 feat irace add script to parse irace to csv 2021-01-25 13:48:52 +01:00
1b4f9447f2 irace feat: scripts to run baseline and plot ECDF histograms 2021-01-23 20:55:13 +01:00
222c86143f irace feat: add a way to print attainment histograms 2021-01-23 20:54:24 +01:00
2fe6d03c8a update the experiments config
- feat add a template in target-runner to change the problem
- loop over irace runs for each problem
2021-01-23 16:34:28 +01:00
82af0ed674 fix a filesystem bug of IOH by pre-creating directories 2021-01-23 16:34:18 +01:00
25f4592826 [irace] feat: print class names of configured operators 2021-01-21 20:19:32 +01:00
Amine Aziz-Alaoui
640fa31fb5 [irace] put results in in a directory 2021-01-19 18:42:06 +01:00
Amine Aziz-Alaoui
ccc79d68f4 [irace] make dimension depends on the problem config 2021-01-19 18:41:41 +01:00
9a10e818bc fix missing header inclusion 2021-01-19 18:18:27 +01:00
Amine Aziz-Alaoui
2b27540f17 [irace] prepare for expe
- update problems parameters
- forge useful names for CSV logger metadata
- add experiments scripts
2021-01-19 18:16:17 +01:00
GMYS Jan
f8347f9bf9 Update README.md 2020-12-17 14:01:37 +01:00
GMYS Jan
6c482dd3bc README.md replaced README 2020-11-24 16:07:11 +01:00
GMYS Jan
3396ef0814 markdown formatting 2020-11-24 16:03:45 +01:00
GMYS Jan
707b754dbf formatting 2020-11-24 16:01:30 +01:00
3d48db9f4a fix irace: use categorical config for operator lists
Keep metric integer config for numeric parameters.

Thanks to Manuel López-Ibáñez for suggesting the fix.
2020-11-13 09:34:50 +01:00
be41e22f19 comment formatting 2020-11-13 09:02:16 +01:00
5114723804 better wording 2020-11-10 14:26:34 +01:00
d03269c865 webpage: add a section about algo selection and config 2020-11-10 12:14:51 +01:00
325f3ebf30 irace: pass metadata to IOH 2020-10-18 18:29:27 +02:00
d8972be2a0 irace feat: add an option to clutch a full CSV logger 2020-10-18 18:21:22 +02:00
ce10a6d4d2 Merge branch 'irace-interface' 2020-10-11 15:44:29 +02:00
bbab2bfdcd update the INSTALL instruction files 2020-10-04 17:21:06 +02:00
1e5e355acf add a CONTRIBUTING file 2020-10-04 16:08:15 +02:00
1c229889e9
Merge pull request #52 from lucasmpavelski/patch-1
Adds: moBestNoImproveContinuator.h to mo.h
2020-09-25 20:05:24 +02:00
Lucas Marcondes Pavelski
bf8a7b6fcc
Adds: moBestNoImproveContinuator.h to mo.h
I think this import was missing.
2020-09-25 11:23:10 -03:00
350 changed files with 20446 additions and 3025 deletions

View file

@ -0,0 +1,47 @@
name: Build Debug (Ubuntu)
on: [push, pull_request]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Debug
jobs:
build:
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
# You can convert this to a matrix build if you need cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ubuntu-latest
strategy:
matrix:
compiler: [g++-10, g++-9, g++-8, g++-7, clang-6, clang-7, clang-8, clang-9, clang-10, clang-11, clang-12]
steps:
- uses: actions/checkout@v4
- name: Caching objects
id: cache-objects
uses: actions/cache@v4
with:
path: ~/.cache/ccache
key: ${{ runner.os }}-${{env.BUILD_TYPE}}-${{ matrix.compiler }}-objects
- name: Install Dependencies
shell: bash
run: |
sudo apt-get install libeigen3-dev libboost-dev
- name: Configure
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DEDO=ON -DEDO_USE_LIB=Eigen3 -DENABLE_CMAKE_EXAMPLE=ON -DENABLE_CMAKE_TESTING=ON
- name: Build
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Test
working-directory: ${{github.workspace}}/build
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -C ${{env.BUILD_TYPE}}

14
.gitignore vendored
View file

@ -1,11 +1,20 @@
# ignore html files # ignore generated files
*.html *.html
*.pdf
# ignore all textual files # ignore all textual files
*.txt *.txt
*.swp
*.swo
.kak_history
*.log
*.csv
*.ods
# ignore object and archive files # ignore object and archive files
*.[oa] *.[oa]
*.bak
*.tar*
tags tags
# ignore auto-saved files # ignore auto-saved files
@ -29,4 +38,7 @@ debug/*
build/* build/*
website/EO_star.png website/EO_star.png
website/paradiseo_logo.png website/paradiseo_logo.png
Release/*
Debug/*
Build/*

35
AUTHORS
View file

@ -1,41 +1,52 @@
Current maintainers 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 Johann Dreo <johann@dreo.fr>
==================
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 Past contributors
================= =================
atantar atantar
Alesandro Sidero
Alexandre Quemy
Alix Zheng
Amine Aziz-Alaoui
Arnaud Liefooghe
Benjamin Bouvier
Bahri
Caner Candan
Clive Canape
fatene fatene
Gustavo Romero Lopez Gustavo Romero Lopez
jboisson jboisson
Jeroen Eggermont Jeroen Eggermont
Jochen Küpper Jochen Küpper
Joost <joost@dsj.nl> Joost
Juan Julian Merelo Guervos Juan Julian Merelo Guervos
Jérémie Humeau Jérémie Humeau
Jxtopher
Karima Boufaras Karima Boufaras
legillon legillono
Leo Bertheas
Louis Da Costa Louis Da Costa
Loïc Jean David Arjanen Loïc Jean David Arjanen
Maarten Keijzer Maarten Keijzer
Mammar Amara
Manu
Marc Schoenauer Marc Schoenauer
Marie-Éleonore Marie-Éleonore
Mostepha Khouadjia Mostepha Khouadjia
Olivier König Olivier König
Pierre Savéant
Pedro Angel Castillo Valdivieso Pedro Angel Castillo Valdivieso
Potalas
Ronald Pinho
Steve Madere Steve Madere
Sébastien Cahon Sébastien Cahon
Sébastien Verel
Thomas Legrand Thomas Legrand
Thibault Lasnier
Victor Manuel Rivas Santos Victor Manuel Rivas Santos
wcancino wcancino
xohm xohm

View file

@ -1,5 +1,6 @@
# ParadiseO # ParadiseO
###################################################################################### ######################################################################################
### 0) Check the CMake version ### 0) Check the CMake version
###################################################################################### ######################################################################################
@ -12,13 +13,24 @@ cmake_minimum_required(VERSION 3.10 FATAL_ERROR)
## Name ## Name
project("ParadisEO" project("ParadisEO"
VERSION 3.0.0 VERSION 3.1.3
DESCRIPTION "Evolutionary optimization framework" DESCRIPTION "Evolutionary optimization framework"
LANGUAGES C CXX) LANGUAGES C CXX)
## Language ## Language
set(CMAKE_CXX_STANDARD 17) 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 ### 2) Check dependencies
@ -51,16 +63,16 @@ include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Target.cmake)
###################################################################################### ######################################################################################
## Paths to sources of modules ## Paths to sources of modules
set( EO_SRC_DIR "${CMAKE_SOURCE_DIR}/eo" CACHE INTERNAL "ParadisEO-EO source directory" FORCE) set( EO_SRC_DIR "${PROJECT_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( EDO_SRC_DIR "${PROJECT_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( MO_SRC_DIR "${PROJECT_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(MOEO_SRC_DIR "${PROJECT_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( SMP_SRC_DIR "${PROJECT_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( MPI_SRC_DIR "${PROJECT_SOURCE_DIR}/eo/src/mpi" CACHE INTERNAL "ParadisEO-MPI source directory" FORCE)
set(PROBLEMS_SRC_DIR "${CMAKE_SOURCE_DIR}/problems" CACHE INTERNAL "Problems dependant source directory" FORCE) set(PROBLEMS_SRC_DIR "${PROJECT_SOURCE_DIR}/problems" CACHE INTERNAL "Problems dependant source directory" FORCE)
set(CMAKE_BASE_SOURCE_DIR ${CMAKE_SOURCE_DIR}) set(CMAKE_BASE_SOURCE_DIR ${PROJECT_SOURCE_DIR})
# All libraries are built in <build_dir>/lib/ # All libraries are built in <build_dir>/lib/
set( EO_BIN_DIR "${CMAKE_BINARY_DIR}" CACHE INTERNAL "ParadisEO-EO binary directory" FORCE) set( EO_BIN_DIR "${CMAKE_BINARY_DIR}" CACHE INTERNAL "ParadisEO-EO binary directory" FORCE)
@ -80,31 +92,34 @@ set(SMP "false" CACHE BOOL "Build the SMP module")
set(MPI "false" CACHE BOOL "Build the MPI module") set(MPI "false" CACHE BOOL "Build the MPI module")
## EO Module ## EO Module
set(EO_MODULE_NAME "Evolving Object") set(MODULE_NAME "Paradiseo")
set(DOXYGEN_CONFIG_DIR ${CMAKE_CURRENT_SOURCE_DIR}/doxygen)
# set(EO_MODULE_NAME "Evolving Objects")
set(CMAKE_SOURCE_DIR ${EO_SRC_DIR}) set(CMAKE_SOURCE_DIR ${EO_SRC_DIR})
add_subdirectory(${EO_SRC_DIR}) add_subdirectory(${EO_SRC_DIR})
if(NOT EO_ONLY) if(NOT EO_ONLY)
## MO Module ## MO Module
set(MO_MODULE_NAME "Moving objects") # set(MO_MODULE_NAME "Moving Objects")
# set(MODULE_NAME "Moving Objects")
set(CMAKE_SOURCE_DIR ${MO_SRC_DIR}) set(CMAKE_SOURCE_DIR ${MO_SRC_DIR})
add_subdirectory(${MO_SRC_DIR}) add_subdirectory(${MO_SRC_DIR})
## EDO Module ## EDO Module
if(EDO) if(EDO)
set(EDO_MODULE_NAME "Evolving Distribution Objects") # set(EDO_MODULE_NAME "Evolving Distribution Objects")
set(CMAKE_SOURCE_DIR ${EDO_SRC_DIR}) set(CMAKE_SOURCE_DIR ${EDO_SRC_DIR})
add_subdirectory(${EDO_SRC_DIR}) add_subdirectory(${EDO_SRC_DIR})
endif() endif()
## MOEO Module ## MOEO Module
set(MOEO_MODULE_NAME "Multi-Objectives EO") # set(MOEO_MODULE_NAME "Multi-Objectives EO")
set(CMAKE_SOURCE_DIR ${MOEO_SRC_DIR}) set(CMAKE_SOURCE_DIR ${MOEO_SRC_DIR})
add_subdirectory(${MOEO_SRC_DIR}) add_subdirectory(${MOEO_SRC_DIR})
## SMP Module ## SMP Module
if(SMP) if(SMP)
set(SMP_MODULE_NAME "Symmetric Multi-Processing") # set(SMP_MODULE_NAME "Symmetric Multi-Processing")
set(CMAKE_SOURCE_DIR ${SMP_SRC_DIR}) set(CMAKE_SOURCE_DIR ${SMP_SRC_DIR})
add_subdirectory(${SMP_SRC_DIR}) add_subdirectory(${SMP_SRC_DIR})
endif() endif()

84
CONTRIBUTING.md Normal file
View file

@ -0,0 +1,84 @@
Licenses
========
ParadisEO modules are using free software licenses,
any contribution should be licensed under the same license.
| Module | License | Version | Copyleft | Patent-left |
|--------|---------|---------|----------|-------------|
| EO | LGPL | 2 | Lib only | No |
| EDO | LGPL | 2 | Lib only | No |
| MO | CeCILL | 2.1 | Yes | No |
| MOEO | CeCILL | 2.1 | Yes | No |
| SMP | CeCILL | 2.1 | Yes | No |
Contribution Workflow
=====================
The maintainer(s) will try to answer under a couple of weeks, if not, do not hesitate to send an e-mail.
If you're not familiar with Git and merge requests, start by cloning one of the main repository:
- `git clone https://github.com/nojhan/paradiseo.git`
- `git clone https://scm.gforge.inria.fr/anonscm/git/paradiseo/paradiseo.git`
Git workflow
------------
ParadisEO follows a classical Git workflow using merge requests.
In order to fix a bug or add a feature yourself, you would follow this process.
```bash
cd paradiseo
git pull origin master # Always start with an up-to-date version.
git checkout -b <my_feature> # Always work on a dedicated branch.
# [ make some modifications… ]
git commit <whatever>
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Debug -BUILD_TESTING=ON -DENABLE_CMAKE_TESTING=ON .. && make && ctest # Always test.
cd ..
git pull origin master # Always check that your modification still merges.
```
If everything went without error, you can either send the patch or submit a merge request.
To do so, you can either:
- submit a "pull request" on Github: [nojhan/paradiseo](https://github.com/nojhan/paradiseo),
- or send a patch on the [ParadisEO mailing list](https://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/paradiseo-users).
See below for the details.
Github pull request
-------------------
Once logged in Github, go to the [maintainer repository](https://github.com/nojhan/paradiseo) and click the "fork" button.
You should have your own copy of the ParadisEO project under your own name.
Then add it as an additional "remote" to your ParadisEO Git tree: `git remote add me <your own URL>`.
Then, checkout the branch holding the modifications you want to propose, check that it merges with the main repository
and push it on your own repository:
```bash
git checkout <my_feature>
git pull origin master
git push me <my_feature>
```
Then go to the maintainer's repository page, click on the "Pull request" tab, and on the "New pull request" button.
You should then select the maintainer's master branch on the left dropdown list, and your own `my_feature` on the right one.
Explain why the maintainer should merge your modifications and click the "Submit" button.
E-mail your patch
-----------------
Generate a patch file from the difference between your branch and a fresh master:
```bash
git pull origin master
git diff master <my_feature> > my_feature.patch
```
Then send the `my_feature.patch` (along with your explanations about why the maintainer should merge your modifications)
to the [mailing list](https://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/paradiseo-users).

200
INSTALL
View file

@ -1,200 +0,0 @@
==========================================================================================
INSTALLING PARADISEO
==========================================================================================
There is several ways to install ParadisEO, according to your needs.
==========================================================================================
WINDOWS
==========================================================================================
On Windows, and for compatibility reason, ParadisEO supply support only for MinGW.
Feel free to test with another compiler and to send us you report.
------------------------------------------------------------------------------------------
1) WITH EXE
------------------------------------------------------------------------------------------
The simpliest way ton install ParadisEO on Windows is to use the NSIS installer.
We would like to draw your attention on the fact that the PATH variable will not
be affected by the installation in order to allow anybody to install ParadisEO
without administration right. To have further information about how to use ParadisEO
in your project, see the tutorial on ParadisEO website (http://paradiseo.gforge.inria.fr/).
------------------------------------------------------------------------------------------
2) WITH CMAKE
------------------------------------------------------------------------------------------
You can also install ParadisEO using CMake. For that you must have a compiler installed,
and obviously cmake.
Then, follow UNIX instructions.
==========================================================================================
UNIX
==========================================================================================
------------------------------------------------------------------------------------------
1. WITH CMAKE
------------------------------------------------------------------------------------------
1.0 DEPENDENCIES
------------------------------------------------------------------------------------------
Optionnal
- Doxygen for documentation
- lcov for coverage
------------------------------------------------------------------------------------------
1.1 FAST INSTALLATION
------------------------------------------------------------------------------------------
After getting ParadisEO sources from repository, you have to create a build directory in order to keep your file tree clean.
> mkdir build
> cd build
To make the installation easier, ParadisEO propose you two installation types which are "Full" and "Min".
Full corresponds examples / lessons, tests and obviously libraries.
Min corresponds to libraries and headers and it is the standard behavior.
You can specified an installation type by adding the following declaration to cmake :
> cmake .. -DINSTALL_TYPE=full
> cmake .. -DINSTALL_TYPE=min
which is equivalent to
> cmake ..
Actually, by default the generator will be "Unix Makefiles" and cmake will try to look for a C++ compiler.
Be sure you have make installed, or choose an alternative according to your configuration.
To know available generators on your computer, type cmake -help. If you are on Windows and you use MinGW, you have to specify it explicitly by adding -G "MinGW Makefiles".
To compile ParadisEO simply compile sources using your generator. For instance, if you are using Unix Makefiles, type make.
------------------------------------------------------------------------------------------
1.2 BUILD TYPE
------------------------------------------------------------------------------------------
There are 2 types of build : Release or Debug.
To explicitly change the type, add -DDEBUG=true, otherwise, it will be the Release type.
------------------------------------------------------------------------------------------
1.3 COMPILERS
------------------------------------------------------------------------------------------
You can change the compiler used by CMake with the following options :
>-DCMAKE_C_COMPILER=/path/to/your/c/compiler
>-DCMAKE_CXX_COMPILER=/path/to/your/c++/compiler
------------------------------------------------------------------------------------------
1.4 INSTALLATION
------------------------------------------------------------------------------------------
WARNING : This require administration rights.
To install ParadisEO in standard paths (such as /usr/lib for lib and /usr/include for headers on UNIX-like) :
> make install
------------------------------------------------------------------------------------------
2. SPECIFIC MODULE
------------------------------------------------------------------------------------------
2.1 EO MODULE ONLY
------------------------------------------------------------------------------------------
If you want to compile and install only the Evolving Objects module, you can add to CMake the following option :
> cmake .. -DEO_ONLY
------------------------------------------------------------------------------------------
2.1 SMP MODULE
------------------------------------------------------------------------------------------
WARNING : The SMP module requires gcc 4.7 or higher. This is due to the fact that it uses the new C++ standard.
WARNING : At the moment, the SMP module does not work on Windows or Mac OS X since MinGW does not provide support for std::thread
and Apple does not supply a recent version of gcc (but you can try to compile gcc 4.7 by yourself).
To enable the compilation of the SMP module, just add -DSMP=true to CMake :
> cmake .. -DSMP=true
Depending on your distribution, you might have to give to CMake the path of gcc and g++ 4.7.
This is the case for Ubuntu 12.04 LTS for instance. Please, check installation guide on ParadisEO website for more details.
If you are in that case and assuming you have a standard path for gcc et g++ 4.7 :
> cmake .. -DSMP=true -DCMAKE_C_COMPILER=/usr/bin/gcc-4.7 -DCMAKE_CXX_COMPILER=/usr/bin/g++-4.7
------------------------------------------------------------------------------------------
2.2 PEO MODULE
------------------------------------------------------------------------------------------
WARNING : The PEO module requires libXML 2 and a MPI implementation such as MPICH2.
To enable the compilation of the PEO module, just add -DPEO=true to CMake :
> cmake .. -DPEO=true
------------------------------------------------------------------------------------------
2.3 EDO MODULE
------------------------------------------------------------------------------------------
WARNING : The EDO module requires either the Boost::ublas or the Eigen3 library.
To enable the compilation of the EDO module, just add -DEDO=true to CMake :
> cmake .. -DEDO=true
------------------------------------------------------------------------------------------
3. DOCUMENTATION
------------------------------------------------------------------------------------------
There is 2 ways to build ParadisEO documentation : module by module, or all the documentation.
Targets are :
doc for all documentations
doc-eo for building EO documentation
doc-mo for MO
doc-edo for MO
doc-moeo for MOEO
doc-smp for SMP
Each documentation are generated separatly in the module build folder.
For instance, after the generation of the MO documentation, you will find it in build/paradise-mo/doc.
------------------------------------------------------------------------------------------
4. LESSONS / EXAMPLES
------------------------------------------------------------------------------------------
Examples and lessons are generated by default.
If you want to disable lessons manually, you have to specify -DENABLE_CMAKE_TESTING=false to CMake.
If you want to build a specific lesson or example, you can check the list of available targets with make help.
All lessons are build on the same pattern : <module>Lesson<number>.
For instance, make moLesson4 will build the Lesson 4 from the MO module.
Easy, isn't it ?
------------------------------------------------------------------------------------------
5. TESTS
------------------------------------------------------------------------------------------
5.1 CTESTS
------------------------------------------------------------------------------------------
By performing tests, you can check your installation.
Testing is disable by default, except if you build with the full install type.
To enable testing, define -DENABLE_CMAKE_TESTING=true when you launch cmake.
To perform tests simply type ctest or make test.
------------------------------------------------------------------------------------------
5.2 REPORTING
------------------------------------------------------------------------------------------
Feel free to send us reports about building, installation, tests and profiling in order to help us to improve compatibilty and installation process. Sending reports is very simple :
> ctest -D Experimental
WARNING : Reports are anonymous. CTest will also send informations about your configuration such as OS, CPU frequency, etc.

217
INSTALL.md Normal file
View file

@ -0,0 +1,217 @@
Summary
=======
As Paradiseo is a development framework, you do not really need to install it on all your systems.
Just put it somewhere on your development computer, compile it from here and indicate where to find it to your favorite build system.
Build
-----
Paradiseo is mainly developed for Linux, on which it is straightforward to install a C++ build chain. For example, on Ubuntu 18.04:
```bash
sudo apt install g++-8 cmake make libeigen3-dev libopenmpi-dev doxygen graphviz libgnuplot-iostream-dev
```
Paradiseo use the CMake build system, so building it should be as simple as:
```bash
mkdir build ; cd build ; cmake -DEDO=ON .. && make -j
```
The file `howto_build_paradiseo.apptainer.def` shows you how to install and build from scratch.
It is a definition file for the [Apptainer](https://apptainer.org/) container system,
which is often used on HPC clusters.
Develop
-------
Download the quick start project template, edit the `CMakeLists.txt` file to indicate where to find Paradiseo and start developing your own solver.
If you don't know CMake or a modern build system, you should still be able to build a stand-alone code from a `paradiseo/build` directory with something like:
```bash
c++ ../solver.cpp -I../eo/src -I../edo/src -DWITH_EIGEN=1 -I/usr/include/eigen3 -std=c++17 -L./lib/ -leo -leoutils -les -lga -o solver
```
Install
-------
If you want to install ParadisEO system-wide anyway:
```bash
cmake -D CMAKE_BUILD_TYPE=Release .. && sudo make install
```
More details
============
As a templated framework, most of the ParadisEO code rely within headers and is thus compiled
by you when you build your own solver.
However, in order to save some compilation time,
the EO and EDO modules are compiled within static libraries by the default build system.
If you believe you have a working build chain and want to test if it works with ParadisEO,
you can try to build the tests and the examples.
Note that if some of them failed (but not all), you may still be able to build your own solver,
as you will most probably not use all ParadisEO features anyway.
Windows
-------
Last time we checked, ParadisEO could only be built with MinGW.
Feel free to test with another compiler and to send us your report.
As of today, we cannot guarantee that it will be easy to
install ParadisEO under Windows if you're a beginner.
There is still some (possibly outdated) help about oldest version on the [Website](http://paradiseo.gforge.inria.fr/).
If you know how to install a working compiler and the dependencies,
you may follow the same steps than the Linux process below.
If you are a beginner, we strongly suggest you install a Linux distribution
(either as an OS, as a virtual machine or using the Windows 10 compatibility layer).
Linux
-----
### Dependencies
In order to build the latest version of Paradiseo, you will need a C++ compiler supporting C++17.
So far, GCC and CLANG gave good results under Linux. You will also need the CMake and make build tools.
Some features are only available if some dependencies are installed:
- Most of the EDO module depends on either uBlas or Eigen3. The recommended package is Eigen3, which enables the adaptive algorithms.
- Doxygen is needed to build the API documentation, and you should also install graphviz if you want the class relationship diagrams.
- GNUplot is needed to have the… GNUplot graphs at checkpoints.
To install all those dependencies at once under Ubuntu (18.04), just type:
```bash
sudo apt install g++-8 cmake make libeigen3-dev libopenmpi-dev doxygen graphviz libgnuplot-iostream-dev.
```
### Build
The build chain uses the classical workflow of CMake.
The recommended method is to build in a specific, separated directory and call `cmake ..` from here.
CMake will prepare the compilation script for your system of choice which you can change with the `-G <generator-name>` option (see your CMake doc for the list of available generators).
Under Linux, the default is `make`, and a build command is straitghtforward:
```bash
mkdir build ; cd build ; cmake .. && make -j
```
There is, however, several build options which you may want to switch.
To see them, we recommend the use of a CMake gui, like ccmake or cmake-gui.
On the command line, you can see the available options with: `cmake -LH ..`.
Those options can be set with the `-D<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).
### More compilation options
Other important options are: `EDO` (which is false by default)
and parallelization options: `ENABLE_OPENMP`, `MPI`, `SMP`.
By default, the build script will build the Paradiseo libraries only.
If you `ENABLE_CMAKE_TESTING` and `BUILD_TESTING`, it will build the tests,
which you can run with the `ctest` command.
If you `ENABLE_CMAKE_EXAMPLE`, it will also build the examples.
You can change the compiler used by CMake with the following options:
`CMAKE_CXX_COMPILER=/path/to/your/c++/compiler`.
Even more details
=================
Evolving Objects (EO) module
----------------------------
If you want to compile and install only the core EO module, set `EO_ONLY`,
this can be helpful if you don't need other modules with more complex dependencies.
Shared Memory Processing (SMP) module
-------------------------------------
The SMP module requires gcc 4.7 or higher. This is due to the fact that it uses the new C++ standard.
At the moment, the SMP module does not work on Windows or Mac OS X since MinGW does not provide support for std::thread and Apple does not supply a recent version of gcc (but you can try to compile gcc 4.7 by yourself).
To enable the compilation of the SMP module, just set the `SMP` option.
Depending on your distribution, you might have to give to CMake the path of gcc and g++ 4.7.
This is the case for Ubuntu 12.04 LTS for instance.
If you are in that case and assuming you have a standard path for gcc et g++ 4.7:
```bash
cmake .. -DSMP=true -DCMAKE_C_COMPILER=/usr/bin/gcc-4.7 -DCMAKE_CXX_COMPILER=/usr/bin/g++-4.7
```
Estimating Distribution Objects (EDO) module
--------------------------------------------
To enable the compilation of the EDO module, just set the `EDO` option.
The EDO module requires a linear algebra library.
So far the core features are implemented in either [Boost::ublas](https://www.boost.org/doc/libs/release/libs/numeric/ublas) or the [Eigen3 library](https://eigen.tuxfamily.org).
The adaptive algorithms are only implemented with Eigen3, which is thus the recommended package.
Documentation
-------------
There is 2 ways to build ParadisEO documentation: module by module, or all the documentation.
Targets for the build system (usually `make`) are:
- `doc` for all documentations,
- `doc-eo` for building EO documentation,
- `doc-mo` for MO,
- `doc-edo` for MO,
- `doc-moeo` for MOEO,
- `doc-smp` for SMP.
Each documentation are generated separatly in the module build folder.
For instance, after the generation of the MO documentation, you will find it in `build/paradise-mo/doc`.
Examples
--------
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.
Easy, isn't it ?
Tests
-----
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.
To perform tests simply type `ctest` or `make test`.
Reporting
---------
Feel free to send us reports about building, installation, tests and profiling in order to help us to improve compatibilty and installation process. Generate reports is very simple:
```bash
ctest -D Experimental
```
NOTE: Reports are anonymous, but CTest will also send informations about your configuration such as OS, CPU frequency, etc.

1029
LICENSE

File diff suppressed because it is too large Load diff

View file

@ -8,7 +8,9 @@ It focus on the efficiency of the implementation of solvers, by providing:
- tools for ***automated design and selection*** of algorithms, - tools for ***automated design and selection*** of algorithms,
- a focus on ***speed*** and several ***parallelization*** options. - a focus on ***speed*** and several ***parallelization*** options.
![Paradiseo logo](https://github.com/nojhan/paradiseo/blob/master/website/paradiseo_logo_200px_dark.png) <div align="center">
<img width="640" alt="Paradiseo logo" src="https://raw.githubusercontent.com/nojhan/paradiseo/master/docs/img/paradiseo_logo_dark.svg"/>
</div>
# Quick Start # Quick Start
@ -166,7 +168,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. 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 # Code
@ -193,7 +195,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`. 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).** **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).**
@ -206,6 +208,13 @@ 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 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 ## Licenses
Paradiseo is distributed under the GNU Lesser General Public License and the CeCILL license (depending on the modules). Paradiseo is distributed under the GNU Lesser General Public License and the CeCILL license (depending on the modules).
@ -230,3 +239,35 @@ For academic articles, books, more tutorials, presentations slides,
real life example of solvers and contact information, real life example of solvers and contact information,
please see the web site (available in `paradiseo/website/index.html`). please see the web site (available in `paradiseo/website/index.html`).
# 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

View file

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

File diff suppressed because it is too large Load diff

After

Width:  |  Height:  |  Size: 296 KiB

View file

@ -28,9 +28,9 @@
<p>Shortcuts:</p> <p>Shortcuts:</p>
<ul> <ul>
<li><a href="#Why">Why choosing <em class="logo">Paradis<span class="logo_eo">eo</span></em>?</a></li> <li><a href="#Why">Why choosing <em class="logo">Paradis<span class="logo_eo">eo</span></em>?</a></li>
<li><a href="https://gforge.inria.fr/frs/?group_id=145">Downloads</a></li> <li><a href="https://github.com/nojhan/paradiseo/releases">Downloads</a></li>
<li><a href="https://gforge.inria.fr/scm/?group_id=145">Git repository</a></li> <li><a href="https://github.com/nojhan/paradiseo">Git repository</a></li>
<li><a href="http://irc.lc/freenode/paradiseo">Chat with us</a></li> <li><a href="https://app.element.io/#/room/#paradiseo:matrix.org">Chat with us</a></li>
</ul> </ul>
</div> </div>
@ -61,6 +61,7 @@
<lh><a href="#Features">Features</a></lh> <lh><a href="#Features">Features</a></lh>
<li><a href="#Component-based">Composable design</a></li> <li><a href="#Component-based">Composable design</a></li>
<li><a href="#LargeChoice">Lot of Components</a></li> <li><a href="#LargeChoice">Lot of Components</a></li>
<li><a href="#AlgoSelection">Algorithm Selection</a></li>
<li><a href="#Portability">Portability</a></li> <li><a href="#Portability">Portability</a></li>
<li><a href="#VS">VS other Frameworks</a></li> <li><a href="#VS">VS other Frameworks</a></li>
</ol> </ol>
@ -124,9 +125,9 @@
<div id="Download"> <div id="Download">
<h2><a name="Download"></a>Download</h2> <h2><a name="Download"></a>Download</h2>
Download the <a href="https://gforge.inria.fr/frs/download.php/31733/Paradiseo-2.0.1.zip">latest stable release</a>. Download the <a href="https://github.com/nojhan/paradiseo/releases">latest stable release</a>.
<p>Or clone the latest version: <code class="command">git clone git://scm.gforge.inria.fr/paradiseo/paradiseo.git</code></p> <p>Or clone the latest version: <code class="command">git clone https://github.com/nojhan/paradiseo.git</code></p>
</div> </div>
<div id="Build"> <div id="Build">
@ -146,7 +147,9 @@
<div id="Develop"> <div id="Develop">
<h2><a name="Develop"></a>Develop</h2> <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>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> <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>
@ -235,7 +238,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>. 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>
<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> <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>
</div> </div>
</div> </div>
@ -299,7 +302,7 @@
<div id="Why_efficiency"> <div id="Why_efficiency">
<h3>Efficient</h3> <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>.</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> (especially on combinatorial problems).</p>
</div> </div>
<div id="Why_efficiency_details"> <div id="Why_efficiency_details">
@ -308,6 +311,7 @@
<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>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: <p>However, we argue that:
<ul> <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>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>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> <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>
@ -324,7 +328,7 @@
<p><em class="excerpt">You can expect that validating <em>an algorithm implemented with <em class="logo">Paradis<span class="logo_eo">eo</span></em></em> will be up to <strong>10 times faster</strong> than its (heavily optimized) Python counterpart.</em> </p> <p><em class="excerpt">You can expect that validating <em>an algorithm implemented with <em class="logo">Paradis<span class="logo_eo">eo</span></em></em> will be up to <strong>10 times faster</strong> than its (heavily optimized) Python counterpart.</em> </p>
<p>To give an order of magnitude: <p>To give an order of magnitude:
<ul> <ul>
<li>If you use the "official" <em>vanilla implementation of <a href="https://github.com/CMA-ES/pycma">CMA-ES in Python/Numpy</a></em> solving the BBOB problem suite through the <a href="https://github.com/numbbo/coco">COCO plateform</a>, running the whole benchmark will take approximately <em>10 minutes</em> on a single Intel Core i5 @ 2.50GHz with a colid state disk.</li> <li>If you use the "official" <em>vanilla implementation of <a href="https://github.com/CMA-ES/pycma">CMA-ES in Python/Numpy</a></em> solving the BBOB problem suite through the <a href="https://github.com/numbbo/coco">COCO plateform</a>, running the whole benchmark will take approximately <em>10 minutes</em> on a single Intel Core i5 @ 2.50GHz with a solid state disk.</li>
<li>The same experiment, running <em>the <em class="logo">Paradis<span class="logo_eo">eo</span></em> implementation</em> using the seamless binding to the <a href="https://iohprofiler.github.io/">IOHprofiler</a> BBOB implementation, will take <em>1 minute</em>.</li> <li>The same experiment, running <em>the <em class="logo">Paradis<span class="logo_eo">eo</span></em> implementation</em> using the seamless binding to the <a href="https://iohprofiler.github.io/">IOHprofiler</a> BBOB implementation, will take <em>1 minute</em>.</li>
</ul> </ul>
</p> </p>
@ -478,6 +482,28 @@
</div> </div>
</div> </div>
<div id="AlgoSelection">
<h2><a name="AlgoSelection"></a>Algorithm Selection and Configuration</h2>
<p><em class="logo">Paradis<span class="logo_eo">eo</span></em> provides meta-algorithmics features, like on-the-fly algorithm instanciation. This is useful to dynamically assemble and run an algorithm from a simple numerical encoding. This "algorithm forge" can handle a set of operators and parameter configurations, to be assembled in different "slots" to form an algorithm.</p>
<figure>
<img src="img/bindings_ioh_irace.png"
srcset="img/bindings_ioh_irace.svg"
width="100%"
style="max-width:640px;"
title="ParadisEO interfaced with IOHexperimenter and irace Johann Dréo CC-BY-SA" />
<figcaption>A simplified example of binding between <em class="logo">Paradis<span class="logo_eo">eo</span></em>, IOHexperimenter and irace. ParadisEO provides a on-the-fly algorithm instanciation, which is ran on an IOH problem, with performances estimated with a generic and fast module. All components figured with lego bricks forms a single, integrated, binary.</figcaption>
</figure>
<p>As the <em class="logo">Paradis<span class="logo_eo">eo</span></em> codebase provides generic algorithm and a large set of operators, it's easy to have access to a huge number of algorithms alternatives: there's easily millions of unique combinations.</p>
<p>To evaluate those algorithms, you can use bindings toward fast benchmarking tools (like <a href="https://github.com/IOHprofiler/IOHexperimenter">IOHexperimenter</a>), which allow for the fastests runs of the market.</p>
<p>You can then wrap this evaluation within an optimizer, to automatically search for the best algorithm instance. For instance, you can either use an optimizer made with <em class="logo">Paradis<span class="logo_eo">eo</span></em>, either plug the binary with <a href="https://iridia.ulb.ac.be/irace/">irace</a> (<em class="logo">Paradis<span class="logo_eo">eo</span></em> provides an automatic interface generation) and reach budgets of 10000 runs in just one hour (!).</p>
<p>And <em>voilà</em>! You started by just designing a high-level view of a solver, and you now know which algorithm instance allow for the best performance.</p>
<p>Note that the binding with IOHexperimenter also allow to easily import and explore experimental results in the <a href="https://iohprofiler.liacs.nl/">IOHanalyzer HMI</a>. <em>Ohlala</em>.</p>
</div>
<div id="Portability"> <div id="Portability">
<h2><a name="Portability"></a>Portability</h2> <h2><a name="Portability"></a>Portability</h2>
@ -785,18 +811,32 @@
<ul> <ul>
<li> <li>
<p>The core EO module is described in the following scientific article: <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>M. Keijzer, J.J. Merelo, G. Romero, G., M. Schoenauer, <blockquote>Johann Dreo, Arnaud Liefooghe, Sébastien Verel, Marc Schoenauer, Juan J. Merelo, Alexandre Quemy, Benjamin Bouvier, and Jan Gmys,
<a href= "http://www.lri.fr/~marc/EO/EO-EA01.ps.gz">Evolving <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>
objects: A general purpose evolutionary computation
library</a>, <i>Artificial Evolution</i>, <b>2310</b>, 829--888 (2002).</blockquote>
</p> </p>
<button class="collapsible">BiBTeX entry for citing EO</button> <button class="collapsible">BiBTeX entry for citing <em class="logo">Paradis<span class="logo_eo">eo</span></em></button>
<div class="details"> <div class="details">
<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> <p>If you used <em class="logo">Paradis<span class="logo_eo">eo</span></em> in a study, please cite the publication above:</p>
<figure style="text-align:left;"> <figure style="text-align:left;">
<p> <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 face="monospace">
@<font color="#0000ff">Article</font>{<font color="#ff00ff">Keijzer2001</font>,<br/> @<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/> &nbsp;&nbsp;<font color="#a52a2a">title</font>&nbsp;=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;Evolving Objects: A General Purpose Evolutionary Computation Library &quot;,<br/>
@ -808,21 +848,25 @@
&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">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="#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="#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/>
<br/> <br/>
</font> </font>
-->
</p> </p>
<figcaption></figcaption> <figcaption></figcaption>
</figure> </figure>
</div> </div>
</li> </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> --> <!-- <li> -->
<!-- <p>The parallelization modules have been described in: --> <!-- <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> --> <!-- <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> -->
@ -883,10 +927,31 @@ ISBN: 978-0-470-27858-1</blockquote>
<ul class="publications"> <ul class="publications">
</ul> </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> <h3>Automated Planning</h3>
<ul> <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="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> </ul>
@ -950,11 +1015,6 @@ undiscovered knowledge.
physics/0603108 (2006)</a>.</li> physics/0603108 (2006)</a>.</li>
</ul> </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>
</div> </div>
@ -1109,16 +1169,17 @@ undiscovered knowledge.
<div id="Downloads"> <div id="Downloads">
<h2><a name="Downloads"></a>Downloads</h2> <h2><a name="Downloads"></a>Downloads</h2>
<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>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> You can obtain the latest stable and beta version directly via the official Git repository: <p> You can obtain the latest stable and beta version directly via the Git repository:
<code class="command">git clone git://scm.gforge.inria.fr/paradiseo/paradiseo.git</code>. <code class="command">git clone https://github.com/jdreo/paradiseo.git</code>.
The release are on the "master" branch. The release are on the "master" branch.
</p> </p>
<p>Or you can use (at your own risks) the development repositories of the developers: <p>Or you can use (at your own risks) the development repositories of the developers:
<ul> <ul>
<li>Johann Dreo's: <a href="https://github.com/nojhan/paradiseo">on GitHub</b>.</li> <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>
</ul> </ul>
</p> </p>
</div> </div>
@ -1160,7 +1221,7 @@ undiscovered knowledge.
</p> </p>
<p>There is, however, several build options which you may want to switch. <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> or <code>cmake-gui</code>. 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>.
On the command line, you can see the available options with: <code class="command">cmake -LH ..</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. Those options can be set with the <code>-D&lt;option&gt;=&lt;value&gt;</code> argument to cmake.
</p> </p>
@ -1191,7 +1252,7 @@ undiscovered knowledge.
<h2><a name="Contribute"></a>Contribute</h2> <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><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://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>The official bug tracker is available on the <a href="https://github.com/nojhan/paradiseo/issues">project page</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> <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> </div>
@ -1208,7 +1269,8 @@ undiscovered knowledge.
<ul> <ul>
<li><a href="https://www.inria.fr">INRIA</a> (current maintainer)</li> <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.univ-littoral.fr/">University of the Littoral Opal Coast</a> (current maintainer)</li>
<li><a href="https://thalesgroup.com">Thales</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://www.polytechnique.edu/">École Polytechnique</a></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.ugr.es">University of Granada</a></li>
<li><a href="https://www.vu.nl">Vrije Universiteit Amsterdam</a></li> <li><a href="https://www.vu.nl">Vrije Universiteit Amsterdam</a></li>
@ -1261,7 +1323,7 @@ undiscovered knowledge.
worked a lot on the multi-objective module and worked a lot on the multi-objective module and
on the local-search one along with <a href="https://www-lisic.univ-littoral.fr/~verel/">Sébastien Verel</a> on the local-search one along with <a href="https://www-lisic.univ-littoral.fr/~verel/">Sébastien Verel</a>
and Jeremy Humeau. and Jeremy Humeau.
In the same team, Clive Canape and J. Boisson made significant contributions. In the same team, C. C. and J. Boisson made significant contributions.
Karima Boufaras specifically worked on (now deprecated) GPU tools.</p> Karima Boufaras specifically worked on (now deprecated) GPU tools.</p>
<p>The (then) EO project was then taken over by <a href="http://johann.dreo.fr">Johann Dreo</a>, <p>The (then) EO project was then taken over by <a href="http://johann.dreo.fr">Johann Dreo</a>,

226
doxygen/DoxygenLayout.xml Normal file
View file

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

@ -25,13 +25,21 @@ DOXYFILE_ENCODING = UTF-8
# The PROJECT_NAME tag is a single word (or a sequence of words surrounded # The PROJECT_NAME tag is a single word (or a sequence of words surrounded
# by quotes) that should identify the project. # by quotes) that should identify the project.
PROJECT_NAME = @PACKAGE_NAME@ PROJECT_NAME = @MODULE_NAME@
# With the PROJECT_LOGO tag one can specify a logo or an icon
# that is included in the documentation.
# The maximum height of the logo should not exceed 55 pixels
# and the maximum width should not exceed 200 pixels.
# Doxygen will copy the logo to the output directory.
PROJECT_LOGO = @CMAKE_SOURCE_DIR@/docs/img/paradiseo_logo.svg
# The PROJECT_NUMBER tag can be used to enter a project or revision number. # The PROJECT_NUMBER tag can be used to enter a project or revision number.
# This could be handy for archiving the generated documentation or # This could be handy for archiving the generated documentation or
# if some version control system is used. # if some version control system is used.
PROJECT_NUMBER = @PACKAGE_VERSION@ PROJECT_NUMBER = @PROJECT_VERSION@
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
# base path where the generated documentation will be put. # base path where the generated documentation will be put.
@ -272,22 +280,6 @@ SUBGROUPING = YES
TYPEDEF_HIDES_STRUCT = NO 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 # Build related configuration options
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
@ -500,7 +492,7 @@ FILE_VERSION_FILTER =
# file name after the option, if omitted DoxygenLayout.xml will be used as the name # file name after the option, if omitted DoxygenLayout.xml will be used as the name
# of the layout file. # of the layout file.
LAYOUT_FILE = LAYOUT_FILE = @CMAKE_SOURCE_DIR@/doxygen/DoxygenLayout.xml
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# configuration options related to warning and progress messages # configuration options related to warning and progress messages
@ -594,7 +586,7 @@ RECURSIVE = YES
# excluded from the INPUT source files. This way you can easily exclude a # 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. # subdirectory from a directory tree whose root is specified with the INPUT tag.
EXCLUDE = @CMAKE_SOURCE_DIR@/src/obsolete @CMAKE_SOURCE_DIR@/test @CMAKE_SOURCE_DIR@/tutorial @CMAKE_SOURCE_DIR@/contrib @CMAKE_SOURCE_DIR@/app EXCLUDE = @CMAKE_SOURCE_DIR@/deprecated @CMAKE_SOURCE_DIR@/eo/contrib @CMAKE_SOURCE_DIR@/eo/app @CMAKE_SOURCE_DIR@/eo/tutorial @CMAKE_SOURCE_DIR@/mo/tutorial @CMAKE_SOURCE_DIR@/moeo/tutorial @CMAKE_SOURCE_DIR@/smp/tutorial
# The EXCLUDE_SYMLINKS tag can be used select whether or not files or # The EXCLUDE_SYMLINKS tag can be used select whether or not files or
# directories that are symbolic links (a Unix filesystem feature) are excluded # directories that are symbolic links (a Unix filesystem feature) are excluded
@ -608,7 +600,7 @@ EXCLUDE_SYMLINKS = NO
# against the file with absolute path, so to exclude all test directories # against the file with absolute path, so to exclude all test directories
# for example use the pattern */test/* # for example use the pattern */test/*
EXCLUDE_PATTERNS = EXCLUDE_PATTERNS = *.sif/*
# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
# (namespaces, classes, functions, etc.) that should be excluded from the # (namespaces, classes, functions, etc.) that should be excluded from the
@ -622,7 +614,7 @@ EXCLUDE_SYMBOLS =
# directories that contain example code fragments that are included (see # directories that contain example code fragments that are included (see
# the \include command). # the \include command).
EXAMPLE_PATH = @CMAKE_SOURCE_DIR@/test EXAMPLE_PATH = @CMAKE_SOURCE_DIR@/eo/test @CMAKE_SOURCE_DIR@/edo/test @CMAKE_SOURCE_DIR@/mo/test @CMAKE_SOURCE_DIR@/moeo/test @CMAKE_SOURCE_DIR@/smp/test
# If the value of the EXAMPLE_PATH tag contains directories, you can use the # 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 # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
@ -784,14 +776,14 @@ HTML_HEADER =
HTML_FOOTER = HTML_FOOTER =
# The HTML_STYLESHEET tag can be used to specify a user-defined cascading # The HTML_EXTRA_STYLESHEET tag can be used to specify a user-defined cascading
# style sheet that is used by each HTML page. It can be used to # 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 # 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 # 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 # 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! # stylesheet in the HTML output directory as well, or it will be erased!
HTML_STYLESHEET = HTML_EXTRA_STYLESHEET = @CMAKE_SOURCE_DIR@/doxygen/doxygen-style.css
# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
@ -800,7 +792,7 @@ HTML_STYLESHEET =
# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox # JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). # Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
HTML_DYNAMIC_SECTIONS = NO HTML_DYNAMIC_SECTIONS = YES
# If the GENERATE_DOCSET tag is set to YES, additional index files # 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 # will be generated that can be used as input for Apple's Xcode 3
@ -970,7 +962,7 @@ SEARCHENGINE = YES
# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will # If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
# generate Latex output. # generate Latex output.
GENERATE_LATEX = YES GENERATE_LATEX = NO
# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. # 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 # If a relative path is entered the value of OUTPUT_DIRECTORY will be
@ -1129,18 +1121,6 @@ GENERATE_XML = NO
XML_OUTPUT = xml 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 # If the XML_PROGRAMLISTING tag is set to YES Doxygen will
# dump the program listings (including syntax highlighting # dump the program listings (including syntax highlighting
# and cross-referencing information) to the XML output. Note that # and cross-referencing information) to the XML output. Note that
@ -1301,11 +1281,6 @@ ALLEXTERNALS = NO
EXTERNAL_GROUPS = YES 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 # Configuration options related to the dot tool
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
@ -1319,15 +1294,6 @@ PERL_PATH = /usr/bin/perl
CLASS_DIAGRAMS = 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 # If set to YES, the inheritance and collaboration graphs will hide
# inheritance and usage relations if the target is undocumented # inheritance and usage relations if the target is undocumented
# or is not a class. # or is not a class.
@ -1350,7 +1316,7 @@ HAVE_DOT = YES
# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory # DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
# containing the font. # containing the font.
DOT_FONTNAME = FreeSans DOT_FONTNAME =
# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. # The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
# The default size is 10pt. # The default size is 10pt.
@ -1392,7 +1358,7 @@ UML_LOOK = NO
# If set to YES, the inheritance and collaboration graphs will show the # If set to YES, the inheritance and collaboration graphs will show the
# relations between templates and their instances. # relations between templates and their instances.
TEMPLATE_RELATIONS = NO TEMPLATE_RELATIONS = YES
# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT # 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 # tags are set to YES then doxygen will generate a graph for each documented
@ -1440,7 +1406,18 @@ DIRECTORY_GRAPH = YES
# generated by dot. Possible values are png, jpg, or gif # generated by dot. Possible values are png, jpg, or gif
# If left blank png will be used. # If left blank png will be used.
DOT_IMAGE_FORMAT = png DOT_IMAGE_FORMAT = svg
# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES
# to enable generation of interactive SVG images that allow zooming and panning.
# Note that this requires a modern browser other than Internet Explorer.
# Tested and working are Firefox, Chrome, Safari, and Opera.
# Note: For IE 9+ you need to set HTML_FILE_EXTENSION to xhtml
# in order to make the SVG files visible.
# Older versions of IE do not have SVG support.
# This tag requires that the tag HAVE_DOT is set to YES.
INTERACTIVE_SVG = YES
# The tag DOT_PATH can be used to specify the path where the dot tool can be # 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. # found. If left blank, it is assumed the dot tool can be found in the path.
@ -1486,7 +1463,7 @@ DOT_TRANSPARENT = NO
# makes dot run faster, but since only newer versions of dot (>1.8.10) # makes dot run faster, but since only newer versions of dot (>1.8.10)
# support this, this feature is disabled by default. # support this, this feature is disabled by default.
DOT_MULTI_TARGETS = NO DOT_MULTI_TARGETS = YES
# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will # 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 # generate a legend page explaining the meaning of the various boxes and

791
doxygen/doxygen-style.css Normal file
View file

@ -0,0 +1,791 @@
/* This doxygen theme is free to use. If you like this, please Star https://github.com/kcwongjoe/doxygen_theme_flat_design */
/* Color Pattern. You can change this pattern to design your theme. */
:root {
/* Content */
--bgcolor: #ffffff;
--bgfont: #303030;
--bgfont2: #3771c8;
--bgfont-hover: #3771c8;
--bgfont-hover-text-decoration: underline solid #3771c8;
--bgborder: #7d7d7d;
--bgborder2: #f6f6f6;
--bgfont-link:#1751a8;
/* Main Header */
--bg1color: #303030;
--bg1font: #ffffff;
--bg1font2: #3771c8;
/* Second header */
--bg2color: #E2E2E2;
--bg2font: #7D7D7D;
--bg2-hover-bg: #ffffff;
--bg2-hover-font: #303030;
--bg2-hover-topborder: #3771c8;
/* Third header */
--bg3color: #f6f6f6;
--bg3font: #303030;
--bg3font2: #7D7D7D;
/* Code */
--code-bg: #232323;
--code-comment: #a5c261;
--code-keyword: #db4939;
--code-preprocessor: #efcd45;
--code-keywordtype: #87bbff;
--code-text: #b1cfb1;
--code-code: #d3d0cc;
--code-line: #73707c;
--code-line-bg: #232323;
--code-link: #b7dbff;
/* Namespace List, Class List icon */
--icon-bg: #303030
--icon-font: #3771c8;
/* Class Index */
--qindex-menu-bg: #303030;
--qindex-menu-font: #ffffff;
--qindex-menu-font-hover: #3771c8;
--qindex-icon-bg: #3771c8;
--qindex-icon-font: #303030;
/* Member table */
--mem-title-bg: #3771c8;
--mem-title-font: #ffffff;
--mem-subtitle-bg: #77b1f8;
--mem-subtitle-font: #303030;
--mem-subtitle-font-hover: #303030;
--mem-content-bg: #ffffff;
--mem-content-font: #303030;
--mem-content-border: grey;
--mem-content-highlighted:#3771c8;
/* Nav Tree */
--nav-tree-bg: #E2E2E2;
--nav-tree-bg-hover: #ffffff;
--nav-tree-font: #7D7D7D;
--nav-tree-font-hover: #303030;
--nav-tree-bg-selected: #3771c8;
--nav-tree-font-selected: white;
}
body, table, div, p, dl {
color: var(--bgfont);
background-color: var(--bgcolor);
line-height: 150%;
font: 14px/22px, Roboto, Arial;
}
div.contents {
margin: 20px 40px;
}
div.contents ul {
line-height: 200%;
}
/***********************************/
/********** Project header *********/
/***********************************/
#titlearea {
border-bottom: none;
padding-bottom: 20px;
padding-top: 20px;
}
#titlearea, #titlearea * {
color: var(--bg1font);
background-color: var(--bg1color);
}
#projectname {
padding: 0px 40px !important;
}
#projectbrief {
padding: 0px 40px !important;
}
#projectalign {
padding: 0px !important;
vertical-align: bottom;
}
/***********************************/
/************ Main Menu ************/
/***********************************/
/* Margin */
#main-menu {
padding: 0px 30px;
}
#main-menu a, #main-menu a:hover {
padding-top: 10px;
padding-bottom: 10px;
}
/* Menu button */
#main-menu li a {
background-image: none;
font-family: Arial;
text-shadow: none;
font-size: 14px;
font-weight: 700;
}
#main-menu, #main-menu>li>a {
background-image: none;
background-color: var(--bg2color);
color: var(--bg2font);
transition: 0.2s;
}
/* hover Effect */
#main-menu>li {
border-top: 5px solid var(--bg2color);
}
#main-menu>li:hover {
color: var(--bg2-hover-font);
background-color: var(--bg2-hover-bg);
border-top: 5px solid var(--bg2-hover-topborder);
font-width: bold;
}
#main-menu>li:hover, #main-menu>li>a:hover, #main-menu>li>a.highlighted {
color: var(--bg2-hover-font);
background-color: var(--bg2-hover-bg);
font-width: bold;
}
/* Search Bar */
#MSearchBox {
border-radius: 0;
box-shadow: none;
}
#MSearchBox>span {
margin: 10px;
}
#main-menu>li:last-child {
padding: 25px 0px;
}
/* Reset search hover color*/
#main-menu>li:last-child:hover {
color: var(--bg2font);
background-color: var(--bg2color);
border-top: 5px solid var(--bg2color);
}
#MSearchResultsWindow {
border: 1px solid var(--bg3font2);
background-color: var(--bg3color);
padding: 10px;
}
body.SRPage, body.SRPage * {
font-family: Arial;
}
/* Sub Menu */
#main-menu>li ul {
transition: max-height 0.2s ease-in-out;
padding: 0px;
border-radius: 0px !important;
}
#main-menu>li ul:before, #main-menu>li ul:after {
border-width: 0px;
}
#main-menu>li>ul li a, #main-menu>li>ul li {
background-color: var(--bgcolor);
color: var(--bgfont);
background-image: none;
}
#main-menu>li>ul li a:hover, #main-menu>li>ul li:hover {
background-color: var(--bgfont2);
/*color: var(--bgfont);*/
color: white;
font-width: bold;
}
/***********************************/
/************** Header *************/
/***********************************/
div.headertitle {
padding: 5px 40px;
}
div.header, div.header * {
color: var(--bg3font);
background-color: var(--bg3color);
border-bottom: none;
}
div.summary {
padding-right: 40px;
}
/***********************************/
/************** Link *************/
/***********************************/
a, a:visited, a:active, .contents a:visited, body.SRPage a, body.SRPage a:visited, body.SRPage a:active {
color: var(--bgfont-link);
text-decoration: none;
}
a:hover, .contents a:hover, body.SRPage a:hover {
color: var(--bgfont-hover);
text-decoration: var(--bgfont-hover-text-decoration);
}
.dynheader {
color: var(--bgfont-link);
text-decoration: none;
}
.dynheader:hover {
color: var(--bgfont-hover);
text-decoration: var(--bgfont-hover-text-decoration);
}
/***********************************/
/************ Nav-path ************/
/***********************************/
#nav-path, #nav-path ul {
background-image: none;
}
#nav-path ul {
padding: 5px 30px;
}
#nav-path, #nav-path * {
color: var(--bg3font2);
background-color: var(--bg3color);
border: none;
font-family: Arial;
}
li.navelem {
background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHhtbG5zOnN2Z2pzPSJodHRwOi8vc3ZnanMuY29tL3N2Z2pzIiB3aWR0aD0iNTEyIiBoZWlnaHQ9IjUxMiIgeD0iMCIgeT0iMCIgdmlld0JveD0iMCAwIDI5Mi4zNTkgMjkyLjM1OSIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgNTEyIDUxMiIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSIgY2xhc3M9IiI+PGc+CjxnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+Cgk8cGF0aCBkPSJNMjIyLjk3OSwxMzMuMzMxTDk1LjA3Myw1LjQyNEM5MS40NTYsMS44MDcsODcuMTc4LDAsODIuMjI2LDBjLTQuOTUyLDAtOS4yMzMsMS44MDctMTIuODUsNS40MjQgICBjLTMuNjE3LDMuNjE3LTUuNDI0LDcuODk4LTUuNDI0LDEyLjg0N3YyNTUuODEzYzAsNC45NDgsMS44MDcsOS4yMzIsNS40MjQsMTIuODQ3YzMuNjIxLDMuNjE3LDcuOTAyLDUuNDI4LDEyLjg1LDUuNDI4ICAgYzQuOTQ5LDAsOS4yMy0xLjgxMSwxMi44NDctNS40MjhsMTI3LjkwNi0xMjcuOTA3YzMuNjE0LTMuNjEzLDUuNDI4LTcuODk3LDUuNDI4LTEyLjg0NyAgIEMyMjguNDA3LDE0MS4yMjksMjI2LjU5NCwxMzYuOTQ4LDIyMi45NzksMTMzLjMzMXoiIGZpbGw9IiM3ZDdkN2QiIGRhdGEtb3JpZ2luYWw9IiMwMDAwMDAiIHN0eWxlPSIiIGNsYXNzPSIiPjwvcGF0aD4KPC9nPgo8ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8L2c+CjxnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjwvZz4KPGcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPC9nPgo8ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8L2c+CjxnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjwvZz4KPGcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPC9nPgo8ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8L2c+CjxnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjwvZz4KPGcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPC9nPgo8ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8L2c+CjxnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjwvZz4KPGcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPC9nPgo8ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8L2c+CjxnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjwvZz4KPGcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPC9nPgo8L2c+PC9zdmc+);
background-size: 9px;
}
li.navelem a {
margin-right: 20px;
}
/***********************************/
/*************** mem ***************/
/***********************************/
.memtitle {
padding: 15px;
margin-top: 30px;
border-top-left-radius: 0px;
border-top-right-radius: 0px;
}
.memtitle, .memtitle *, .memtitle a:visited {
border: none;
background-image: none;
color: var(--mem-title-font);
background-color: var(--mem-title-bg);
}
.memproto {
padding: 2em;
text-shadow: none;
border-top-right-radius: 0px;
-moz-border-radius-topright: 0px;
-webkit-border-top-right-radius: 0px;
}
.memproto, .memproto *, .memproto a:visited {
border: none;
background-image: none;
background-color: var(--mem-subtitle-bg);
color: var(--mem-subtitle-font);
font-size: inherit;
line-height: 100%
}
.memproto a:hover {
color: var(--mem-subtitle-font-hover);
}
.memdoc {
border-bottom: 1px solid var(--mem-content-border);
border-left: 1px solid var(--mem-content-border);
border-right: 1px solid var(--mem-content-border);
background-color: var(--mem-content-bg);
color: var(--mem-content-font);
border-bottom-left-radius: 0px;
border-bottom-right-radius: 0px;
-moz-border-radius-bottomleft: 0px;
-moz-border-radius-bottomright: 0px;
-webkit-border-bottom-left-radius: 0px;
-webkit-border-bottom-right-radius: 0px;
padding:1em;
}
.memdoc p, .memdoc dt {
/*padding: 0px 20px;*/
}
.memdoc > p {
font-size:1em;
}
.paramname {
color:black;
}
td.memItemRight > a:first-of-type {
font-size:1.3em;
}
/***********************************/
/************* Contents ************/
/***********************************/
a.anchor {
padding-top: 20px;
}
dl {
border-left: 5px solid;
padding:1em;
}
dt {
font-variant-caps: small-caps;
}
dl.warning {
border-top: thin solid red;
border-right: thin solid red;
border-bottom: thin solid red;
border-left-color: red;
background-color: #fee;
}
dl.warning > dt {
color: #500;
}
dl.note {
border-top:thin solid green;
border-right:thin solid green;
border-bottom:thin solid green;
border-left-color:green;
background-color: #efe;
}
dl.note > dt {
color: #050;
}
div.textblock {
padding:2em;
border: 2px solid var(--bgfont2);
box-shadow:0.5em 0.5em 0.5em var(--bgfont);
background-color: #fafaff;
}
div.textblock > p {
font-size:1.2em;
}
div.textblock > p.definition {
font-size:0.8em;
}
p.definition {
font-size: 0.8em;
}
p.reference {
font-size: 0.8em;
}
p {
background-color: transparent;
}
table {
margin-top:4em;
}
table.memname {
margin-top:0.1em;
}
table.mlabels {
margin-top:0.1em;
}
/***********************************/
/************* fragment ************/
/***********************************/
h2.groupheader {
color: #303030;
font-size: 200%;
font-weight: bold;
border-bottom: thin solid var(--bgfont2);
padding-bottom:1px;
margin-top:3em;
}
h3 {
background-color:var(--bgfont2);
color: var(--bgcolor);
font-size: 1.5em;
margin:0px;
padding:1em;
margin-bottom:2em;
border: 2px solid var(--bgfont2);
box-shadow:0.5em 0.5em 0.5em var(--bgfont);
font-family:monospace;
}
div.fragment, pre.fragment {
border: none;
padding: 1em;
margin-left: 1em;
margin-right: 1em;
background-color: var(--code-bg);
border-left: 2px solid black;
border-top: 2px solid black;
border-right: 2px solid grey;
border-bottom: 2px solid grey;
}
div.fragment > div.line {
font-size:1em;
line-height:150%;
color: var(--code-code);
}
.textblock > div.fragment {
font-size: 1em;
}
.textblock > dl.section {
font-size: 1.2em;
}
div.line {
background-color: var(--code-bg);
}
span.comment {
color: var(--code-comment);
}
span.keyword {
color: var(--code-keyword);
}
span.preprocessor {
color: var(--code-preprocessor);
}
span.keywordtype {
color: var(--code-keywordtype);
}
span.stringliteral {
color: var(--code-text);
}
span.mlabel {
background-color: var(--code-text);
color: var(--code-bg);
border-top: none;
border-left: none;
border-right: none;
border-bottom: none;
padding: 10px;
border-radius: 0px;
}
div.fragment > div.line > a.code {
color: var(--code-link);
}
span.lineno, span.lineno>* {
color: var(--code-line);
border-right: none;
background-color: var(--code-bg);
}
span.lineno a {
background-color: var(--code-line-bg);
}
span.lineno a:hover {
color: var(--bg3font);
background-color: var(--code-line-bg);
}
code {
color:black;
}
/***********************************/
/************* directory ***********/
/***********************************/
.directory tr.even {
background-color: inherit;
}
.iconfclosed {
background-image: url(closed-folder.png);
margin-right: 10px;
}
.iconfopen {
background-image: url(opened-folder.png);
margin-right: 10px;
}
.icondoc {
background-image: url(document.png);
margin-right: 10px;
}
.arrow {
color: #7d7d7d;
}
.icona {
vertical-align: middle;
margin-right: 5px;
}
.icon {
background-color: var(--icon-bg);
color: var(--icon-font);
display: table-cell;
vertical-align: middle;
height: 20px;
width: 20px;
}
div.ah {
background-color: var(--qindex-icon-bg);
color: var(--qindex-icon-font);
text-align: center;
background-image: none;
-webkit-box-shadow: none;
box-shadow: none;
-webkit-border-radius: 0px;
border-radius: 0px;
border: none;
}
div.qindex {
background-color: var(--qindex-menu-bg);
border: none;
padding: 20px;
}
a.qindex {
color: var(--qindex-menu-font);
font-weight: normal;
font-size: 20px;
}
a:hover.qindex {
color: var(--qindex-menu-font-hover);
}
a:visited.qindex {
color: var(--qindex-menu-font);
}
table.classindex {
margin-top: 30px;
margin-bottom: 30px;
}
table.classindex a.el {
font-weight: normal;
}
table.params {
margin-top:1em;
}
#titlearea > table {
margin-top:0px;
}
table.directory > tbody > tr {
border-top: thin solid var(--nav-tree-bg);
border-bottom: thin solid var(--nav-tree-bg);
}
/***********************************/
/************** footer *************/
/***********************************/
div.directory {
border-top: 1px solid var(--bgborder);
border-bottom: none;
margin: 20px 0px;
}
div.directory a.el {
font-weight: normal;
}
div.directory>table {
margin: 20px 0px;
}
hr.footer {
border: none;
}
.contents>hr {
border-top: 0px;
}
/***********************************/
/*********** memberdecls ***********/
/***********************************/
.memItemLeft, .memItemRight {
padding: 15px 30px;
background-color: inherit;
}
.mdescRight {
padding: 0px 30px 10px 30px;
}
.memberdecls * {
background-color: inherit;
}
.memSeparator {
border-bottom: 1px solid var(--bgborder2);
}
.memTemplParams {
color: var(--bgfont);
}
/***********************************/
/*********** nav-tree ***********/
/***********************************/
#nav-tree-contents {
background-color: var(--nav-tree-bg);
margin: 0px;
}
#side-nav, #nav-tree {
background-image: none;
background-color: var(--nav-tree-bg);
}
#nav-tree .item {
background-color: var(--nav-tree-bg);
font-family: Arial;
text-shadow: none;
font-size: 14px;
font-weight: 700;
padding: 10px;
color: var(--nav-tree-font);
}
#nav-tree .arrow {
color: var(--nav-tree-font);
}
#nav-tree .selected {
background-image: none;
background-color: var(--nav-tree-bg-selected);
}
#nav-tree .selected a {
color: var(--nav-tree-font-selected);
}
#nav-tree .item:hover {
background-color: var(--nav-tree-bg-hover);
color: var(--nav-tree-font-hover);
}
#nav-tree .item a:hover {
color: var(--nav-tree-font-hover);
}
#side-nav .ui-resizable-e {
background-image: none;
background-color: var(--nav-tree-bg);
}
#nav-sync {
background-color: transparent;
}
#nav-sync>img {
content: url(off_sync.png);
}
#nav-sync.sync>img {
content: url(on_sync.png);
}
/***********************************/
/*********** Plant UML ***********/
/***********************************/
.plantumlgraph > img {
width: 80%;
}

502
edo/LICENSE Normal file
View file

@ -0,0 +1,502 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<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,7 +22,8 @@ if(DOXYGEN_FOUND)
) )
endif(UNIX AND NOT ${CMAKE_VERBOSE_MAKEFILE}) endif(UNIX AND NOT ${CMAKE_VERBOSE_MAKEFILE})
endif(DOXYGEN_EXECUTABLE) endif(DOXYGEN_EXECUTABLE)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/${EDO_DOC_CONFIG_FILE}.cmake" # configure_file("${CMAKE_CURRENT_SOURCE_DIR}/${EDO_DOC_CONFIG_FILE}.cmake"
configure_file("${DOXYGEN_CONFIG_DIR}/doxyfile.cmake"
"${EDO_DOC_DIR}/${EDO_DOC_CONFIG_FILE}") "${EDO_DOC_DIR}/${EDO_DOC_CONFIG_FILE}")
install( install(
DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} 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 # The PROJECT_NAME tag is a single word (or a sequence of words surrounded
# by quotes) that should identify the project. # by quotes) that should identify the project.
PROJECT_NAME = @PACKAGE_NAME@ PROJECT_NAME = @EDO_MODULE_NAME@
# The PROJECT_NUMBER tag can be used to enter a project or revision number. # The PROJECT_NUMBER tag can be used to enter a project or revision number.
# This could be handy for archiving the generated documentation or # This could be handy for archiving the generated documentation or
# if some version control system is used. # if some version control system is used.
PROJECT_NUMBER = @PACKAGE_VERSION@ PROJECT_NUMBER = @PROJECT_VERSION@
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
# base path where the generated documentation will be put. # 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 # If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
# generate Latex output. # generate Latex output.
GENERATE_LATEX = YES GENERATE_LATEX = NO
# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. # 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 # 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: public:
typedef typename D::EOType EOType; typedef typename D::EOType EOType;
edoEstimatorAdaptive<D>( D& distrib ) : _distrib(distrib) {} edoEstimatorAdaptive( D& distrib ) : _distrib(distrib) {}
// virtual D operator() ( eoPop< EOT >& )=0 (provided by eoUF< A1, R >) // virtual D operator() ( eoPop< EOT >& )=0 (provided by eoUF< A1, R >)

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -108,7 +108,12 @@ public:
if (is) { if (is) {
virus.resize(bits.size()); virus.resize(bits.size());
std::transform(bits.begin(), bits.end(), virus.begin(), 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')); std::bind2nd(std::equal_to<char>(), '1'));
#endif
} }
} }

View file

@ -45,46 +45,23 @@ set(PARADISEO_LIBRARIES ga eoutils eo)
# IOH # IOH
set(IOH_ROOT "~/code/IOHexperimenter/" CACHE PATH "Where to find IOHexperimenter") set(IOH_ROOT "~/code/IOHexperimenter/" CACHE PATH "Where to find IOHexperimenter")
find_path(IOH_PROBLEM_H "IOHprofiler_problem.h" PATHS ${IOH_ROOT}/src/Template/) find_path(IOH_HPP "ioh.hpp" PATHS ${IOH_ROOT}/include/)
find_library(IOH_LIBRARY "IOH" PATHS ${IOH_ROOT} PATH_SUFFIXES release Release debug Debug build Build) # find_library(IOH_LIBRARY "IOH" PATHS ${IOH_ROOT} PATH_SUFFIXES release Release debug Debug build Build)
if(EXISTS ${IOH_PROBLEM_H} AND EXISTS ${IOH_LIBRARY}) if(EXISTS ${IOH_HPP}) # AND EXISTS ${IOH_LIBRARY})
message(STATUS "Found IOH in ${IOH_ROOT}") message(STATUS "Found IOH in ${IOH_ROOT}")
include_directories(${IOH_ROOT}/build/Cpp/src/) include_directories(${IOH_ROOT}/include/)
link_directories(${IOH_ROOT}/build/Cpp/bin/) include_directories(${IOH_ROOT}/external/fmt/include/)
include_directories(${IOH_ROOT}/external/clutchlog/)
# Workaround IOH's poorly designed headers inclusion scheme. link_directories(${IOH_ROOT}/release/external/fmt/)
SET(PROBLEMS_BBOB_DIR "src/Problems/BBOB")
SET(PROBLEMS_BBOB_COMMON_DIR "src/Problems/BBOB/bbob_common_used_functions")
SET(PROBLEMS_COMMON_DIR "src/Problems/common_used_functions")
SET(PROBLEMS_PBO_DIR "src/Problems/PBO")
SET(PROBLEMS_WMODEL_DIR "src/Problems/WModel")
SET(PROBLEMS_PYTHON_DIR "src/Problems/Python")
SET(SUITES_DIR "src/Suites")
SET(TEMPLATE_DIR "src/Template")
SET(TEMPLATE_EXPERIMENTS_DIR "src/Template/Experiments")
SET(TEMPLATE_LOGGERS_DIR "src/Template/Loggers")
SET(IOHEXPERIMENTER_DIR
"${IOH_ROOT}/${PROBLEMS_COMMON_DIR}"
"${IOH_ROOT}/${PROBLEMS_BBOB_DIR}"
"${IOH_ROOT}/${PROBLEMS_BBOB_COMMON_DIR}"
"${IOH_ROOT}/${PROBLEMS_PBO_DIR}"
"${IOH_ROOT}/${PROBLEMS_WMODEL_DIR}"
"${IOH_ROOT}/${PROBLEMS_PYTHON_DIR}"
"${IOH_ROOT}/${SUITES_DIR}"
"${IOH_ROOT}/${TEMPLATE_DIR}"
"${IOH_ROOT}/${TEMPLATE_EXPERIMENTS_DIR}"
"${IOH_ROOT}/${TEMPLATE_LOGGERS_DIR}"
)
include_directories(${IOHEXPERIMENTER_DIR})
else() else()
if(NOT EXISTS ${IOH_PROBLEM_H}) if(NOT EXISTS ${IOH_HPP})
message(FATAL_ERROR "Could not find `IOHprofiler_problem.h` in: ${IOH_ROOT}/src/Template/ (did you forget to compile it?)") message(FATAL_ERROR "Could not find `ioh.hpp` in: ${IOH_ROOT}/include/")
endif()
if(NOT EXISTS ${IOH_LIBRARIES})
message(FATAL_ERROR "Could not find `libIOH` in: ${IOH_ROOT}/[release|debug|build] (did you forget to compile it?)")
endif() endif()
# if(NOT EXISTS ${IOH_LIBRARIES})
# message(FATAL_ERROR "Could not find `libIOH` in: ${IOH_ROOT}/[release|debug|build] (did you forget to compile it?)")
# endif()
endif() endif()
@ -93,5 +70,9 @@ endif()
###################################################################################### ######################################################################################
add_executable(fastga fastga.cpp) add_executable(fastga fastga.cpp)
target_link_libraries(fastga ${PARADISEO_LIBRARIES} ${IOH_LIBRARY}) # Link to stdc++fs at the end because of an Ubuntu bug, see: https://stackoverflow.com/a/57760267
target_link_libraries(fastga ${PARADISEO_LIBRARIES} fmt stdc++fs)
add_executable(onlymutga onlymutga.cpp)
target_link_libraries(onlymutga ${PARADISEO_LIBRARIES} fmt)

View file

@ -0,0 +1,80 @@
#!/bin/sh
########################################################################
# This is an example of how to deal with complex builds,
# for instance on clusters with compilers provided as side modules.
########################################################################
# Run this script in a separate dir, e.g.
# mkdir -p code ; cd code ; ../build_fastga.sh
# exit when any command fails
set -e
# We need recent clang and cmake
module load LLVM/clang-llvm-10.0
module load cmake/3.18
# We are going to use a specific compiler, different from the system's one.
# Path toward the compiler:
C="/opt/dev/Compilers/LLVM/10.0.1/bin"
# Path toward the include for the std lib:
I="/opt/dev/Compilers/LLVM/10.0.1/include/c++/v1/"
# Path toward the compiled std lib:
L="/opt/dev/Compilers/LLVM/10.0.1/lib"
# As we use clang, we use its std lib (instead of gcc's "libstdc++")
S="libc++"
# Gather all those into a set of flags:
flags="-I${I} -stdlib=${S} -L${L}"
# Current dir, for further reference.
here=$(pwd)
# Compiler selection
export CC=${C}/clang
export CXX=${C}/clang++
# If the dir already exists
if cd IOHexperimenter ; then
# Just update the code
git pull
else
# Clone the repo
git clone --branch feat+EAF --single-branch --recurse-submodules https://github.com/jdreo/IOHexperimenter.git
cd IOHexperimenter
fi
# Clean build from scratch
rm -rf release
mkdir -p release
cd release
cmake -DCMAKE_CXX_FLAGS="${flags}" -D CMAKE_BUILD_TYPE=Release -D BUILD_TESTS=OFF -D BUILD_EXAMPLE=OFF ..
make -j
# Get back to the root dir
cd ${here}
if cd paradiseo ; then
git pull
else
git clone --branch feat+num_foundry --single-branch --recurse-submodules https://github.com/jdreo/paradiseo.git
cd paradiseo
touch LICENSE
fi
rm -rf release
mkdir -p release
cd release
cmake -DCMAKE_CXX_FLAGS="${flags}" -D CMAKE_BUILD_TYPE=Release ..
make -j
cd ${here}
cd paradiseo/eo/contrib/irace
rm -rf release
mkdir -p release
cd release
cmake -DCMAKE_CXX_FLAGS="${flags}" -D CMAKE_BUILD_TYPE=Release -D IOH_ROOT=${here}/IOHexperimenter/ -D PARADISEO_ROOT=${here}/paradiseo/ -D PARADISEO_BUILD=${here}/paradiseo/release/ ..
make -j
cd ${here}

View file

@ -0,0 +1,28 @@
#!/usr/bin/env python3
import sys
print("algo,problem,seed,ECDF_AUC")
algos_names = {
str({"crossover-rate":0, "cross-selector":0, "crossover":0, "mutation-rate":0, "mut-selector":0, "mutation":1, "replacement":0}) : "EA",
str({"crossover-rate":0, "cross-selector":0, "crossover":0, "mutation-rate":0, "mut-selector":0, "mutation":5, "replacement":0}) : "fEA",
str({"crossover-rate":2, "cross-selector":2, "crossover":2, "mutation-rate":2, "mut-selector":2, "mutation":1, "replacement":0}) : "xGA",
str({"crossover-rate":2, "cross-selector":2, "crossover":5, "mutation-rate":2, "mut-selector":2, "mutation":1, "replacement":0}) : "1ptGA",
}
for fname in sys.argv[1:]:
run = {}
for f in fname.strip(".dat").split("_"):
kv = f.split("=")
assert(len(kv)==2),str(kv)+" "+str(len(kv))
key,idx = kv[0], int(kv[1])
run[key] = idx
with open(fname) as fd:
auc = int(fd.readlines()[0]) * -1
algo = str({"crossover-rate":run["crossover-rate"], "cross-selector":run["cross-selector"], "crossover":run["crossover"], "mutation-rate":run["mutation-rate"], "mut-selector":run["mut-selector"], "mutation":run["mutation"], "replacement":run["replacement"]})
print(algos_names[algo], run["pb"], run["seed"], auc, sep=",")

View file

@ -0,0 +1,49 @@
#!/usr/bin/env python3
import sys
print("problem,EA,fEA,xGA,1ptGA")
algos_names = {
str({"crossover-rate":0, "cross-selector":0, "crossover":0, "mutation-rate":0, "mut-selector":0, "mutation":1, "replacement":0}) : "EA",
str({"crossover-rate":0, "cross-selector":0, "crossover":0, "mutation-rate":0, "mut-selector":0, "mutation":5, "replacement":0}) : "fEA",
str({"crossover-rate":2, "cross-selector":2, "crossover":2, "mutation-rate":2, "mut-selector":2, "mutation":1, "replacement":0}) : "xGA",
str({"crossover-rate":2, "cross-selector":2, "crossover":5, "mutation-rate":2, "mut-selector":2, "mutation":1, "replacement":0}) : "1ptGA",
}
data = {}
# Parse
for fname in sys.argv[1:]:
run = {}
for f in fname.strip(".dat").split("_"):
kv = f.split("=")
assert(len(kv)==2),str(kv)+" "+str(len(kv))
key,idx = kv[0], int(kv[1])
run[key] = idx
with open(fname) as fd:
auc = int(fd.readlines()[0]) * -1
algo = str({"crossover-rate":run["crossover-rate"], "cross-selector":run["cross-selector"], "crossover":run["crossover"], "mutation-rate":run["mutation-rate"], "mut-selector":run["mut-selector"], "mutation":run["mutation"], "replacement":run["replacement"]})
if run["pb"] in data:
data[run["pb"]][algos_names[algo]].append(auc)
else:
data[run["pb"]] = {
"EA" : [],
"fEA" : [],
"xGA" : [],
"1ptGA": [],
}
data[run["pb"]][algos_names[algo]].append(auc)
# Print CSV
for pb in sorted(data.keys()):
print(pb, end="")
for algo in ["EA","fEA","xGA","1ptGA"]:
res = data[pb][algo]
print(",", sum(res)/len(res), end="", sep="")
print()

View file

@ -0,0 +1,21 @@
#!/usr/bin/env python3
import sys
print("algo,problem,seed,ECDF_AUC")
for fname in sys.argv[1:]:
run = {}
for f in fname.strip(".dat").split("_"):
kv = f.split("=")
assert(len(kv)==2),str(kv)+" "+str(len(kv))
key,idx = kv[0], int(kv[1])
run[key] = idx
with open(fname) as fd:
auc = int(fd.readlines()[0]) * -1
algo = "pc={}_c={}_C={}_pm={}_m={}_M={}_R={}".format(run["crossover-rate"],run["cross-selector"],run["crossover"],run["mutation-rate"],run["mut-selector"],run["mutation"],run["replacement"])
print(algo, run["pb"], run["seed"], auc, sep=",")

View file

@ -0,0 +1,30 @@
#!/usr/bin/env python3
import os
import re
import sys
print("pb,ecdf,id,crossover-rate,cross-selector,crossover,mutation-rate,mut-selector,mutation,replacement")
for datadir in sys.argv[1:]:
for pb_dir in os.listdir(datadir):
if "results_problem" in pb_dir:
pb_id=pb_dir.replace("results_problem_","")
with open(os.path.join("./",datadir,pb_dir,"irace.log")) as fd:
data = fd.readlines()
# Find the last best configuration
bests = [line.strip() for line in data if "Best-so-far" in line]
best = bests[-1].split()
best_id, best_perf = best[2], best[5]
# print(best_id,best_perf)
# Filter the config detail
configs = [line.strip() for line in data if "--crossover-rate=" in line and best_id in line]
# print(configs)
# Format as CSV
for config in configs:
algo = re.sub("\-\-\S*=", ",", config)
csv_line = pb_id + "," + best_perf + "," + algo
print(csv_line.replace(" ",""))

View file

@ -0,0 +1,44 @@
#!/usr/bin/env python3
import os
import numpy as np
import matplotlib.pyplot as plt
for p in range(18):
print("Pb",p,end=": ")
datadir="attain_mat_{pb}".format(pb=p)
try:
os.mkdir(datadir)
except FileExistsError:
pass
for i in range(50):
cmd="./release/fastga --seed={i} \
--crossover-rate=2 --cross-selector=2 --crossover=5 --mutation-rate=2 --mut-selector=2 --mutation=1 --replacement=0 \
--problem={pb} --buckets=20 --output-mat 2>/dev/null > {dir}/output_mat_{i}.csv"\
.format(dir=datadir, i=i, pb=p)
# print(cmd)
print(i,end=" ",flush=True)
os.system(cmd)
matrices=[]
for root, dirs, files in os.walk(datadir):
for filename in files:
matrices.append( np.genfromtxt(datadir+"/"+filename,delimiter=',') )
agg = matrices[0]
for mat in matrices[1:]:
agg += mat
# print(agg)
plt.rcParams["figure.figsize"] = (3,3)
plt.gca().pcolor(agg, edgecolors='grey', cmap="Blues")
plt.gca().set_xlabel("Time budget")
plt.gca().set_ylabel("Target")
plt.savefig("aittain_map_{pb}.png".format(pb=p), bbox_inches='tight')
print(".")

View file

@ -0,0 +1,43 @@
#!/bin/bash
# Number of runs (=seeds).
runs=50
# Array of problems.
# You may set something like: (0 2 5 17)
problems=($(seq 0 18))
# Capture anything passed to the script
outdir="$1"
algo="${@:2}"
# You most probably want to run on release builds.
exe="./release/fastga"
i=1 # Loop counter.
for pb in "${problems[@]}" ; do # Iterate over the problems array.
for seed in $(seq ${runs}) ; do # Iterates over runs/seeds.
# Forge a directory/log file name
# (remove double dashs and replace spaces with underscore).
name="pb=${pb}_seed=${seed}_$(echo "${algo}" | sed 's/--//g' | sed 's/ /_/g')"
# This is the command to be ran.
cmd="${exe} --problem=${pb} --seed=${seed} ${algo}"
echo ${cmd} # Print the command.
# Progress print.
echo -n "problem ${pb}, run ${seed}"
# Actually start the command.
${cmd} > "${outdir}/${name}.dat" 2> "${outdir}/${name}.log"
# Check for the most common problem in the log file.
cat "${outdir}/${name}.log" | grep "illogical performance"
perc=$(echo "scale=2;${i}/(${#problems[@]}*${runs})*100" | bc)
echo -e " -- ${perc}%"
i=$((i+1))
done
done
echo "Done $((${#problems[@]}*${runs})) runs, results in ${outdir}"

View file

@ -0,0 +1,30 @@
#!/bin/bash
outdir="$(date --iso-8601=minutes)_results_baselines"
mkdir ${outdir}
algos=(
# (λ+λ)EA
"--full-log=1 --crossover-rate=0 --cross-selector=0 --crossover=0 --mutation-rate=0 --mut-selector=0 --mutation=1 --replacement=0"
# (λ+λ)fEA
"--full-log=1 --crossover-rate=0 --cross-selector=0 --crossover=0 --mutation-rate=0 --mut-selector=0 --mutation=5 --replacement=0"
# (λ+λ)xGA
"--full-log=1 --crossover-rate=2 --cross-selector=2 --crossover=2 --mutation-rate=2 --mut-selector=2 --mutation=1 --replacement=0"
# (λ+λ)1ptGA
"--full-log=1 --crossover-rate=2 --cross-selector=2 --crossover=5 --mutation-rate=2 --mut-selector=2 --mutation=1 --replacement=0"
)
i=1 # Loop counter.
for algo in "${algos[@]}" ; do
echo "${algo}"
name="$(echo "${algo}" | sed 's/--//g' | sed 's/ /_/g')"
./run_algo.sh ${outdir} ${algo} &> "expe_${name}.log"
perc=$(echo "scale=2;${i}/${#algos[@]}*100" | bc)
echo -e "${perc}%\n"
i=$((i+1))
done
echo "Done"

View file

@ -0,0 +1,67 @@
#!/bin/bash
# Number of runs (=seeds).
runs=50
# You most probably want to run on release builds.
exe="./release/fastga"
outdir="$(date --iso-8601=minutes)_results_elites"
mkdir ${outdir}
# FIXME
algos=(
"--crossover-rate=1 --cross-selector=2 --crossover=1 --mutation-rate=2 --mut-selector=2 --mutation=8 --replacement=8"
"--crossover-rate=4 --cross-selector=5 --crossover=2 --mutation-rate=3 --mut-selector=4 --mutation=9 --replacement=9"
"--crossover-rate=1 --cross-selector=3 --crossover=8 --mutation-rate=2 --mut-selector=6 --mutation=3 --replacement=2"
"--crossover-rate=2 --cross-selector=1 --crossover=1 --mutation-rate=2 --mut-selector=6 --mutation=9 --replacement=0"
"--crossover-rate=4 --cross-selector=2 --crossover=2 --mutation-rate=4 --mut-selector=3 --mutation=7 --replacement=0"
"--crossover-rate=0 --cross-selector=3 --crossover=2 --mutation-rate=4 --mut-selector=2 --mutation=6 --replacement=0"
"--crossover-rate=3 --cross-selector=0 --crossover=3 --mutation-rate=4 --mut-selector=3 --mutation=10 --replacement=0"
"--crossover-rate=0 --cross-selector=1 --crossover=0 --mutation-rate=3 --mut-selector=2 --mutation=10 --replacement=0"
"--crossover-rate=2 --cross-selector=2 --crossover=2 --mutation-rate=4 --mut-selector=5 --mutation=10 --replacement=0"
"--crossover-rate=4 --cross-selector=2 --crossover=2 --mutation-rate=4 --mut-selector=5 --mutation=9 --replacement=0"
"--crossover-rate=3 --cross-selector=2 --crossover=10 --mutation-rate=4 --mut-selector=2 --mutation=10 --replacement=0"
"--crossover-rate=2 --cross-selector=2 --crossover=5 --mutation-rate=4 --mut-selector=3 --mutation=9 --replacement=0"
"--crossover-rate=3 --cross-selector=6 --crossover=2 --mutation-rate=4 --mut-selector=1 --mutation=10 --replacement=0"
"--crossover-rate=1 --cross-selector=5 --crossover=9 --mutation-rate=4 --mut-selector=2 --mutation=8 --replacement=0"
"--crossover-rate=2 --cross-selector=5 --crossover=2 --mutation-rate=4 --mut-selector=6 --mutation=8 --replacement=0"
"--crossover-rate=2 --cross-selector=2 --crossover=10 --mutation-rate=4 --mut-selector=6 --mutation=10 --replacement=0"
"--crossover-rate=3 --cross-selector=2 --crossover=2 --mutation-rate=4 --mut-selector=5 --mutation=10 --replacement=0"
"--crossover-rate=4 --cross-selector=2 --crossover=2 --mutation-rate=4 --mut-selector=1 --mutation=8 --replacement=0"
"--crossover-rate=4 --cross-selector=2 --crossover=2 --mutation-rate=4 --mut-selector=6 --mutation=9 --replacement=0"
)
pb=0 # Loop counter.
for algo in "${algos[@]}" ; do
echo "Problem ${pb}"
echo -n "Runs: "
for seed in $(seq ${runs}) ; do # Iterates over runs/seeds.
# This is the command to be ran.
cmd="${exe} --full-log=1 --problem=${pb} --seed=${seed} ${algo}"
# echo ${cmd} # Print the command.
# Forge a directory/log file name
# (remove double dashs and replace spaces with underscore).
name_run="pb=${pb}_seed=${seed}_$(echo "${algo}" | sed 's/--//g' | sed 's/ /_/g')"
# echo $name_run
# Progress print.
echo -n "${seed} "
# Actually start the command.
${cmd} > "${outdir}/${name_run}.dat" 2> "${outdir}/${name_run}.log"
# Check for the most common problem in the log file.
cat "${outdir}/${name_run}.log" | grep "illogical performance"
done
echo ""
perc=$(echo "scale=2;${pb}/${#algos[@]}*100" | bc)
echo -e "${perc}%\n"
pb=$((pb+1))
done
echo "Done"

View file

@ -0,0 +1,61 @@
#!/bin/bash
# Number of runs (=seeds).
runs=50
# You most probably want to run on release builds.
exe="./release/fastga"
outdir="$(date --iso-8601=minutes)_results_elites_all"
mkdir -p ${outdir}
mkdir -p ${outdir}/raw
mkdir -p ${outdir}/raw/data
mkdir -p ${outdir}/raw/logs
n=0
algoid=0
for line in $(cat results_irace_100k.csv|cut -s -d"," -f4-10); do
echo ""
date
a=($(echo $line | sed "s/,/ /g"))
algo="--crossover-rate=${a[0]} --cross-selector=${a[1]} --crossover=${a[2]} --mutation-rate=${a[3]} --mut-selector=${a[4]} --mutation=${a[5]} --replacement=${a[6]}"
for pb in $(seq 0 18) ; do
perc=$(echo "scale=3;${n}/(285*18)*100.0" | bc)
echo "${perc}% : algo ${algoid}/285, problem ${pb}/18"
# echo -n "Runs: "
for seed in $(seq ${runs}) ; do # Iterates over runs/seeds.
# This is the command to be ran.
cmd="${exe} --full-log=1 --problem=${pb} --seed=${seed} ${algo}"
# echo ${cmd} # Print the command.
# Forge a directory/log file name
# (remove double dashs and replace spaces with underscore).
name_run="pb=${pb}_seed=${seed}_$(echo "${algo}" | sed 's/--//g' | sed 's/ /_/g')"
# echo $name_run
# Progress print.
# echo -n "${seed} "
# Actually start the command.
${cmd} > "${outdir}/raw/data/${name_run}.dat" 2> "${outdir}/raw/logs/${name_run}.log"
# Check for the most common problem in the log file.
cat "${outdir}/raw/logs/${name_run}.log" | grep "illogical performance"
done # seed
# echo ""
n=$(($n+1))
done # pb
algoid=$(($algoid+1))
done
# Move IOH logs in the results directory.
mv ./FastGA_* ${outdir}
echo "Done"
date

View file

@ -0,0 +1,27 @@
#!/bin/bash
outdir="$(date --iso-8601=minutes)_results_irace"
mkdir ${outdir}
cd ${outdir}
for p in $(seq 0 18) ; do
echo -n "Problem ${p}... "
res="results_problem_${p}"
mkdir ${res}
cd ${res}
# Fore some reason, irace absolutely need those files...
cp ../../irace-config/example.scen .
cp ../../irace-config/default.instances .
cp ../../release/fastga .
cat ../../irace-config/target-runner | sed "s/{{PROBLEM}}/${p}/" > ./target-runner
chmod u+x target-runner
# Generate the parameter list file.
./fastga -h > fastga.param 2>/dev/null
# /usr/lib/R/site-library/irace/bin/irace --scenario example.scen 2>&1 | tee irace.log
/usr/lib/R/site-library/irace/bin/irace --scenario example.scen &> irace.log
cd ..
echo " done"
done

View file

@ -0,0 +1,14 @@
#!/bin/bash
date -Iseconds
echo "STARTS"
for r in $(seq 15); do
echo "Run $r/15";
date -Iseconds
./run_irace_parallel-batch.sh
date -Iseconds
done
echo "DONE"
date -Iseconds

View file

@ -0,0 +1,38 @@
#!/bin/bash
outdir="$(date --iso-8601=ns)_results_irace"
mkdir ${outdir}
cd ${outdir}
run(){
p="$1"
echo "Problem ${p}"
res="results_problem_${p}"
mkdir ${res}
cd ${res}
# Fore some reason, irace absolutely need those files...
cp ../../irace-config/example.scen .
cp ../../irace-config/default.instances .
cp ../../release/fastga .
cat ../../irace-config/target-runner | sed "s/{{PROBLEM}}/${p}/" > ./target-runner
chmod u+x target-runner
# Generate the parameter list file.
./fastga -h > fastga.param 2>/dev/null
# /usr/lib/R/site-library/irace/bin/irace --scenario example.scen 2>&1 | tee irace.log
/usr/lib/R/site-library/irace/bin/irace --scenario example.scen &> irace.log
cd ..
echo "Done problem ${p}"
}
N=5 # Somehow 5 is the fastest on my 4-cores machine.
(
for pb in $(seq 0 18); do
((i=i%N)); ((i++==0)) && wait
run "$pb" &
done
wait
)

View file

@ -0,0 +1,61 @@
#!/bin/bash
# Number of runs (=seeds).
runs=50
# You most probably want to run on release builds.
exe="./release/fastga"
outdir="$(date --iso-8601=minutes)_results_randoms"
mkdir -p ${outdir}
mkdir -p ${outdir}/raw
mkdir -p ${outdir}/raw/data
mkdir -p ${outdir}/raw/logs
n=1
algoid=0
for algoid in $(seq 0 100); do
echo ""
date
a=( $((RANDOM%5)) $((RANDOM%7)) $((RANDOM%11)) $((RANDOM%5)) $((RANDOM%7)) $((RANDOM%11)) $((RANDOM%11)) )
algo="--crossover-rate=${a[0]} --cross-selector=${a[1]} --crossover=${a[2]} --mutation-rate=${a[3]} --mut-selector=${a[4]} --mutation=${a[5]} --replacement=${a[6]}"
for pb in $(seq 0 18) ; do
perc=$(echo "scale=3;${n}/(100*18)*100.0" | bc)
echo "${perc}% : algo ${algoid}/100, problem ${pb}/18"
# echo -n "Runs: "
for seed in $(seq ${runs}) ; do # Iterates over runs/seeds.
# This is the command to be ran.
cmd="${exe} --full-log=1 --problem=${pb} --seed=${seed} ${algo}"
# echo ${cmd} # Print the command.
# Forge a directory/log file name
# (remove double dashs and replace spaces with underscore).
name_run="pb=${pb}_seed=${seed}_$(echo "${algo}" | sed 's/--//g' | sed 's/ /_/g')"
# echo $name_run
# Progress print.
# echo -n "${seed} "
# Actually start the command.
${cmd} > "${outdir}/raw/data/${name_run}.dat" 2> "${outdir}/raw/logs/${name_run}.log"
# Check for the most common problem in the log file.
cat "${outdir}/raw/logs/${name_run}.log" | grep "illogical performance"
done # seed
# echo ""
n=$(($n+1))
done # pb
algoid=$(($algoid+1))
done
# Move IOH logs in the results directory.
mv ./FastGA_* ${outdir}
echo "Done"
date

View file

@ -0,0 +1,86 @@
#!/usr/bin/env python3
import sys
import os
import numpy as np
import matplotlib.pyplot as plt
#cmd eg :
#python3 best_out_of_elites.py ./fastga_results_all/fastga_results_planO/planO_maxExp=50000_maxEv=5n_2021-08-13T19:16+02:00_results_elites_all
#python3 best_out_of_elites.py ./fastga_results_all/fastga_results_random/maxEv=10000_nbAlgo=15_2021-08-21T20:53+02:00_results_randoms
#get the configuration of the best out of the elite
# recommendation suggested by 15 independant runs of irace
figdir=sys.argv[1] # directory of a result of one experiment
#eg : ./fastga_results_all/fastga_results_plan1/plan1_maxExp\=100000_maxEv\=5n_2021-08-13T19\:04+02\:00_results_elites_all/
#print(figdir.split('/')[-2], figdir.split('/'))
if("plan" in figdir.split('/')[-2]):
print("Operator,","op. ,",",".join(map(str,range(1,20))))
column={"pc" : 101, "SelectC": 7, "Crossover" : 10, "pm": 101,"SelectM" : 7, "Mutation": 11, "Replacement" : 11, "pop-size": 50, "offspring-size" : 50}
nbparam=(len(os.listdir(os.path.join(figdir,"raw/data"))[0].split("_"))-1) #-1 car il y a le pb
if( nbparam<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

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

@ -0,0 +1,16 @@
#!/bin/bash
ldata=$1
file_py=$2
csvdir="csv_FAO"
ldir=$(echo $(ls ${ldata}))
for data in ${ldir[@]} ; do
path="${ldata}/${data}"
cmd="python3 ${file_py} ${path}"
plan_name=$(echo ${data} | sed "s/data//")
mexp=$(echo ${data[@]} | cut -d _ -f2)
mevals=$(echo ${data[@]} | cut -d _ -f3)
ddate=$(echo ${data[@]} | cut -d _ -f4)
name="results_irace_plan${plan_name[@]:0:1}_${mexp}_${mevals}_${ddate}"
mkdir -p "${csvdir}/csv_plan${plan_name[@]:0:1}"
${cmd} > "${csvdir}/csv_plan${plan_name[@]:0:1}/${name}.csv"
done

View file

@ -0,0 +1,78 @@
#!/usr/bin/env python3
import sys
import os
import numpy as np
import matplotlib.pyplot as plt
#cmd eg : python3 ./dist_op_random.py ./fastga_results_all/fastga_results_random/ ./hist_and_csv/
#get the distribution of operators variants recommended by 15 random algo for each maxEv
#pc and pm 10 possibilities : [0-0.1[ [0.1-0.2[ [0.2-0.3[ [0.3-0.4[ [0-0.5[ [0.5-0.6[ ...[0.9-1[
#pop-size and offspring-size 10 possibilities : 0-5 5-10, 10-15 15-20 20-25 25-30 30-35- 35-40 40-45 45-50
path=sys.argv[1] # directory of a result of one experiment
#eg : ./fastga_results_all/fastga_results_random/
figdir=sys.argv[2] #directory of where you want to store the data
if("random" in path):
#column : [operator : nbpossibilities]
distdir=figdir+"/distribution_random"
try:
os.makedirs(distdir)
except FileExistsError:
pass
nbparam=9 #-1 car il y a le pb
res=[]
for maxEvdir in os.listdir(path):
res.append({"crossover-rate":["pc" , np.zeros(10, dtype=int)],
"cross-selector":["SelectC", np.zeros(7, dtype=int)],
"crossover":["Crossover" , np.zeros(10, dtype=int)],
"mutation-rate":["pm",np.zeros(10, dtype=int)],
"mut-selector":["SelectM",np.zeros(10, dtype=int)],
"mutation":["Mutation", np.zeros(11, dtype=int)],
"replacement":["Replacement" , np.zeros(11, dtype=int)],
"pop-size":["pop-size", np.zeros(10, dtype=int)],
"offspring-size":["offspring-size" , np.zeros(10, dtype=int)]})
for algodir in os.listdir(os.path.join(path,maxEvdir)): #fastgadir : directory of 50 runs of an elite configuration
algo=algodir.split("_")
for param in algo:
name,val=param.split("=")[0],float(param.split("=")[1])
if(name in {"pop-size" ,"offspring-size"}):
if(val%5==0):
res[-1][name][1][int(val//5) -1]+=1
else:
#print(res[-1][name][1],val//5)
res[-1][name][1][int(val//5)]+=1
elif(name in {"crossover-rate","mutation-rate"} ):
if(int(val*10)==10): #case of val=1
res[-1][name][1][-1]+=1
else :
#print(int(float(val)*10), name,pb,val)
res[-1][name][1][int(val*10)]+=1
else :
res[-1][name][1][int(val)]+=1
ind=0
for maxEvdir in os.listdir(path):
name="distribution_random_"+maxEvdir.split("_")[0]+".csv" #the end of the path must be /
with open(os.path.join(distdir,name),"w+") as csvfile:
csvfile.write("Op index, "+",".join(map(str,range(0,11)))+"\n")
with open(os.path.join(distdir,name),"a") as csvfile:
for param_name in res[ind].keys():
#print(map(str,res[ind]),res[ind], ",".join(map(str,res[ind])))
csvfile.write(res[ind][param_name][0]+","+ ",".join(map(str,res[ind][param_name][1]))+",-"*(11-len(res[ind][param_name][1])) +"\n")
#print(str(i)+",",",".join(map(str,np.mean(aucs[i],1))))
ind+=1
#all problems
name ="distribution_all_random_"+path.split("/")[-1]+".csv"
with open(os.path.join(distdir,name),'w+') as csvfile:
csvfile.write("Op index, "+",".join(map(str,range(0,11)))+"\n")
with open(os.path.join(distdir,name),'a') as csvfile:
for param_name in res[0].keys():
#print(map(str,res[ind]),res[ind], ",".join(map(str,res[ind])))
csvfile.write(res[0][param_name][0]+","+ ",".join(map(str,np.sum([res[i][param_name][1] for i in range(ind-1)],0)))+",-"*(11-len(res[0][param_name][1])) +"\n") #res[0] only for getting the name of parameters
#print(str(i)+",",",".join(map(str,np.mean(aucs[i],1))))

View file

@ -0,0 +1,87 @@
#!/usr/bin/env python3
import sys
import os
import numpy as np
import matplotlib.pyplot as plt
#get the distribution of operators variants recommended by 15 runs of irace for all problems and each problem
#also get an csv file
#pc and pm 10 possibilities : [0-0.1[ [0.1-0.2[ [0.2-0.3[ [0.3-0.4[ [0-0.5[ [0.5-0.6[ ...[0.9-1[
#pop-size and offspring-size 10 possibilities : 0-5 5-10, 10-15 15-20 20-25 25-30 30-35- 35-40 40-45 45-50
path=sys.argv[1] # directory of a result of one experiment
#eg : ./fastga_results_all/fastga_results_planO/planO_maxExp\=100000_maxEv\=5n_2021-08-13T19\:04+02\:00_results_elites_all/
if("fastga_results_plan" in path):
#column : [operator : nbpossibilities]
distdir=sys.argv[2]
try:
os.makedirs(distdir)
except FileExistsError:
pass
nbparam=(len(os.listdir(os.path.join(path,"raw/data"))[0].split("_"))-1)
if( nbparam==7):
res=[{"crossover-rate":["pc" , np.zeros(10, dtype=int)],
"cross-selector":["SelectC", np.zeros(7, dtype=int)],
"crossover":["Crossover" , np.zeros(10, dtype=int)],
"mutation-rate":["pm",np.zeros(10, dtype=int)],
"mut-selector":["SelectM",np.zeros(7, dtype=int)],
"mutation":["Mutation", np.zeros(11, dtype=int)],
"replacement":["Replacement" ,np.zeros(11, dtype=int)]} for i in range(19)]
else:
res=[{"crossover-rate":["pc" , np.zeros(10, dtype=int)],
"cross-selector":["SelectC", np.zeros(7, dtype=int)],
"crossover":["Crossover" , np.zeros(10, dtype=int)],
"mutation-rate":["pm",np.zeros(10, dtype=int)],
"mut-selector":["SelectM",np.zeros(7, dtype=int)],
"mutation":["Mutation", np.zeros(11, dtype=int)],
"replacement":["Replacement" , np.zeros(11, dtype=int)],
"pop-size":["pop-size", np.zeros(10, dtype=int)],
"offspring-size":["offspring-size" , np.zeros(10, dtype=int)]} for i in range(19)]
for fastgadir in os.listdir(os.path.join(path,"raw/data")): #fastgadir : directory of 50 runs of an elite configuration
algo=fastgadir.split("_")
pb=int(fastgadir.split("_")[0].split("=")[1])
for param in algo[1:]:
name,val=param.split("=")[0],float(param.split("=")[1])
if(name in {"pop-size" ,"offspring-size"}):
if(val%5==0):
res[pb][name][1][int(val//5) -1]+=1
else:
#print(res[pb][name][1],val//5)
res[pb][name][1][int(val//5)]+=1
elif(name in {"crossover-rate","mutation-rate"} ):
if(int(val*10)==10): #case of val=1
res[pb][name][1][-1]+=1
else :
#print(int(float(val)*10), name,pb,val)
res[pb][name][1][int(val*10)]+=1
else :
res[pb][name][1][int(val)]+=1
for pb in range(19):
name="distribution_pb="+str(pb)+"_"+path.split("/")[-2]+".csv" #the end of the path must be /
with open(os.path.join(distdir,name),"w+") as csvfile:
csvfile.write("Op index, "+",".join(map(str,range(0,11)))+"\n")
with open(os.path.join(distdir,name),"a") as csvfile:
for param_name in res[pb].keys():
#print(map(str,res[ind]),res[ind], ",".join(map(str,res[ind])))
csvfile.write(res[pb][param_name][0]+","+ ",".join(map(str,res[pb][param_name][1]))+",-"*(11-len(res[pb][param_name][1])) +"\n")
#print(str(i)+",",",".join(map(str,np.mean(aucs[i],1))))
#all problems
name ="distribution_all_pb_"+path.split("/")[-1]+".csv"
with open(os.path.join(path,"raw",name),'w+') as csvfile:
csvfile.write("Op index, "+",".join(map(str,range(0,11)))+"\n")
with open(os.path.join(path,"raw",name),'a') as csvfile:
for param_name in res[0].keys():
#print(map(str,res[ind]),res[ind], ",".join(map(str,res[ind])))
csvfile.write(res[0][param_name][0]+","+ ",".join(map(str,np.sum([res[i][param_name][1] for i in range(19)],0)))+",-"*(11-len(res[0][param_name][1])) +"\n") #res[0] only for getting the name of parameters
#print(str(i)+",",",".join(map(str,np.mean(aucs[i],1))))

View file

@ -0,0 +1,23 @@
#!/bin/bash
ldata=$1
file_sh=$2
ldir=$(echo $(ls ${ldata}))
fastga_dir="fastga_results_all"
mkdir -p /scratchbeta/${USER}/${fatga_dir}
#mkdir -p "/home/${USER}/${fastga_dir}/fastga_results_plan1"
mkdir -p "/scratchbeta/${USER}/${fastga_dir}/fastga_results_planF"
mkdir -p "/scratchbeta/${USER}/${fastga_dir}/fastga_results_planA"
mkdir -p "/scratchbeta/${USER}/${fastga_dir}/fastga_results_planO"
for data in ${ldir[@]} ; do
path_csv="${ldata}/${data}"
plan_name=$(echo ${data} | sed "s/results_irace_plan//")
mexp=$(echo ${data[@]} | cut -d _ -f4)
mexp_id=$(echo ${mexp} | cut -d = -f2)
mevals=$(echo ${data[@]} | cut -d _ -f5)
mevals_id=$(echo ${mevals} | cut -d = -f2)
path="/scratchbeta/${USER}/${fastga_dir}/fastga_results_plan${plan_name[@]:0:1}"
cmd="bash ${file_sh} ${path_csv} ${mexp_id} ${mevals_id} ${path}"
name="fastga${plan_name[@]:0:1}_${mexp}_${mevals}_$(date -Iseconds)_results_elites_all"
${cmd} &> "${path}/output${plan_name[@]:0:1}_fastga_${mexp}_${mevals}_$(date -Iseconds).txt"
done

View file

@ -0,0 +1,34 @@
#!/bin/bash
ldata="./fastga_results_all" #fastga_results_all
figpath="./hist_and_csv" #hist_and_csv
ldir=$(echo $(ls ${ldata})) #list of directory of each plan
for plan in ${ldir[@]} ; do #get the directory of each plan
#------------hist by budget of a Plan (O,R or F)
#path="${ldata}/${plan}"
#cmd="python3 hist_join.py ${path} ${figpath}"
#echo $cmd
#$cmd
#---------------------------hist by pb by budget---------------
path="${ldata}/${plan}"
cmd="python3 hist_by_pb_budget_plan.py ${path} ${figpath}"
echo $cmd
$cmd
done
#---------------random------------------
#rpath=${ldata}/fastga_results_random
#cmd="python3 hist_join_random.py ${rpath} ${figpath}"
#---------------random---------------
#--------------------Choose a Budget irace and a budget fastga
mexp=100000
mevals=1000
#-------------------histogram join each plan F,A,R,O and join all algorithms for the budget chosen
cmd="python3 hist_by_FARO.py ${ldata} ${figdir} ${mexp} ${mevals}"
$cmd
#-------------------histogram by pb join each plan F,A,R,O and join all algorithms for the budget chosen
cmd="python3 hist_by_FARO_pb.py ${ldata} ${figdir} ${mexp} ${mevals}"
$cmd

View file

@ -0,0 +1,71 @@
#!/usr/bin/env python3
import sys
import os
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import mannwhitneyu
##python3 hist_by_FARO.py ./fastga_results_all/ ./hist_and_csv/ 100000 1000
#one plot for one experiment plan for the same budget fastga, and the same budget irace if there is a budget irace (A,F)
path=sys.argv[1]
figpath=sys.argv[2]
maxExp=sys.argv[3]
maxEv=sys.argv[4]
indF=-1
indFO=-1
averageConfigs=[]
name=[]
for fastga in os.listdir(path): #ddir : directory of fastga_plan
if(fastga in {"fastga_results_planA","fastga_results_planF","fastga_results_planO"}):
for plan in os.listdir(os.path.join(path,fastga)):
print("maxExp="+str(maxExp)+"_maxEv="+str(maxEv) in plan,plan,"maxExp="+str(maxExp)+"_maxEv="+str(maxEv))
if("maxExp="+str(maxExp)+"_maxEv="+str(maxEv) in plan):
average=[]
for fastgadir in os.listdir(os.path.join(path,fastga,plan,"raw","data")): #fastgadir : directory of 50 runs of a configuration
for fname in os.listdir(os.path.join(path,fastga,plan,"raw","data",fastgadir)):
with open(os.path.join(path,fastga,plan,"raw","data",fastgadir,fname)) as fd:
auc = float(fd.readlines()[0]) *(-1)
average.append(auc)
averageConfigs.append(average)
nameid=plan.split("_")[0][-1]
name.append("plan"+nameid+"_"+"_".join(plan.split("_")[1:3]))
if("random" in fastga):
for randir in os.listdir(os.path.join(path,fastga)):
#eg path: maxEv=100_nbAlgo=15_2021-08-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

@ -0,0 +1,88 @@
#!/usr/bin/env python3
import sys
import os
import numpy as np
import matplotlib.pyplot as plt
##python3 hist_by_FARO_pb.py ./fastga_results_all/ ./hist_and_csv/ 100000 1000
#19 histograms by plan F,A ,R O
path=sys.argv[1]
figpath=sys.argv[2]
maxExp=sys.argv[3]
maxEv=sys.argv[4]
hist_pb=[[] for i in range(19)]
name=[]
for fastga in os.listdir(path): #ddir : directory of fastga_plan
if(fastga in {"fastga_results_planA", "fastga_results_planF","fastga_results_planO"}):
for plan in os.listdir(os.path.join(path,fastga)):
#print("maxExp="+str(maxExp)+"_maxEv="+str(maxEv)+"_" in plan,plan,"maxExp="+str(maxExp)+"_maxEv="+str(maxEv))
#print("maxExp="+str(maxExp)+"_maxEv="+str(maxEv) in plan,plan,"maxExp="+str(maxExp)+"_maxEv="+str(maxEv))
if("maxExp="+str(maxExp)+"_maxEv="+str(maxEv)+"_" in plan):
nameid=fastga[-1]
name.append("plan"+nameid+"_".join(plan.split("_")[1:3]))
for fastgadir in os.listdir(os.path.join(path,fastga,plan,"raw","data")): #fastgadir : directory of 50 runs of a configuration
pb=int(fastgadir.split("_")[0].split("=")[1])
average_pb=[]
for fname in os.listdir(os.path.join(path,fastga,plan,"raw","data",fastgadir)):
with open(os.path.join(path,fastga,plan,"raw","data",fastgadir,fname)) as fd:
auc = float(fd.readlines()[0]) *(-1)
average_pb.append(auc)
if(hist_pb[pb]==[]): #first algo
hist_pb[pb].append(average_pb)
elif(len(hist_pb[pb])!=len(name)):
hist_pb[pb].append(average_pb)
else:
hist_pb[pb][len(name)-1]+=average_pb #another algo for the same plan
if("random" in fastga):
for randir in os.listdir(os.path.join(path,fastga)):
#eg path: maxEv=100_nbAlgo=15_2021-08-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

@ -0,0 +1,90 @@
#!/usr/bin/env python3
import sys
import os
import numpy as np
import matplotlib.pyplot as plt
# python3 hist_by_pb_budget_plan.py ./fastga_results_all/fastga_results_planF/ ./hist_and_csv/
#python3 hist_by_pb_budget_plan.py ./fastga_results_all/fastga_results_planO ./hist_and_csv
#get 19 histograms with number of budget bars, same as hist_join but now is by pb
#argv : list of elite results
path=sys.argv[1]
figpath=sys.argv[2]
#plan_name=sys.argv[3]
hist_pb=[[] for i in range(19)]
name=[]
if("random" in path):
plan_name="R"
else:
plan_name=path.strip("/").split("/")[-1][-1]
for plandir in os.listdir(path): #plandir: directory of an experiment of elite results
if("results_elites_all" in plandir):
#eg : plan2_maxExp=10000_maxEv=1000_2021-08-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

@ -0,0 +1,68 @@
#!/usr/bin/env python3
import sys
import os
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import mannwhitneyu
#cmd : python3 hist_join.py ./fastga_results_all/fastga_results_planO/ ./hist_and_csv/
#histogram by plan for the budgets (irace and fastag)
path=sys.argv[1] #argv : directory of a Plan (O, A, F)
figpath=sys.argv[2] #path to store the histograms
averageConfigs=[]
name=[]
if("fastga_results_plan" in path):
for ddir in os.listdir(path): #ddir : directory of one run_elites_all or more
if("plan" in ddir):
average=[]
name.append("_".join(ddir.split("_")[1:3]))
for fastgadir in os.listdir(os.path.join(path,ddir,"raw","data")): #fastgadir : directory of 50 runs of a configuration
for fname in os.listdir(os.path.join(path,ddir,"raw","data",fastgadir)):
with open(os.path.join(path,ddir,"raw","data",fastgadir,fname)) as fd:
auc = float(fd.readlines()[0]) *(-1)
average.append(auc)
#hist[belonging(auc,cum)]+=1
averageConfigs.append(average)
#print(hist)
#print(average)
figdir=os.path.join(figpath,"hist_join")
try:
os.makedirs(figdir)
except FileExistsError:
pass
print(name,len(averageConfigs))
"""
idd0=name[0].split("_")[0].split("=")[1][:-3]+"k"
idd1=name[1].split("_")[0].split("=")[1][:-3]+"k"
idd2=name[2].split("_")[0].split("=")[1][:-3]+"k"
#only for Budget irace 10000, 50000, 100000 ie: only three experiment results
titlename="median"+idd0+"={:.3f}".format(np.median(averageConfigs[0]))+" , median"+idd1+"={:.3f}".format(np.median(averageConfigs[1]))+" , median"+idd2+"={:.3f}".format(np.median(averageConfigs[2]))
_,pv=mannwhitneyu(averageConfigs[0],averageConfigs[1])
titlename+="\n pvalue{}={:.3f}".format(idd0+idd1,pv)
_,pv=mannwhitneyu(averageConfigs[0],averageConfigs[2])
titlename+=" ,pvalue{}={:.3f}".format(idd0+idd2,pv)
_,pv=mannwhitneyu(averageConfigs[1],averageConfigs[2])
titlename+=" ,pvalue{}={:.3f}".format(idd1+idd2,pv)
print(titlename)
"""
plt.figure()
plt.hist(averageConfigs,bins=10,range=(0,1),align="mid",rwidth=0.9,label=name) #no label
plt.xlabel("performances")
plt.ylabel("Number of runs")
plt.xlim(0,1)
plt.ylim(0,7000)
plt.yticks(range(0,7000,500))
#plt.title(titlename)
plt.legend()
plt.savefig(figdir+"/hist_plan"+path.strip("/")[-1]+"_by_budget.png")
#plt.savefig(figpath+"/hist_plan"+path.strip("/")[-1]+"_by_budgetI.png")
plt.close()

View file

@ -0,0 +1,46 @@
#!/usr/bin/env python3
import sys
import os
import numpy as np
import matplotlib.pyplot as plt
##python3 hist_random.py ./dastga_results_all/fastga_results_random ./hist_and_csv/
#argv : list of elite results
data=sys.argv[1]
figpath=sys.argv[2]
averageConfigs=[]
name=[]
for path in os.listdir(data):
#eg path: maxEv=100_nbAlgo=15_2021-08-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

@ -0,0 +1,27 @@
## This is an example of specifying instances with a file.
# Each line is an instance relative to trainInstancesDir
# (see scenario.txt.tmpl) and an optional sequence of instance-specific
# parameters that will be passed to target-runnerx when invoked on that
# instance.
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

View file

@ -0,0 +1,227 @@
###################################################### -*- mode: r -*- #####
## Scenario setup for Iterated Race (irace).
############################################################################
## To use the default value of a parameter of iRace, simply do not set
## the parameter (comment it out in this file, and do not give any
## value on the command line).
## File that contains the description of the parameters of the target
## algorithm.
parameterFile = "./fastga.param"
## Directory where the programs will be run.
execDir = "."
## File to save tuning results as an R dataset, either absolute path or
## relative to execDir.
# logFile = "./irace.Rdata"
## Previously saved log file to recover the execution of irace, either
## absolute path or relative to the current directory. If empty or NULL,
## recovery is not performed.
# recoveryFile = ""
## Directory where training instances are located; either absolute path or
## relative to current directory. If no trainInstancesFiles is provided,
## all the files in trainInstancesDir will be listed as instances.
trainInstancesDir = "."
## File that contains a list of training instances and optionally
## additional parameters for them. If trainInstancesDir is provided, irace
## will search for the files in this folder.
trainInstancesFile = "./default.instances"
## File that contains a table of initial configurations. If empty or NULL,
## all initial configurations are randomly generated.
# configurationsFile = ""
## File that contains a list of logical expressions that cannot be TRUE
## for any evaluated configuration. If empty or NULL, do not use forbidden
## expressions.
forbiddenFile = "./forbidden.txt"
## Script called for each configuration that executes the target algorithm
## to be tuned. See templates.
targetRunner = "./target-runner"
## Number of times to retry a call to targetRunner if the call failed.
# targetRunnerRetries = 0
## Optional data passed to targetRunner. This is ignored by the default
## targetRunner function, but it may be used by custom targetRunner
## functions to pass persistent data around.
# targetRunnerData = ""
## Optional R function to provide custom parallelization of targetRunner.
# targetRunnerParallel = ""
## Optional script or R function that provides a numeric value for each
## configuration. See templates/target-evaluator.tmpl
# targetEvaluator = ""
## Maximum number of runs (invocations of targetRunner) that will be
## performed. It determines the maximum budget of experiments for the
## tuning.
maxExperiments = 0 #100000
## Maximum total execution time in seconds for the executions of
## targetRunner. targetRunner must return two values: cost and time.
# maxTime = 60
## Fraction (smaller than 1) of the budget used to estimate the mean
## computation time of a configuration. Only used when maxTime > 0
# budgetEstimation = 0.02
## Maximum number of decimal places that are significant for numerical
## (real) parameters.
digits = 2
## Debug level of the output of irace. Set this to 0 to silence all debug
## messages. Higher values provide more verbose debug messages.
# debugLevel = 0
## Number of iterations.
# nbIterations = 0
## Number of runs of the target algorithm per iteration.
# nbExperimentsPerIteration = 0
## Randomly sample the training instances or use them in the order given.
# sampleInstances = 1
## Statistical test used for elimination. Default test is always F-test
## unless capping is enabled, in which case the default test is t-test.
## Valid values are: F-test (Friedman test), t-test (pairwise t-tests with
## no correction), t-test-bonferroni (t-test with Bonferroni's correction
## for multiple comparisons), t-test-holm (t-test with Holm's correction
## for multiple comparisons).
# testType = "F-test"
## Number of instances evaluated before the first elimination test. It
## must be a multiple of eachTest.
# firstTest = 5
## Number of instances evaluated between elimination tests.
# eachTest = 1
## Minimum number of configurations needed to continue the execution of
## each race (iteration).
# minNbSurvival = 0
## Number of configurations to be sampled and evaluated at each iteration.
# nbConfigurations = 0
## Parameter used to define the number of configurations sampled and
## evaluated at each iteration.
# mu = 5
## Confidence level for the elimination test.
# confidence = 0.95
## If the target algorithm is deterministic, configurations will be
## evaluated only once per instance.
# deterministic = 0
## Seed of the random number generator (by default, generate a random
## seed).
# seed = NA
## Number of calls to targetRunner to execute in parallel. Values 0 or 1
## mean no parallelization.
# parallel = 0
## Enable/disable load-balancing when executing experiments in parallel.
## Load-balancing makes better use of computing resources, but increases
## communication overhead. If this overhead is large, disabling
## load-balancing may be faster.
# loadBalancing = 1
## Enable/disable MPI. Use Rmpi to execute targetRunner in parallel
## (parameter parallel is the number of slaves).
# mpi = 0
## Specify how irace waits for jobs to finish when targetRunner submits
## jobs to a batch cluster: sge, pbs, torque or slurm. targetRunner must
## submit jobs to the cluster using, for example, qsub.
# batchmode = 0
## Enable/disable the soft restart strategy that avoids premature
## convergence of the probabilistic model.
# softRestart = 1
## Soft restart threshold value for numerical parameters. If NA, NULL or
## "", it is computed as 10^-digits.
# softRestartThreshold = ""
## Directory where testing instances are located, either absolute or
## relative to current directory.
# testInstancesDir = ""
## File containing a list of test instances and optionally additional
## parameters for them.
# testInstancesFile = ""
## Number of elite configurations returned by irace that will be tested if
## test instances are provided.
# testNbElites = 1
## Enable/disable testing the elite configurations found at each
## iteration.
# testIterationElites = 0
## Enable/disable elitist irace.
# elitist = 1
## Number of instances added to the execution list before previous
## instances in elitist irace.
# elitistNewInstances = 1
## In elitist irace, maximum number per race of elimination tests that do
## not eliminate a configuration. Use 0 for no limit.
# elitistLimit = 2
## User-defined R function that takes a configuration generated by irace
## and repairs it.
# repairConfiguration = ""
## Enable the use of adaptive capping, a technique designed for minimizing
## the computation time of configurations. This is only available when
## elitist is active.
# capping = 0
## Measure used to obtain the execution bound from the performance of the
## elite configurations: median, mean, worst, best.
# cappingType = "median"
## Method to calculate the mean performance of elite configurations:
## candidate or instance.
# boundType = "candidate"
## Maximum execution bound for targetRunner. It must be specified when
## capping is enabled.
# boundMax = 0
## Precision used for calculating the execution time. It must be specified
## when capping is enabled.
# boundDigits = 0
## Penalization constant for timed out executions (executions that reach
## boundMax execution time).
# boundPar = 1
## Replace the configuration cost of bounded executions with boundMax.
# boundAsTimeout = 1
## Percentage of the configuration budget used to perform a postselection
## race of the best configurations of each iteration after the execution
## of irace.
# postselection = 0
## Enable/disable AClib mode. This option enables compatibility with
## GenericWrapper4AC as targetRunner script.
# aclib = 0
## END of scenario file
############################################################################

View file

@ -0,0 +1,12 @@
# name switch type range
# continuator "--continuator=" c (0)
crossoverrate "--crossover-rate=" r (0,1)
crossselector "--cross-selector=" c (0,1,2,3,4,5,6)
# aftercrossselector "--aftercross-selector=" c (0)
crossover "--crossover=" c (0,1,2,3,4,5,6,7,8,9)
mutationrate "--mutation-rate=" r (0,1)
mutselector "--mut-selector=" c (0,1,2,3,4,5,6)
mutation "--mutation=" c (0,1,2,3,4,5,6,7,8,9,10)
replacement "--replacement=" c (0,1,2,3,4,5,6,7,8,9,10)
popsize "--pop-size=" i (1,50)
offspringsize "--offspring-size=" i (1,50)

View file

@ -0,0 +1,13 @@
## Template for specifying forbidden parameter configurations in irace.
##
## This filename must be specified via the --forbidden-file command-line option
## (or forbiddenFile in scenario.txt).
##
## The format is one constraint per line. Each constraint is a logical
## expression (in R syntax). If a parameter configuration
## is generated that makes the logical expression evaluate to TRUE,
## then the configuration is discarded.
##
## Examples of valid logical operators are: == != >= <= > < & | ! %in%
(replacement %in% c(2,3,4,5,6,7,8,9,10)) & (offspringsize > popsize)
(replacement %in% c(1)) & (offspringsize < popsize)

View file

@ -0,0 +1,89 @@
#!/bin/bash
###############################################################################
# This script is the command that is executed every run.
# Check the examples in examples/
#
# This script is run in the execution directory (execDir, --exec-dir).
#
# PARAMETERS:
# $1 is the candidate configuration number
# $2 is the instance ID
# $3 is the seed
# $4 is the instance name
# The rest ($* after `shift 4') are parameters to the run
#
# RETURN VALUE:
# This script should print one numerical value: the cost that must be minimized.
# Exit with 0 if no error, with 1 in case of error
###############################################################################
error() {
echo "`TZ=UTC date`: $0: error: $@"
exit 1
}
EXE="./fastga"
LOG_DIR="irace_logs"
#FIXED_PARAMS="--problem=0"
#
CONFIG_ID=$1
INSTANCE_ID=$2
SEED=$3
INSTANCE=$(echo $4 | sed 's/\//\n/g'|tail -n 1)
CROSSOVER_RATE=$5
CROSSOVER_SELECTOR=$6
CROSSOVER=$7
MUTATION_RATE=$8
MUT_SELECTOR=$9
MUTATION=${10}
REPLACEMENT=${11}
POPSIZE=${12}
OFFSPRINGSIZE=${13}
shift 13 || error "Not enough parameters"
INSTANCE_PARAMS=$*
buckets=0
# STDOUT=${LOG_DIR}/c${CONFIG_ID}_i${INSTANCE_ID}_s${SEED}.stdout
# STDERR=${LOG_DIR}/c${CONFIG_ID}_i${INSTANCE_ID}_s${SEED}.stderr
STDOUT="/dev/null"
STDERR="/dev/null"
if [ ! -x "${EXE}" ]; then
error "${EXE}: not found or not executable (pwd: $(pwd))"
fi
# If the program just prints a number, we can use 'exec' to avoid
# creating another process, but there can be no other commands after exec.
#exec $EXE ${FIXED_PARAMS} -i $INSTANCE ${INSTANCE_PARAMS}
# exit 1
#
# Otherwise, save the output to a file, and parse the result from it.
# (If you wish to ignore segmentation faults you can use '{}' around
# the command.)
cmd="$EXE --problem=${INSTANCE} --instance=${INSTANCE} --seed=${SEED} ${CROSSOVER_RATE} ${CROSSOVER_SELECTOR} ${CROSSOVER} ${MUTATION_RATE} ${MUT_SELECTOR} ${MUTATION} ${REPLACEMENT} ${POPSIZE} ${OFFSPRINGSIZE} --max-evals=${buckets}"
# NOTE: irace seems to capture both stderr and stdout, so you should not output to stderr
echo ${cmd} > ${STDERR}
$cmd 2> ${STDERR} | tee ${STDOUT}
# The following code is useless if the binary only output a single number on stdout.
# This may be used to introduce a delay if there are filesystem
# issues.
# SLEEPTIME=1
# while [ ! -s "${STDOUT}" ]; do
# sleep $SLEEPTIME
# let "SLEEPTIME += 1"
# done
# This is an example of reading a number from the output.
# It assumes that the objective value is the first number in
# the first column of the last line of the output.
# if [ -s "${STDOUT}" ]; then
# COST=$(tail -n 1 ${STDOUT} | grep -e '^[[:space:]]*[+-]\?[0-9]' | cut -f1)
# echo "$COST"
# rm -f "${STDOUT}" "${STDERR}"
# exit 0
# else
# error "${STDOUT}: No such file or directory"
# fi

View file

@ -0,0 +1,48 @@
## This is an example of specifying instances with a file.
# Each line is an instance relative to trainInstancesDir
# (see scenario.txt.tmpl) and an optional sequence of instance-specific
# parameters that will be passed to target-runnerx when invoked on that
# instance.
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40

View file

@ -0,0 +1,227 @@
###################################################### -*- mode: r -*- #####
## Scenario setup for Iterated Race (irace).
############################################################################
## To use the default value of a parameter of iRace, simply do not set
## the parameter (comment it out in this file, and do not give any
## value on the command line).
## File that contains the description of the parameters of the target
## algorithm.
parameterFile = "./fastga.param"
## Directory where the programs will be run.
execDir = "."
## File to save tuning results as an R dataset, either absolute path or
## relative to execDir.
# logFile = "./irace.Rdata"
## Previously saved log file to recover the execution of irace, either
## absolute path or relative to the current directory. If empty or NULL,
## recovery is not performed.
# recoveryFile = ""
## Directory where training instances are located; either absolute path or
## relative to current directory. If no trainInstancesFiles is provided,
## all the files in trainInstancesDir will be listed as instances.
trainInstancesDir = "."
## File that contains a list of training instances and optionally
## additional parameters for them. If trainInstancesDir is provided, irace
## will search for the files in this folder.
trainInstancesFile = "./default.instances"
## File that contains a table of initial configurations. If empty or NULL,
## all initial configurations are randomly generated.
# configurationsFile = ""
## File that contains a list of logical expressions that cannot be TRUE
## for any evaluated configuration. If empty or NULL, do not use forbidden
## expressions.
forbiddenFile = "./forbidden.txt"
## Script called for each configuration that executes the target algorithm
## to be tuned. See templates.
targetRunner = "./target-runner"
## Number of times to retry a call to targetRunner if the call failed.
# targetRunnerRetries = 0
## Optional data passed to targetRunner. This is ignored by the default
## targetRunner function, but it may be used by custom targetRunner
## functions to pass persistent data around.
# targetRunnerData = ""
## Optional R function to provide custom parallelization of targetRunner.
# targetRunnerParallel = ""
## Optional script or R function that provides a numeric value for each
## configuration. See templates/target-evaluator.tmpl
# targetEvaluator = ""
## Maximum number of runs (invocations of targetRunner) that will be
## performed. It determines the maximum budget of experiments for the
## tuning.
maxExperiments = 0 #100000
## Maximum total execution time in seconds for the executions of
## targetRunner. targetRunner must return two values: cost and time.
# maxTime = 60
## Fraction (smaller than 1) of the budget used to estimate the mean
## computation time of a configuration. Only used when maxTime > 0
# budgetEstimation = 0.02
## Maximum number of decimal places that are significant for numerical
## (real) parameters.
digits = 2
## Debug level of the output of irace. Set this to 0 to silence all debug
## messages. Higher values provide more verbose debug messages.
# debugLevel = 0
## Number of iterations.
# nbIterations = 0
## Number of runs of the target algorithm per iteration.
# nbExperimentsPerIteration = 0
## Randomly sample the training instances or use them in the order given.
# sampleInstances = 1
## Statistical test used for elimination. Default test is always F-test
## unless capping is enabled, in which case the default test is t-test.
## Valid values are: F-test (Friedman test), t-test (pairwise t-tests with
## no correction), t-test-bonferroni (t-test with Bonferroni's correction
## for multiple comparisons), t-test-holm (t-test with Holm's correction
## for multiple comparisons).
# testType = "F-test"
## Number of instances evaluated before the first elimination test. It
## must be a multiple of eachTest.
# firstTest = 5
## Number of instances evaluated between elimination tests.
# eachTest = 1
## Minimum number of configurations needed to continue the execution of
## each race (iteration).
# minNbSurvival = 0
## Number of configurations to be sampled and evaluated at each iteration.
# nbConfigurations = 0
## Parameter used to define the number of configurations sampled and
## evaluated at each iteration.
# mu = 5
## Confidence level for the elimination test.
# confidence = 0.95
## If the target algorithm is deterministic, configurations will be
## evaluated only once per instance.
# deterministic = 0
## Seed of the random number generator (by default, generate a random
## seed).
# seed = NA
## Number of calls to targetRunner to execute in parallel. Values 0 or 1
## mean no parallelization.
# parallel = 0
## Enable/disable load-balancing when executing experiments in parallel.
## Load-balancing makes better use of computing resources, but increases
## communication overhead. If this overhead is large, disabling
## load-balancing may be faster.
# loadBalancing = 1
## Enable/disable MPI. Use Rmpi to execute targetRunner in parallel
## (parameter parallel is the number of slaves).
# mpi = 0
## Specify how irace waits for jobs to finish when targetRunner submits
## jobs to a batch cluster: sge, pbs, torque or slurm. targetRunner must
## submit jobs to the cluster using, for example, qsub.
# batchmode = 0
## Enable/disable the soft restart strategy that avoids premature
## convergence of the probabilistic model.
# softRestart = 1
## Soft restart threshold value for numerical parameters. If NA, NULL or
## "", it is computed as 10^-digits.
# softRestartThreshold = ""
## Directory where testing instances are located, either absolute or
## relative to current directory.
# testInstancesDir = ""
## File containing a list of test instances and optionally additional
## parameters for them.
# testInstancesFile = ""
## Number of elite configurations returned by irace that will be tested if
## test instances are provided.
# testNbElites = 1
## Enable/disable testing the elite configurations found at each
## iteration.
# testIterationElites = 0
## Enable/disable elitist irace.
# elitist = 1
## Number of instances added to the execution list before previous
## instances in elitist irace.
# elitistNewInstances = 1
## In elitist irace, maximum number per race of elimination tests that do
## not eliminate a configuration. Use 0 for no limit.
# elitistLimit = 2
## User-defined R function that takes a configuration generated by irace
## and repairs it.
# repairConfiguration = ""
## Enable the use of adaptive capping, a technique designed for minimizing
## the computation time of configurations. This is only available when
## elitist is active.
# capping = 0
## Measure used to obtain the execution bound from the performance of the
## elite configurations: median, mean, worst, best.
# cappingType = "median"
## Method to calculate the mean performance of elite configurations:
## candidate or instance.
# boundType = "candidate"
## Maximum execution bound for targetRunner. It must be specified when
## capping is enabled.
# boundMax = 0
## Precision used for calculating the execution time. It must be specified
## when capping is enabled.
# boundDigits = 0
## Penalization constant for timed out executions (executions that reach
## boundMax execution time).
# boundPar = 1
## Replace the configuration cost of bounded executions with boundMax.
# boundAsTimeout = 1
## Percentage of the configuration budget used to perform a postselection
## race of the best configurations of each iteration after the execution
## of irace.
# postselection = 0
## Enable/disable AClib mode. This option enables compatibility with
## GenericWrapper4AC as targetRunner script.
# aclib = 0
## END of scenario file
############################################################################

View file

@ -0,0 +1,12 @@
# name switch type range
# continuator "--continuator=" c (0)
crossoverrate "--crossover-rate=" r (0,1)
crossselector "--cross-selector=" c (0,1,2,3,4,5,6)
# aftercrossselector "--aftercross-selector=" c (0)
crossover "--crossover=" c (0,1,2,3,4,5,6,7,8,9)
mutationrate "--mutation-rate=" r (0,1)
mutselector "--mut-selector=" c (0,1,2,3,4,5,6)
mutation "--mutation=" c (0,1,2,3,4,5,6,7,8,9,10)
replacement "--replacement=" c (0,1,2,3,4,5,6,7,8,9,10)
popsize "--pop-size=" i (1,50)
offspringsize "--offspring-size=" i (1,50)

View file

@ -0,0 +1,15 @@
## Template for specifying forbidden parameter configurations in irace.
##
## This filename must be specified via the --forbidden-file command-line option
## (or forbiddenFile in scenario.txt).
##
## The format is one constraint per line. Each constraint is a logical
## expression (in R syntax). If a parameter configuration
## is generated that makes the logical expression evaluate to TRUE,
## then the configuration is discarded.
##
## Examples of valid logical operators are: == != >= <= > < & | ! %in%
(replacement %in% c(2,3,4,5,6,7,8,9,10)) & (offspringsize > popsize)
(replacement %in% c(1)) & (offspringsize < popsize)
#(as.numeric(replacement) == 2) & (offspringsize > popsize)
#(as.numeric(replacement) == 3) & (offspringsize > popsize)

View file

@ -0,0 +1,96 @@
#!/bin/bash
###############################################################################
# This script is the command that is executed every run.
# Check the examples in examples/
#
# This script is run in the execution directory (execDir, --exec-dir).
#
# PARAMETERS:
# $1 is the candidate configuration number
# $2 is the instance ID
# $3 is the seed
# $4 is the instance name
# The rest ($* after `shift 4') are parameters to the run
#
# RETURN VALUE:
# This script should print one numerical value: the cost that must be minimized.
# Exit with 0 if no error, with 1 in case of error
###############################################################################
error() {
echo "`TZ=UTC date`: $0: error: $@"
exit 1
}
EXE="./fastga"
LOG_DIR="irace_logs"
FIXED_PARAMS="--problem=0"
#MAX_EVALS=2
#
CONFIG_ID=$1
INSTANCE_ID=$2
SEED=$3
INSTANCE=$(echo $4 | sed 's/\//\n/g'|tail -n 1)
CROSSOVER_RATE=$5
CROSSOVER_SELECTOR=$6
CROSSOVER=$7
MUTATION_RATE=$8
MUT_SELECTOR=$9
MUTATION=${10}
REPLACEMENT=${11}
POPSIZE=${12}
OFFSPRINGSIZE=${13}
shift 13 || error "Not enough parameters"
INSTANCE_PARAMS=$*
buckets=0
#dim=(20 20 16 48 25 32 128 128 128 50 100 150 128 192 192 192 256 75 150)
#size= $( echo $(echo $13 | cut -d'=' -f2))
#pb=$(echo $(echo $13 | cut -d'=' -f2))
#maxevals=$( echo ${dim[$pb]})
# STDOUT=${LOG_DIR}/c${CONFIG_ID}_i${INSTANCE_ID}_s${SEED}.stdout
# STDERR=${LOG_DIR}/c${CONFIG_ID}_i${INSTANCE_ID}_s${SEED}.stderr
STDOUT="/dev/null"
STDERR="/dev/null"
if [ ! -x "${EXE}" ]; then
error "${EXE}: not found or not executable (pwd: $(pwd))"
fi
# If the program just prints a number, we can use 'exec' to avoid
# creating another process, but there can be no other commands after exec.
#exec $EXE ${FIXED_PARAMS} -i $INSTANCE ${INSTANCE_PARAMS}
# exit 1
#
# Otherwise, save the output to a file, and parse the result from it.
# (If you wish to ignore segmentation faults you can use '{}' around
# the command.)
cmd="$EXE ${FIXED_PARAMS} --instance=${INSTANCE} --seed=${SEED} ${CROSSOVER_RATE} ${CROSSOVER_SELECTOR} ${CROSSOVER} ${MUTATION_RATE} ${MUT_SELECTOR} ${MUTATION} ${REPLACEMENT} ${POPSIZE} ${OFFSPRINGSIZE} --max-evals=${buckets}"
# NOTE: irace seems to capture both stderr and stdout, so you should not output to stderr
echo ${cmd} > ${STDERR}
$cmd 2> ${STDERR} | tee ${STDOUT}
# The following code is useless if the binary only output a single number on stdout.
# This may be used to introduce a delay if there are filesystem
# issues.
# SLEEPTIME=1
# while [ ! -s "${STDOUT}" ]; do
# sleep $SLEEPTIME
# let "SLEEPTIME += 1"
# done
# This is an example of reading a number from the output.
# It assumes that the objective value is the first number in
# the first column of the last line of the output.
# if [ -s "${STDOUT}" ]; then
# COST=$(tail -n 1 ${STDOUT} | grep -e '^[[:space:]]*[+-]\?[0-9]' | cut -f1)
# echo "$COST"
# rm -f "${STDOUT}" "${STDERR}"
# exit 0
# else
# error "${STDOUT}: No such file or directory"
# fi

View file

@ -0,0 +1,48 @@
## This is an example of specifying instances with a file.
# Each line is an instance relative to trainInstancesDir
# (see scenario.txt.tmpl) and an optional sequence of instance-specific
# parameters that will be passed to target-runnerx when invoked on that
# instance.
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40

View file

@ -0,0 +1,228 @@
###################################################### -*- mode: r -*- #####
## Scenario setup for Iterated Race (irace).
############################################################################
## To use the default value of a parameter of iRace, simply do not set
## the parameter (comment it out in this file, and do not give any
## value on the command line).
## File that contains the description of the parameters of the target
## algorithm.
parameterFile = "./fastga.param"
## Directory where the programs will be run.
execDir = "."
## File to save tuning results as an R dataset, either absolute path or
## relative to execDir.
# logFile = "./irace.Rdata"
## Previously saved log file to recover the execution of irace, either
## absolute path or relative to the current directory. If empty or NULL,
## recovery is not performed.
# recoveryFile = ""
## Directory where training instances are located; either absolute path or
## relative to current directory. If no trainInstancesFiles is provided,
## all the files in trainInstancesDir will be listed as instances.
trainInstancesDir = "."
## File that contains a list of training instances and optionally
## additional parameters for them. If trainInstancesDir is provided, irace
## will search for the files in this folder.
trainInstancesFile = "./default.instances"
## File that contains a table of initial configurations. If empty or NULL,
## all initial configurations are randomly generated.
# configurationsFile = ""
## File that contains a list of logical expressions that cannot be TRUE
## for any evaluated configuration. If empty or NULL, do not use forbidden
## expressions.
# forbiddenFile = ""
## Script called for each configuration that executes the target algorithm
## to be tuned. See templates.
targetRunner = "./target-runner"
## Number of times to retry a call to targetRunner if the call failed.
# targetRunnerRetries = 0
## Optional data passed to targetRunner. This is ignored by the default
## targetRunner function, but it may be used by custom targetRunner
## functions to pass persistent data around.
# targetRunnerData = ""
## Optional R function to provide custom parallelization of targetRunner.
# targetRunnerParallel = ""
## Optional script or R function that provides a numeric value for each
## configuration. See templates/target-evaluator.tmpl
# targetEvaluator = ""
## Maximum number of runs (invocations of targetRunner) that will be
## performed. It determines the maximum budget of experiments for the
## tuning.
maxExperiments = 0 #100000
## Maximum total execution time in seconds for the executions of
## targetRunner. targetRunner must return two values: cost and time.
# maxTime = 60
## Fraction (smaller than 1) of the budget used to estimate the mean
## computation time of a configuration. Only used when maxTime > 0
# budgetEstimation = 0.02
## Maximum number of decimal places that are significant for numerical
## (real) parameters.
digits = 2
## Debug level of the output of irace. Set this to 0 to silence all debug
## messages. Higher values provide more verbose debug messages.
# debugLevel = 0
## Number of iterations.
# nbIterations = 0
## Number of runs of the target algorithm per iteration.
# nbExperimentsPerIteration = 0
## Randomly sample the training instances or use them in the order given.
# sampleInstances = 1
## Statistical test used for elimination. Default test is always F-test
## unless capping is enabled, in which case the default test is t-test.
## Valid values are: F-test (Friedman test), t-test (pairwise t-tests with
## no correction), t-test-bonferroni (t-test with Bonferroni's correction
## for multiple comparisons), t-test-holm (t-test with Holm's correction
## for multiple comparisons).
# testType = "F-test"
## Number of instances evaluated before the first elimination test. It
## must be a multiple of eachTest.
# firstTest = 5
## Number of instances evaluated between elimination tests.
# eachTest = 1
## Minimum number of configurations needed to continue the execution of
## each race (iteration).
# minNbSurvival = 0
## Number of configurations to be sampled and evaluated at each iteration.
# nbConfigurations = 0
## Parameter used to define the number of configurations sampled and
## evaluated at each iteration.
# mu = 5
## Confidence level for the elimination test.
# confidence = 0.95
## If the target algorithm is deterministic, configurations will be
## evaluated only once per instance.
# deterministic = 0
## Seed of the random number generator (by default, generate a random
## seed).
# seed = NA
## Number of calls to targetRunner to execute in parallel. Values 0 or 1
## mean no parallelization.
# parallel = 0
## Enable/disable load-balancing when executing experiments in parallel.
## Load-balancing makes better use of computing resources, but increases
## communication overhead. If this overhead is large, disabling
## load-balancing may be faster.
# loadBalancing = 1
## Enable/disable MPI. Use Rmpi to execute targetRunner in parallel
## (parameter parallel is the number of slaves).
# mpi = 0
## Specify how irace waits for jobs to finish when targetRunner submits
## jobs to a batch cluster: sge, pbs, torque or slurm. targetRunner must
## submit jobs to the cluster using, for example, qsub.
# batchmode = 0
## Enable/disable the soft restart strategy that avoids premature
## convergence of the probabilistic model.
# softRestart = 1
## Soft restart threshold value for numerical parameters. If NA, NULL or
## "", it is computed as 10^-digits.
# softRestartThreshold = ""
## Directory where testing instances are located, either absolute or
## relative to current directory.
# testInstancesDir = ""
## File containing a list of test instances and optionally additional
## parameters for them.
# testInstancesFile = ""
## Number of elite configurations returned by irace that will be tested if
## test instances are provided.
# testNbElites = 1
## Enable/disable testing the elite configurations found at each
## iteration.
# testIterationElites = 0
## Enable/disable elitist irace.
# elitist = 1
## Number of instances added to the execution list before previous
## instances in elitist irace.
# elitistNewInstances = 1
## In elitist irace, maximum number per race of elimination tests that do
## not eliminate a configuration. Use 0 for no limit.
# elitistLimit = 2
## User-defined R function that takes a configuration generated by irace
## and repairs it.
# repairConfiguration = ""
## Enable the use of adaptive capping, a technique designed for minimizing
## the computation time of configurations. This is only available when
## elitist is active.
# capping = 0
## Measure used to obtain the execution bound from the performance of the
## elite configurations: median, mean, worst, best.
# cappingType = "median"
## Method to calculate the mean performance of elite configurations:
## candidate or instance.
# boundType = "candidate"
## Maximum execution bound for targetRunner. It must be specified when
## capping is enabled.
# boundMax = 0
## Precision used for calculating the execution time. It must be specified
## when capping is enabled.
# boundDigits = 0
## Penalization constant for timed out executions (executions that reach
## boundMax execution time).
# boundPar = 1
## Replace the configuration cost of bounded executions with boundMax.
# boundAsTimeout = 1
## Percentage of the configuration budget used to perform a postselection
## race of the best configurations of each iteration after the execution
## of irace.
# postselection = 0
## Enable/disable AClib mode. This option enables compatibility with
## GenericWrapper4AC as targetRunner script.
# aclib = 0
## END of scenario file
############################################################################

View file

@ -0,0 +1,10 @@
# name switch type range
# continuator "--continuator=" c (0)
crossoverrate "--crossover-rate=" r (0,1)
crossselector "--cross-selector=" c (0,1,2,3,4,5,6)
# aftercrossselector "--aftercross-selector=" c (0)
crossover "--crossover=" c (0,1,2,3,4,5,6,7,8,9)
mutationrate "--mutation-rate=" r (0,1)
mutselector "--mut-selector=" c (0,1,2,3,4,5,6)
mutation "--mutation=" c (0,1,2,3,4,5,6,7,8,9,10)
replacement "--replacement=" c (0,1,2,3,4,5,6,7,8,9,10)

View file

@ -0,0 +1,88 @@
#!/bin/bash
###############################################################################
# This script is the command that is executed every run.
# Check the examples in examples/
#
# This script is run in the execution directory (execDir, --exec-dir).
#
# PARAMETERS:
# $1 is the candidate configuration number
# $2 is the instance ID
# $3 is the seed
# $4 is the instance name
# The rest ($* after `shift 4') are parameters to the run
#
# RETURN VALUE:
# This script should print one numerical value: the cost that must be minimized.
# Exit with 0 if no error, with 1 in case of error
###############################################################################
error() {
echo "`TZ=UTC date`: $0: error: $@"
exit 1
}
EXE="./fastga"
LOG_DIR="irace_logs"
FIXED_PARAMS="--problem=0"
MAX_EVALS=100
#
CONFIG_ID=$1
INSTANCE_ID=$2
SEED=$3
INSTANCE=$(echo $4 | sed 's/\//\n/g'|tail -n 1)
CROSSOVER_RATE=$5
CROSSOVER_SELECTOR=$6
CROSSOVER=$7
MUTATION_RATE=$8
MUT_SELECTOR=$9
MUTATION=${10}
REPLACEMENT=${11}
shift 11 || error "Not enough parameters"
INSTANCE_PARAMS=$*
# STDOUT=${LOG_DIR}/c${CONFIG_ID}_i${INSTANCE_ID}_s${SEED}.stdout
# STDERR=${LOG_DIR}/c${CONFIG_ID}_i${INSTANCE_ID}_s${SEED}.stderr
STDOUT="/dev/null"
STDERR="/dev/null"
if [ ! -x "${EXE}" ]; then
error "${EXE}: not found or not executable (pwd: $(pwd))"
fi
# If the program just prints a number, we can use 'exec' to avoid
# creating another process, but there can be no other commands after exec.
#exec $EXE ${FIXED_PARAMS} -i $INSTANCE ${INSTANCE_PARAMS}
# exit 1
#
# Otherwise, save the output to a file, and parse the result from it.
# (If you wish to ignore segmentation faults you can use '{}' around
# the command.)
cmd="$EXE ${FIXED_PARAMS} --instance=${INSTANCE} --seed=${SEED} ${CROSSOVER_RATE} ${CROSSOVER_SELECTOR} ${CROSSOVER} ${MUTATION_RATE} ${MUT_SELECTOR} ${MUTATION} ${REPLACEMENT}"
# NOTE: irace seems to capture both stderr and stdout, so you should not output to stderr
echo ${cmd} > ${STDERR}
$cmd 2> ${STDERR} | tee ${STDOUT}
# The following code is useless if the binary only output a single number on stdout.
# This may be used to introduce a delay if there are filesystem
# issues.
# SLEEPTIME=1
# while [ ! -s "${STDOUT}" ]; do
# sleep $SLEEPTIME
# let "SLEEPTIME += 1"
# done
# This is an example of reading a number from the output.
# It assumes that the objective value is the first number in
# the first column of the last line of the output.
# if [ -s "${STDOUT}" ]; then
# COST=$(tail -n 1 ${STDOUT} | grep -e '^[[:space:]]*[+-]\?[0-9]' | cut -f1)
# echo "$COST"
# rm -f "${STDOUT}" "${STDERR}"
# exit 0
# else
# error "${STDOUT}: No such file or directory"
# fi

View file

@ -0,0 +1,140 @@
#!/usr/bin/env python3
import sys
import os
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import mannwhitneyu
##cmd eg :
# python3 hist_by_2_4_5.py ./fastga_results_all/ ./hist_and_csv/ 100000 1000
#get the Mann Whitney test U results between the plan F and plan R
# (change ligne 23 and 44 for other plan, and the maxExp, maxEv for other budget)
path=sys.argv[1]
figpath=sys.argv[2] #directory to store the data
maxExp=sys.argv[3]
maxEv=sys.argv[4]
hist_pb=[[] for i in range(19)]
name=[]
randind=-1
for fastga in os.listdir(path): #ddir : directory of fastga_plan
if(fastga in {"fastga_results_planF"}):
for plan in os.listdir(os.path.join(path,fastga)):
print("maxExp="+str(maxExp)+"_maxEv="+str(maxEv)+"_" in plan,plan,"maxExp="+str(maxExp)+"_maxEv="+str(maxEv))
#print("maxExp="+str(maxExp)+"_maxEv="+str(maxEv) in plan,plan,"maxExp="+str(maxExp)+"_maxEv="+str(maxEv))
if("maxExp="+str(maxExp)+"_maxEv="+str(maxEv)+"_" in plan):
name.append("_".join(plan.split("_")[:3]))
for fastgadir in os.listdir(os.path.join(path,fastga,plan,"raw","data")): #fastgadir : directory of 50 runs of a configuration
pb=int(fastgadir.split("_")[0].split("=")[1])
average_pb=[]
for fname in os.listdir(os.path.join(path,fastga,plan,"raw","data",fastgadir)):
with open(os.path.join(path,fastga,plan,"raw","data",fastgadir,fname)) as fd:
auc = float(fd.readlines()[0])
average_pb.append(auc)
if(hist_pb[pb]==[]): #first algo
hist_pb[pb].append(average_pb)
elif(len(hist_pb[pb])!=len(name)):
hist_pb[pb].append(average_pb)
else:
hist_pb[pb][len(name)-1]+=average_pb #another algo for the same plan
if("random" in fastga):
for randir in os.listdir(os.path.join(path,fastga)):
#eg path: maxEv=100_nbAlgo=15_2021-08-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

@ -0,0 +1,31 @@
#!/usr/bin/env python3
#parse data1
import os
import re
import sys
print("ecdf,id,crossover-rate,cross-selector,crossover,mutation-rate,mut-selector,mutation,replacement,pop-size,offspring-size")
#give the path of one experiment
argv=sys.argv[1]
for datadir in os.listdir(argv):
#if(os.path.isdir(os.path.join(argv,datadir))): check if argv/datadir is a directory
if(datadir.find("results_irace")>=0): #check if the directory is one JOB
with open(os.path.join("./",argv,datadir,"irace.log")) as fd:
data = fd.readlines()
# Find the last best configuration
bests = [line.strip() for line in data if "Best-so-far" in line]
#print(datadir,bests)
best = bests[-1].split()
best_id, best_perf = best[2], best[5]
# print(best_id,best_perf)
# Filter the config detail
configs = [line.strip() for line in data if "--crossover-rate=" in line and best_id in line]
# print(configs)
# Format as CSV
algo = re.sub("\-\-\S*=", ",", configs[0])
csv_line = best_perf + "," + algo
print(csv_line.replace(" ",""))

View file

@ -0,0 +1,35 @@
#!/usr/bin/env python3
#parse data1
import os
import re
import sys
#print("pb,ecdf,id,crossover-rate,cross-selector,crossover,mutation-rate,mut-selector,mutation,replacement") #plan1
print("pb,ecdf,id,crossover-rate,cross-selector,crossover,mutation-rate,mut-selector,mutation,replacement,pop-size,offspring-size")
#give the path of one experiment
argv=sys.argv[1]
for datadir in os.listdir(argv):
#if(os.path.isdir(os.path.join(argv,datadir))): check if argv/datadir is a directory
if(datadir.find("results_irace")>=0): #check if the directory is one JOB
for pb_dir in os.listdir(os.path.join(argv,datadir)):
if "results_problem" in pb_dir:
pb_id=pb_dir.replace("results_problem_","")
with open(os.path.join("./",argv,datadir,pb_dir,"irace.log")) as fd:
data = fd.readlines()
# Find the last best configuration
bests = [line.strip() for line in data if "Best-so-far" in line]
#print(datadir,bests)
best = bests[-1].split()
best_id, best_perf = best[2], best[5]
# print(best_id,best_perf)
# Filter the config detail
configs = [line.strip() for line in data if "--crossover-rate=" in line and best_id in line]
# print(configs)
# Format as CSV
algo = re.sub("\-\-\S*=", ",", configs[0])
csv_line = pb_id + "," + best_perf + "," + algo
print(csv_line.replace(" ",""))

View file

@ -0,0 +1,35 @@
#!/usr/bin/env python3
#parse data1
import os
import re
import sys
#print("pb,ecdf,id,crossover-rate,cross-selector,crossover,mutation-rate,mut-selector,mutation,replacement") #plan1
print("pb,ecdf,id,crossover-rate,cross-selector,crossover,mutation-rate,mut-selector,mutation,replacement")
#give the path of one experiment
argv=sys.argv[1]
for datadir in os.listdir(argv):
#if(os.path.isdir(os.path.join(argv,datadir))): check if argv/datadir is a directory
if(datadir.find("results_irace")>=0): #check if the directory is one JOB
for pb_dir in os.listdir(os.path.join(argv,datadir)):
if "results_problem" in pb_dir:
pb_id=pb_dir.replace("results_problem_","")
with open(os.path.join("./",argv,datadir,pb_dir,"irace.log")) as fd:
data = fd.readlines()
# Find the last best configuration
bests = [line.strip() for line in data if "Best-so-far" in line]
#print(datadir,bests)
best = bests[-1].split()
best_id, best_perf = best[2], best[5]
# print(best_id,best_perf)
# Filter the config detail
configs = [line.strip() for line in data if "--crossover-rate=" in line and best_id in line]
# print(configs)
# Format as CSV
algo = re.sub("\-\-\S*=", ",", configs[0])
csv_line = pb_id + "," + best_perf + "," + algo
print(csv_line.replace(" ",""))

View file

@ -0,0 +1,34 @@
#!/usr/bin/env python3
import sys
import os
import numpy as np
import matplotlib.pyplot as plt
#get the auc average values of one experiment
figdir=sys.argv[1] # directory of a result of one experiment
#eg : ./fastga_results_all/fastga_results_planO/planO_maxExp\=100000_maxEv\=5n_2021-08-13T19\:04+02\:00_results_elites_all/raw
if("fastga_results_plan" in figdir):
print("FID,",",".join(map(str,range(1,16))))
aucs=[[] for i in range(19)]
for fastgadir in os.listdir(os.path.join(figdir,"raw/data")): #fastgadir : directory of 50 runs of an elite configuration
#cum=np.cumsum([0.1]*10)
average=[]
for fname in os.listdir(os.path.join(figdir,"raw/data",fastgadir)):
with open(os.path.join(figdir,"raw/data",fastgadir,fname)) as fd:
auc = float(fd.readlines()[0]) * -1
average.append(auc)
aucs[int(fastgadir.split("_")[0].split("=")[1])].append(average)
#print(np.shape(aucs))
for i in range(19):
print(str(i)+",",",".join(map(str,np.mean(aucs[i],1))))

View file

@ -0,0 +1,34 @@
#!/bin/bash
#run once each problem
echo "-------------------------Start the JOB : $(date --iso-8601=seconds)"
. /etc/profile.d/modules.sh
export MODULEPATH=${MODULEPATH}${MODULEPATH:+:}/opt/dev/Modules/Anaconda:/opt/dev/Modules/Compilers:/opt/dev/Modules/Frameworks:/opt/dev/Modules/Libraries:/opt/dev/Modules/Tools:/opt/dev/Modules/IDEs:/opt/dev/Modules/MPI
module load LLVM/clang-llvm-10.0
module load R
dir=$1
run=$2
budget_irace=$3
buckets=$4
myhome=$5
cp -r ${myhome}/R .
cp -r ${myhome}/irace_files_pA .
#cp -r /scratchbeta/zhenga/irace_files .
#chmod u+x ./fastga
outdir="${run}_$(date --iso-8601=seconds)_results_irace"
rundir=${dir}/${outdir}
mkdir -p ${rundir}
# Fore some reason, irace absolutely need those files...
cp ${myhome}/code/paradiseo/eo/contrib/irace/release/fastga ${rundir}
cat ./irace_files_pA/example.scen | sed "s%\".%\"${rundir}%g" | sed "s/maxExperiments = 0/maxExperiments=${budget_irace}/" > ${rundir}/example.scen
cp ./irace_files_pA/default.instances ${rundir}
cp ./irace_files_pA/fastga.param ${rundir}
cp ./irace_files_pA/forbidden.txt ${rundir}
cat ./irace_files_pA/target-runner | sed "s/buckets=0/buckets=${buckets}/" > ${rundir}/target-runner
chmod u+x ${rundir}/target-runner
echo "---start $(date)"
time -p ./R/x86_64-pc-linux-gnu-library/3.6/irace/bin/irace --scenario ${rundir}/example.scen > ${rundir}/irace.log
echo "---end $(date)"
echo "End the JOB : $(date --iso-8601=seconds)------------------------------"

View file

@ -0,0 +1,25 @@
#!/bin/bashi
myhome=$1
scratchpath=$2
mexp=$3
mevals=$4
date -Iseconds
echo "STARTS"
dir=${scratchpath}/dataFAR/dataA
#dir=${HOME}/plan4/${name}
#cat ${HOME}/irace_files_pA/example.scen |sed "s/maxExperiments = 0/maxExperiments = ${mexp}/" > ${HOME}/irace_files_pA/example.scen
mkdir -p ${dir}
outdir="${dir}/dataA_maxExp=${mexp}_maxEv=${mevals}_$(date --iso-8601=seconds)"
mkdir -p ${outdir}
for r in $(seq 2); do
echo "Run $r/15";
cmd="qsub -N iraceA_maxEv_${r} -q beta -l select=1:ncpus=1 -l walltime=00:25:00 -- ${scratchpath}/planA/r_iA.sh ${outdir} ${r} ${mexp} ${mevals} ${myhome}"
#cmd="bash ./r_iA_buckets.sh ${outdir} ${r} ${mexp} ${mevals}"
echo $cmd
time -p $cmd
done
echo "DONE"
#cat ${HOME}/irace_files_pA/example.scen |sed "s/maxExperiments = ${mexp}/maxExperiments = 0/" > ${HOME}/irace_files_pA/example.scen
date -Iseconds

View file

@ -0,0 +1,37 @@
#!/bin/bash
#run once each problem
dir=$1
run=$2
budget_irace=$3
buckets=$4
myhome=$5
echo "---------------start JOB ${run} $(date --iso-8601=seconds)"
. /etc/profile.d/modules.sh
export MODULEPATH=${MODULEPATH}${MODULEPATH:+:}/opt/dev/Modules/Anaconda:/opt/dev/Modules/Compilers:/opt/dev/Modules/Frameworks:/opt/dev/Modules/Libraries:/opt/dev/Modules/Tools:/opt/dev/Modules/IDEs:/opt/dev/Modules/MPI
module load LLVM/clang-llvm-10.0
module load R
cp -r ${myhome}/R .
cp -r ${myhome}/irace_files_pF .
#cp -r /scratchbeta/zhenga/irace_files .
#chmod u+x ./fastga
outdir="${run}_$(date --iso-8601=seconds)_results_irace"
for pb in $(seq 0 18) ; do
echo "Problem ${pb}... "
res="results_problem_${pb}"
mkdir -p ${dir}/${outdir}/${res}
# Fore some reason, irace absolutely need those files...
cp ${myhome}/code/paradiseo/eo/contrib/irace/release/fastga ${dir}/${outdir}/${res}
cat ./irace_files_pF/example.scen | sed "s%\".%\"${dir}/${outdir}/${res}%g" | sed "s/maxExperiments = 0/maxExperiments=${budget_irace}/" > ${dir}/${outdir}/${res}/example.scen
cp ./irace_files_pF/default.instances ${dir}/${outdir}/${res}
cp ./irace_files_pF/fastga.param ${dir}/${outdir}/${res}
cp ./irace_files_pF/forbidden.txt ${dir}/${outdir}/${res}
cat ./irace_files_pF/target-runner | sed "s/--problem=0/--problem=${p}/" | sed "s/buckets=0/buckets=${buckets}/" > ${dir}/${outdir}/${res}/target-runner
chmod u+x ${dir}/${outdir}/${res}/target-runner
echo "---start $(date)"
time -p ./R/x86_64-pc-linux-gnu-library/3.6/irace/bin/irace --scenario ${dir}/${outdir}/${res}/example.scen > ${dir}/${outdir}/${res}/irace.log
echo "---end $(date)"
done
echo "end JOB ${run} $(date --iso-8601=seconds)---------------"

View file

@ -0,0 +1,28 @@
#!/bin/bash
date -Iseconds
echo "STARTS"
myhome=$1
scratchpath=$2
#dir=${HOME}/plan2/${name}
mexp=$3 #budget irace
mevals=$4 #budget fastga
name="dataF_maxExp=${mexp}_maxEv=${mevals}_$(date --iso-8601=seconds)"
dir=${scratchpath}/dataFAR/dataF/${name}
mkdir -p ${dir}
for r in $(seq 2); do
echo "Run $r/15";
#date -Iseconds
#cmd="qsub -N irace_${runs}_${buckets}" -q beta -l select=1:ncpus=1 -l walltime=00:04:00 --${HOME}/run_irace.sh ${dir}
cmd="qsub -N iraceF_${mevals}_run=${r} -q beta -l select=1:ncpus=1 -l walltime=00:25:00 -- ${scratchpath}/planF/r_iF.sh ${dir} ${r} ${mexp} ${mevals} ${myhome}"
#time -p bash ${HOME}/plan2/run_irace2.sh ${dir} ${r} &> ${dir}/erreur_${r}.txt
#bash ${HOME}/test/r_i.sh
echo $cmd
$cmd
#date -Iseconds
done
#echo "DONE"
#date -Iseconds
#echo $(pwd)

View file

@ -0,0 +1,43 @@
#!/bin/bash
#run once each problem
. /etc/profile.d/modules.sh
export MODULEPATH=${MODULEPATH}${MODULEPATH:+:}/opt/dev/Modules/Anaconda:/opt/dev/Modules/Compilers:/opt/dev/Modules/Frameworks:/opt/dev/Modules/Libraries:/opt/dev/Modules/Tools:/opt/dev/Modules/IDEs:/opt/dev/Modules/MPI
module load LLVM/clang-llvm-10.0
module load R
dir=$1
run=$2
budget_irace=$3
buckets=$4
myhome=$5
cp -r ${myhome}/R .
cp -r ${myhome}/irace_files_pO .
outdir="${run}_$(date --iso-8601=seconds)_results_irace"
echo "start a job $(date -Iseconds)"
for pb in $(seq 0 18) ; do
echo "Problem ${pb}... "
res="results_problem_${pb}"
mkdir -p ${dir}/${outdir}/${res}
# Fore some reason, irace absolutely need those files...
cp ${myhome}/code/paradiseo/eo/contrib/irace/release/fastga ${dir}/${outdir}/${res}
cat ./irace_files_pO/example.scen | sed "s%\".%\"${dir}/${outdir}/${res}%g" | sed "s/maxExperiments = 0/maxExperiments=${budget_irace}/" > ${dir}/${outdir}/${res}/example.scen
cp ./irace_files_pO/default.instances ${dir}/${outdir}/${res}
cp ./irace_files_pO/fastga.param ${dir}/${outdir}/${res}
cat ./irace_files_pO/target-runner | sed "s/--problem=0/--problem=${pb}/" > ${dir}/${outdir}/${res}/target-runner
chmod u+x ${dir}/${outdir}/${res}/target-runner
echo "---start $(date)"
time -p ./R/x86_64-pc-linux-gnu-library/3.6/irace/bin/irace --scenario ${dir}/${outdir}/${res}/example.scen > ${dir}/${outdir}/${res}/irace.log
echo "---end $(date)"
echo "done run : ${run} pb : ${pb}"
date -Iseconds
done
echo "end a job $(date -Iseconds)---------------------"

View file

@ -0,0 +1,23 @@
#!/bin/bash
date -Iseconds
echo "STARTS"
myhome=$1
scratchpath=$2
mexp=$3
mevals=$4
name="dataO_maxExp=${mexp}_maxEv=${mevals}_$(date --iso-8601=seconds)"
dir=${scratchpath}/dataFAR/dataO/${name}
mkdir -p ${dir}
for r in $(seq 2); do
echo "Run $r/15";
cmd="qsub -N iraceO_maxExp=${exp}_maxEv=${evals}_${r} -q beta -l select=1:ncpus=1 -l walltime=00:10:00 -- ${scratchpath}/planO/r_iO.sh ${dir} ${r} ${mexp} ${mevals} ${myhome}"
echo $cmd
$cmd
#time (p=2; while [[ ${p} > 1 ]] ; do p=$(qqueue -u $USER | wc -l); echo "$r: $p"; sleep 300; done)
done
#echo "DONE"
#date -Iseconds

View file

@ -0,0 +1,167 @@
############################################
#Explanation of the experimental plans and the validation runs
############################################
1. INTRODUCTION
The aim of all the scripts is to make the experimental plans for Algorithm Configuration for Genetic Algorithms by using a fully modular benchmarking pipeline design of this article https://arxiv.org/abs/2102.06435 .
You can upload the data in : https://zenodo.org/record/5479538#.YTaT0Bnis2w
Plan A is an experimental plan for finding an efficient algorithm for all the functions that we consider.
Plan F is an experimental plan for finding an efficient algorithm for each function that we consider.
Plan R is an experimental plan for getting random algorithms.
Plan O is the reproduction of the experimental plan of the article.
2. VOCABULARIES
* maxExp : means maximum Experiments, the budget for irace
* maxEv : means maximum evaluation, the budget for FastGA algorithms
*dataFAR : directory which we store all the experiment data of Plan F and Plan A, created when you run run_exp.sh
* dataA, dataF
dataA is a directory which we store all the runs of an experiment plan for several budgets
eg : /dataA/planA_maxExp=*_maxEv=**_$(data), * is a value of maxExp, and ** is a value of maxEv
*fastga_results_all : directory which we store all the data for validation runs. It constains only 3 subdirectories (fastga_results_planF, fastga_results_planA, fastga_results_planO, fastga_results_random), created by running run_exp.sh
* fastga_results_planF, fastga_results_planA, fastga_results_random, fastga_results_planO
Each directory store the data for validation runs of each experiment plan.
fastga_random directory are created by running run_exp.sh
fastga_results_planF, fastag_results_planO and fastag_results_planA are created only after you have data in the dataA or dataF or dataO directories.
* planA_*, planF_*, planO_*
If the planA_* or planF_* or planO_* are in the dataFAR directory, the directory contains the data of experimental plan. This means that each plan contains the result of 15 runs of irace stored in irace.log file, and the data are provided by run_exp.sh.
If the planA_* or planF_* or planO_* directories are in the fastga_results_planA or fastga_results_planF, these directories contain the data of 50 validation runs by running all the best algorithms of each plan stores in dataFAR. The data are provided by running run_res.sh
*fastag_all_results : contains the directories of the validation run data.
*fastga_results_planF, fastga_results_planA and fastga_results_random contain respectively the validation run data of Plan F, Plan A and Plan R.
3. DESCRIPTION
The directory which you load all the scripts contains :
* bash files :
-run_res.sh : submit to the cluster all the experiment plan, get all the data we need for the plan F, plan A and plan R.
-run_exp.sh : submit to the cluster for getting all the data for validation runs of each data A and data F provided by running run_res.sh
-run_random.sh : script for getting random algorithms and the data for validation runs for each problem
-testrandom.sh : change the budget fastga (maxEv) in this file if you need, by running this file, you submit plan R job in the cluster
-csv_all_bests.sh : script for getting all the best configurations of each plan in a dataF or a dataA directories
-run_elites_planA.sh : script for validation runs of plan A by giving a csv file of each best configuration. This file is provided by running parseA_irace_bests.py.
-run_elites_planB.sh
-fastga_elites_all.sh : run this file, by giving a directory csv_plan* of csv files ( must only contains the csv file of the same plan, eg : csv_planF) and a run_elites_plan*.sh (* is the name of the plan, eg run_elites_planF.sh), by running this file you get all the validation runs of each csv file. Each csv file contains the best configuration (you get these csv files by running csv_all_bests.sh)
* python files :
-parseA_irace_bests.py : for parsing the irace.log file of each data provided by running irace. By giving a bounch of directories of one experiment
-parseF_irace_bests.py : for the plan plan F and plan O(in the plan O csv, there are label offspringsize and popsize, but there are not values)
* 6 directories :
-irace_files_pA :
-default.instances
-example.scen
-fastga.param
-forbidden.txt
-target-runner
-irace_files_pF :
-default.instances :
-example.scen
-fastga.param
-forbidden.txt
-target-runner
-irace_files_pO :
-default.instances :
-example.scen
-fastga.param
-target-runner
-planA :
-riaA.sh : for running 15 times r_iA.sh file by submitting to the mesu cluster
-r_iA.sh : for running irace for all the problems
-planF :
-riaF.sh : for running 15 times r_iF.sh file by submitting to the mesu cluster
-r_iF.sh : for running irace for each problem we considered
-planO :
-riaO.sh : for running 15 times r_iO.sh file by submitting to the mesu cluster
-r_iO.sh : for running irace for each problem we considered
The directories planA, planF contain the scripts to run one experiment of Plan A and Plan F.
The directories irace_files_pA, irace_files_pO and irace_files_pF contain the scripts needing for calling irace for one experiment of Plan A, Plan O and Plan F. [Look at the irace package : User Guide for more information]
5. CONCLUSION
For getting all the experiment data and the validation run data run run_exp.sh file first, after run_exp.sh file finished to execute and there is all the data in the dataFAR (ie : in the cluster, all the jobs finished to execute) run_res.sh data.
Warning : run_exp.sh may take few days or few weeks depending on the Budget you ask, do not run_res.sh if in dataFAR there are data which are not finished to execute in the cluster, or jobs killed. Do not forget to remove directories of plan which are not complete.
############################################
#Scripts for getting histograms and csv files of validation runs results.
############################################
get histograms or csv files for random data :
-hist_join_random.py : get one histogram for a plan by budget
-dist_op_random.py : get csv files of the distribution of operators by problems
get histograms or csv files for plan O,F,A :
-hist_join.py
-dist_op_all.py
-parse_auc_average # get the mean auc value of each problem and each irace run
get histograms for plan F, A , R, O
-hist_by_pb_budget_plan.py : get histograms by problem
-hist_by_FARO_pb.py :
-hist_by_FARO.py
-best_out_of_elites.py : get the best algorithm found among 15 runs of irace, for a plan
files to call all these files :
-csv_all.sh : get all the csv files (average of auc, best out ..), call best_out_of_elites.py, parse_auc_average.py, dist_op_*.py
-hist_all.sh : get all the histograms, call each hist_*.py file
file for other goal :
-mwtestU.py ; csv file for selected problems which irace algorithms gave better performances than random algorithms
-rep_std_mean_selected.py : to get the std, mean and the distribution of operators of the selected problems
############################################
#Summary
############################################
Get the experiment data :
run : bash run_exp.sh
-----------Only after you have the experiment data:
Get the validation run data :
run : bash run_res.sh
Get histograms :
run : bash hist_all.sh
Get csv files of validation run data :
run : bash csv_all.sh

View file

@ -0,0 +1,55 @@
#!/usr/bin/env python3
import sys
import os
import numpy as np
import matplotlib.pyplot as plt
import pandas
#eg : python3 ./rep_std_mean_selected.py ./hist_and_csv/distribution_op_fastga_results_planF
#get the std of the selected problem
path=sys.argv[1] # directory of each distribution by pb
lpb={13,14,15,16,18} #set of pb selected
#column : [operator : nbpossibilities]
distdir=path+"/rep_std_mean"
try:
os.makedirs(distdir)
except FileExistsError:
pass
res=[]
for csvfile in os.listdir(os.path.join(path)):
if(int(csvfile.split("_")[1].split("=")[1]) in lpb):
print(csvfile)
res.append(pandas.read_csv(os.path.join(path,csvfile)))
#assert(len(res[0])==len(res[1]) , "each csv file does not have the same line " #check if the number of param is eq in each csv file
name ="std_rep_pb={}".format(str(lpb))+"".join(map(str,path.split("/")[-3].split("_")[:3]))+".csv"
with open(os.path.join(distdir,name),'w+') as fd:
fd.write("Op index, "+",".join(map(str,range(0,11)))+"\n")
globalname="rep_all_pb={}".format(str(lpb))+"".join(map(str,path.split("/")[-3].split("_")[:3]))+".csv"
with open(os.path.join(distdir,globalname),'w+') as fd:
fd.write("Op index, "+",".join(map(str,range(0,11)))+"\n")
meanname="mean_rep_pb={}".format(str(lpb))+"".join(map(str,path.split("/")[-3].split("_")[:3]))+".csv"
with open(os.path.join(distdir,meanname),'w+') as fd:
fd.write("Op index, "+",".join(map(str,range(0,11)))+"\n")
#print(res)
limparam=[10,7,10,10,7,11,11,10,10]
for i in range(1,10): #9 nb parameters
npval=np.zeros((len(res),limparam[i-1]),dtype=int)
for pb in range(len(res)):
print(i,np.array(np.array(res[pb][i-1:i])[0]),np.array(np.array(res[pb][i-1:i])[0][1:limparam[i-1]+1]))
npval[pb,:]=np.array(np.array(res[pb][i-1:i])[0][1:limparam[i-1]+1],dtype=int)
nameparam=np.array(res[pb][i-1:i])[0][0]
line= ",".join(map(str,np.std(npval,0)))+",-"*(11-limparam[i-1])
print("ligne ",line)
with open(os.path.join(distdir,name),'a') as fd:
fd.write(nameparam+","+line+"\n")
line= ",".join(map(str,np.sum(npval,0)))+",-"*(11-limparam[i-1])
with open(os.path.join(distdir,globalname),'a') as fd:
fd.write(nameparam+","+line+"\n")
line= ",".join(map(str,np.mean(npval,0)))+",-"*(11-limparam[i-1])
with open(os.path.join(distdir,meanname),'a') as fd:
fd.write(nameparam+","+line+"\n")

View file

@ -0,0 +1,61 @@
#!/bin/bash
#instance = seed
echo "-----------------Start $(date)"
. /etc/profile.d/modules.sh
export MODULEPATH=${MODULEPATH}${MODULEPATH:+:}/opt/dev/Modules/Anaconda:/opt/dev/Modules/Compilers:/opt/dev/Modules/Frameworks:/opt/dev/Modules/Libraries:/opt/dev/Modules/Tools:/opt/dev/Modules/IDEs:/opt/dev/Modules/MPI
module load LLVM/clang-llvm-10.0
csv_file=$1 #contains all the configs of all the problems of one experiments
mexp=$2
mevals=$3
path=$4
# Number of runs (=seeds).
runs=50
# You most probably want to run on release builds.
exe="/home/zhenga/fastga"
plan=$(echo ${csv_file} | sed "s/results_irace_plan//")
outdir="${path}/plan4_maxExp=${mexp}_maxEv=${mevals}_$(date --iso-8601=minutes)_results_elites_all"
mkdir -p ${outdir}
mkdir -p ${outdir}/raw
mkdir -p ${outdir}/raw/data
mkdir -p ${outdir}/raw/logs
n=0
algoid=0
for line in $(cat ${csv_file}| sed 1,1d | cut -s -d"," -f3-11 ); do
a=($(echo $line | sed "s/,/ /g"))
algo="--crossover-rate=${a[0]} --cross-selector=${a[1]} --crossover=${a[2]} --mutation-rate=${a[3]} --mut-selector=${a[4]} --mutation=${a[5]} --replacement=${a[6]} --pop-size=${a[7]} --offspring-size=${a[8]}"
#perc=$(echo "scale=3;${n}/(285)*100.0" | bc)
#echo "${perc}% : algo ${algoid}/285"
# echo -n "Runs: "
for pb in $(seq 0 18) ; do
name_dir="pb=${pb}_$(echo "${algo}" | sed 's/--//g' | sed 's/ /_/g')"
mkdir -p ${outdir}/raw/data/${name_dir}
mkdir -p ${outdir}/raw/logs/${name_dir}
for seed in $(seq ${runs}) ; do # Iterates over runs/seeds.
# This is the command to be ran.
#cmd="${exe} --full-log=1 --problem=${pb} --seed=${seed} ${algo}"
cmd="${exe} --problem=${pb} --seed=${seed} --instance=${seed} ${algo}"
#echo ${cmd} # Print the command.
# Forge a directory/log file name
# (remove double dashs and replace spaces with underscore).
name_run="pb=${pb}_seed=${seed}_$(echo "${algo}" | sed 's/--//g' | sed 's/ /_/g')"
# echo $name_run
# Actually start the command.
${cmd} > "${outdir}/raw/data/${name_dir}/${name_run}.dat" 2> "${outdir}/raw/logs/${name_dir}/${name_run}.log"
# Check for the most common problem in the log file.
#cat "${outdir}/raw/logs/${name_run}.log" | grep "illogical performance"
done # seed
n=$(($n+1))
done
algoid=$(($algoid+1))
done
# Move IOH logs in the results directory.
#mv ./FastGA_* ${outdir}
echo "Done $(date) -----------------------"
#date

View file

@ -0,0 +1,59 @@
#!/bin/bash
#instance = seed
echo "-----------------Start $(date)"
. /etc/profile.d/modules.sh
export MODULEPATH=${MODULEPATH}${MODULEPATH:+:}/opt/dev/Modules/Anaconda:/opt/dev/Modules/Compilers:/opt/dev/Modules/Frameworks:/opt/dev/Modules/Libraries:/opt/dev/Modules/Tools:/opt/dev/Modules/IDEs:/opt/dev/Modules/MPI
module load LLVM/clang-llvm-10.0
csv_file=$1 #contains all the configs of all the problems of one experiments
mexp=$2
mevals=$3
path=$4
# Number of runs (=seeds).
runs=50
# You most probably want to run on release builds.
exe="/home/${USER}/fastga"
plan=$(echo ${csv_file} | cut -d / -f3 | sed "s/results_irace_plan//")
outdir="${path}/plan${plan[@]:0:1}_maxExp=${mexp}_maxEv=${mevals}_$(date --iso-8601=minutes)_results_elites_all"
mkdir -p ${outdir}
mkdir -p ${outdir}/raw
mkdir -p ${outdir}/raw/data
mkdir -p ${outdir}/raw/logs
n=0
algoid=0
for line in $(cat ${csv_file}| sed 1,1d ); do
a=($(echo $line | sed "s/,/ /g"))
algo="--crossover-rate=${a[3]} --cross-selector=${a[4]} --crossover=${a[5]} --mutation-rate=${a[6]} --mut-selector=${a[7]} --mutation=${a[8]} --replacement=${a[9]} --pop-size=${a[10]} --offspring-size=${a[11]}"
#perc=$(echo "scale=3;${n}/(285)*100.0" | bc)
#echo "${perc}% : algo ${algoid}/285"
# echo -n "Runs: "
name_dir="pb=${a[0]}_$(echo "${algo}" | sed 's/--//g' | sed 's/ /_/g')"
mkdir -p ${outdir}/raw/logs/${name_dir}
mkdir -p ${outdir}/raw/data/${name_dir}
for seed in $(seq ${runs}) ; do # Iterates over runs/seeds.
# This is the command to be ran.
#cmd="${exe} --full-log=1 --problem=${pb} --seed=${seed} ${algo}"
cmd="${exe} --problem=${a[0]} --seed=${seed} --instance=${seed} ${algo}"
#echo ${cmd} # Print the command.
# Forge a directory/log file name
# (remove double dashs and replace spaces with underscore).
name_run="pb=${a[0]}_seed=${seed}_$(echo "${algo}" | sed 's/--//g' | sed 's/ /_/g')"
# echo $name_run
# Actually start the command.
${cmd} > "${outdir}/raw/data/${name_dir}/${name_run}.dat" 2> "${outdir}/raw/logs/${name_dir}/${name_run}.log"
# Check for the most common problem in the log file.
#cat "${outdir}/raw/logs/${name_run}.log" | grep "illogical performance"
done # seed
n=$(($n+1))
algoid=$(($algoid+1))
done
# Move IOH logs in the results directory.
#mv ./FastGA_* ${outdir}
echo "Done $(date) -----------------------"
#date

View file

@ -0,0 +1,64 @@
#!/bin/bash
#instance = seed
. /etc/profile.d/modules.sh
export MODULEPATH=${MODULEPATH}${MODULEPATH:+:}/opt/dev/Modules/Anaconda:/opt/dev/Modules/Compilers:/opt/dev/Modules/Frameworks:/opt/dev/Modules/Libraries:/opt/dev/Modules/Tools:/opt/dev/Modules/IDEs:/opt/dev/Modules/MPI
module load LLVM/clang-llvm-10.0
csv_file=$1 #contains all the configs of all the problems of one experiments
mexp=$2
mevals=$3
path=$4
echo "-----------------Start $(date -Iseconds) "
# Number of runs (=seeds).
runs=50
# You most probably want to run on release builds.
exe="/home/${USER}/fastga"
outdir="${path}/planO_maxExp=${mexp}_maxEv=${mevals}_$(date --iso-8601=minutes)_results_elites_all"
mkdir -p ${outdir}
mkdir -p ${outdir}/raw
mkdir -p ${outdir}/raw/data
mkdir -p ${outdir}/raw/logs
n=0
algoid=0
for line in $(cat ${csv_file}| sed 1,1d ); do
a=($(echo $line | sed "s/,/ /g"))
algo="--crossover-rate=${a[3]} --cross-selector=${a[4]} --crossover=${a[5]} --mutation-rate=${a[6]} --mut-selector=${a[7]} --mutation=${a[8]} --replacement=${a[9]}"
#perc=$(echo "scale=3;${n}/(285)*100.0" | bc)
#echo "${perc}% : algo ${algoid}/285"
# echo -n "Runs: "
name_dir="pb=${a[0]}_$(echo "${algo}" | sed 's/--//g' | sed 's/ /_/g')"
mkdir -p ${outdir}/raw/data/${name_dir}
mkdir -p ${outdir}/raw/logs/${name_dir}
for seed in $(seq ${runs}) ; do # Iterates over runs/seeds.
# This is the command to be ran.
#cmd="${exe} --full-log=1 --problem=${pb} --seed=${seed} ${algo}"
cmd="${exe} --problem=${a[0]} --seed=${seed} --instance=${seed} ${algo}"
#echo ${cmd} # Print the command.
# Forge a directory/log file name
# (remove double dashs and replace spaces with underscore).
name_run="pb=${a[0]}_seed=${seed}_$(echo "${algo}" | sed 's/--//g' | sed 's/ /_/g')"
# echo $name_run
# Actually start the command.
${cmd} > "${outdir}/raw/data/${name_dir}/${name_run}.dat" 2> "${outdir}/raw/logs/${name_dir}/${name_run}.log"
# Check for the most common problem in the log file.
#cat "${outdir}/raw/logs/${name_run}.log" | grep "illogical performance"
done # seed
n=$(($n+1))
algoid=$(($algoid+1))
done
# Move IOH logs in the results directory.
#mv ./FastGA_* ${outdir}
echo "Done $(date) -----------------------"
date

View file

@ -0,0 +1,13 @@
#!/bin/bash
lexp=(300 600)
levals=(100 500)
myscratchpath=/scratchbeta/$USER
myhome=${HOME}
for exp in ${lexp[@]} ; do
for evals in ${levals[@]} ; do
bash ./planF/riaF.sh ${myhome} ${myscratchpath} ${exp} ${evals}
bash ./planO/riaO.sh ${myhome} ${myscratchpath} ${exp} ${evals}
bash ./planA/riaA.sh ${myhome} ${myscratchpath} ${exp} ${evals}
done
done
bash testrandom.sh ${myhome} ${scratchpath} ${levals[@]}

View file

@ -0,0 +1,67 @@
#!/bin/bash
# Number of runs (=seeds).
runs=5
basename=$1
mevals=$2
nbAlgo=2
echo "Start JOB maxEv= $mevals $(date -Iseconds) ----------------------"
. /etc/profile.d/modules.sh
export MODULEPATH=${MODULEPATH}${MODULEPATH:+:}/opt/dev/Modules/Anaconda:/opt/dev/Modules/Compilers:/opt/dev/Modules/Frameworks:/opt/dev/Modules/Libraries:/opt/dev/Modules/Tools:/opt/dev/Modules/IDEs:/opt/dev/Modules/MPI
module load LLVM/clang-llvm-10.0
cp ${HOME}/code/paradiseo/eo/contrib/irace/release/fastga .
# You most probably want to run on release builds.
exe="./fastga"
#outdir="/scratchbeta/$USER/$(date --iso-8601=minutes)_results_randoms"
outdir="${basename}/maxEv=${mevals}_nbAlgo=${nbAlgo}_$(date --iso-8601=minutes)_results_randoms"
mkdir -p ${outdir}
n=1
algoid=0
for algoid in $(seq ${nbAlgo}); do
#date
r1=$(echo "scale=2 ; ${RANDOM}/32767" | bc)
r2=$(echo "scale=2 ; ${RANDOM}/32767" | bc)
a=(${r1} $((RANDOM%7)) $((RANDOM%10)) ${r2} $((RANDOM%7)) $((RANDOM%11)) $((RANDOM%11)) $((RANDOM%50 +1)) $((RANDOM%50 +1)) )
#condition for value of replacement, pop-size and offspringsize
while [[ (1 -lt ${a[6]} && ${a[7]} -lt ${a[8]}) || ( ${a[6]} -eq 1 && ${a[7]} -ne ${a[8]}) ]]
do
#echo "get in ------------------replacement ${a[6]} popsize ${a[7]} offspringsize ${a[8]}"
r1=$(echo "scale=2 ; ${RANDOM}/32767" | bc)
r2=$(echo "scale=2 ; ${RANDOM}/32767" | bc)
a=(${r1} $((RANDOM%7)) $((RANDOM%10)) ${r2} $((RANDOM%7)) $((RANDOM%11)) $((RANDOM%11)) $((RANDOM%50 +1)) $((RANDOM%50 +1)))
done
algo="--crossover-rate=${a[0]} --cross-selector=${a[1]} --crossover=${a[2]} --mutation-rate=${a[3]} --mut-selector=${a[4]} --mutation=${a[5]} --replacement=${a[6]} --pop-size=${a[7]} --offspring-size=${a[8]}"
echo " start algo ${a}------ $(date --iso-8601=minutes)"
algodir="$(echo "${algo}" | sed 's/--//g' | sed 's/ /_/g')"
for pb in $(seq 0 18) ; do
perc=$(echo "scale=3;${n}/(10*18)*10.0" | bc)
#echo "${perc}% : algo ${algoid}/100, problem ${pb}/18 $(date --iso-8601=minutes)"
# echo -n "Runs: "
name_dir="pb=${pb}_$(echo "${algo}" | sed 's/--//g' | sed 's/ /_/g')"
mkdir -p ${outdir}/${algodir}/data/${name_dir}
mkdir -p ${outdir}/${algodir}/logs/${name_dir}
for seed in $(seq ${runs}) ; do # Iterates over runs/seeds.
# This is the command to be ran.
cmd="${exe} --problem=${pb} --seed=${seed} --instance=${seed} ${algo} --max-evals=${mevals}"
name_run="pb=${pb}_seed=${seed}_$(echo "${algo}" | sed 's/--//g' | sed 's/ /_/g')"
# echo $name_run
#echo $algo
${cmd} > ${outdir}/${algodir}/data/${name_dir}/${name_run}.dat 2> ${outdir}/${algodir}/logs/${name_dir}/${name_run}.log
# Check for the most common problem in the log file.
#cat "${outdir}/raw/logs/${name_run}.log" | grep "illogical performance"
done # seed
# echo ""
n=$(($n+1))
done # pb
echo "end algo $(date -Iseconds) "
algoid=$(($algoid+1))
done
echo "------------------------------------Done $mevals $(date -Iseconds) "

View file

@ -0,0 +1,26 @@
#!/bin/bash
#get csv file, parse dataF in a csv file
dir=/scratchbeta/$USER/dataFAR
listdir=$(echo $(ls ${dir}))
for data in ${listdir[@]} ; do
file_py="parse${data: -1}_irace_bests.py"
path="${dir}/${data}"
cmd="bash ./csv_all_bests.sh ${path} ${file_py}"
echo $cmd
$cmd
done
#get validation run of each config
dir=/scratchbeta/$USER/csv_FAO
listdir=$(echo $(ls ${dir}))
echo ${listdir[@]}
for csvdir in ${listdir[@]} ; do
csvpath="${dir}/${csvdir}"
file_py="./run_elites_plan${csvdir: -1}.sh"
cmd="bash ./fastga_elites_all.sh ${csvpath} ${file_py}"
echo $cmd
$cmd
done

View file

@ -0,0 +1,18 @@
#!/bin/bash
#tab=(15000 20000 30000 40000)
#tab=(100 500 1000 1500 2000 2500 3000 3500 4000 4500 5000 10000)
myhome=$1
scratchpath=$2
tab=${@:3}
#echo ${tab[@]}
outdir="/scratchbeta/$USER/fastga_results_all/fastga_results_random"
mkdir -p ${outdir} #results of random experiment
for evals in ${tab[@]}; do
#evalsdir="${name}/maxEv=${evals}"
#mkdir -p ${evalsdir}
#{ time -p bash /home/$USER/run_random.sh ${name} ${i} 50 ; } &> "${name}/sortie5_${j}_maxExp=${i}.txt"
#cmd="qsub -N iraceR_maxEv=${evals} -q beta -l select=1:ncpus=1 -l walltime=00:30:00 -- /scratchbeta/$USER/run_random.sh ${outdir} ${evals}"
$cmd
done

View file

@ -0,0 +1,119 @@
#!/usr/bin/python
###############################################################################
# This script is the command that is executed every run.
# Check the examples in examples/
#
# This script is run in the execution directory (execDir, --exec-dir).
#
# PARAMETERS:
# argv[1] is the candidate configuration ID
# argv[2] is the instance ID
# argv[3] is the seed
# argv[4] is the instance name
# The rest (argv[5:]) are parameters to the run
#
# RETURN VALUE:
# This script should print one numerical value: the cost that must be minimized.
# Exit with 0 if no error, with 1 in case of error
###############################################################################
import datetime
import os.path
import re
import subprocess
import sys
exe = "../../../../release/onlymutga"
problem = 19
pop_size = 1
offspring_size = 100
fixed_parameters = ["--problem", str(problem), "--crossover-rate", "0", "--mutation-rate", "1", "--pop-size", str(pop_size), " --offspring-size", str(offspring_size)]
if __name__=='__main__':
if len(sys.argv) < 5:
print("\nUsage: ./target-runner.py <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

@ -0,0 +1,267 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "04867792",
"metadata": {},
"source": [
"# Imports"
]
},
{
"cell_type": "code",
"execution_count": 18,
"id": "435212a6",
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
"import numpy as np\n",
"import seaborn as sb\n",
"import matplotlib.pyplot as plt\n",
"from matplotlib.ticker import MaxNLocator\n",
"import matplotlib.animation\n",
"from math import sqrt, log, cos, sin, pi\n",
"import numpy as np\n",
"import os\n",
"import shutil\n",
"import re\n",
"from subprocess import call\n",
"sb.set_style(\"whitegrid\")\n",
"#sb.set_palette(\"cubehelix\")\n",
"sb.set_palette(\"husl\")\n",
"sb.set(font_scale=1) # crazy big\n",
"sb.set_style('whitegrid', {'legend.frameon':True})\n",
"myfontsize = 12\n",
"titlesize = 15\n",
"%matplotlib notebook"
]
},
{
"cell_type": "markdown",
"id": "d76bdf6b",
"metadata": {},
"source": [
"# Function to generate the scenario file for irace"
]
},
{
"cell_type": "code",
"execution_count": 19,
"id": "d86a9ca8",
"metadata": {},
"outputs": [],
"source": [
"def scenario(filename=\"scenario.txt\", \n",
" parameterFile=\"parameters.txt\", \n",
" execDir=\".\", \n",
" logFile=\"./irace.Rdata\", \n",
" targetRunner = \"target-runner.py\", \n",
" maxExperiments = 100000,\n",
" digits = 2):\n",
" f = open(filename, \"w\")\n",
" f.write(\"parameterFile=\" + parameterFile +\"\\n\")\n",
" f.write(\"execDir=\" + execDir + \"\\n\")\n",
" f.write(\"logFile=\" + logFile + \"\\n\")\n",
" f.write(\"targetRunner=\" + targetRunner + \"\\n\")\n",
" f.write(\"maxExperiments=\" + maxExperiments + \"\\n\")\n",
" f.write(\"digits=\" + digits + \"\\n\")\n",
" f.close()"
]
},
{
"cell_type": "markdown",
"id": "1213321a",
"metadata": {},
"source": [
"# Function to generate the parameter file for irace"
]
},
{
"cell_type": "code",
"execution_count": 20,
"id": "70d221c9",
"metadata": {},
"outputs": [],
"source": [
"# Generate the param file for irace with all configuarable parameters\n",
"def parameters(filename=\"parameters.txt\"):\n",
" f = open(\"parameters.txt\", \"w\")\n",
" f.write(\"# name\\tswitch\\ttype\\tvalues\\n\") # head of the param file\n",
" cl_nb_part = 10 # number of category for the custom categorial probabilistic law\n",
" for i in range(cl_nb_part-1): # minus 1 slice than the number of categories\n",
" f.write(\"slice_prob_%s\\t\\\"\\\"\\tr\\t(0,1)\\n\"%i) # percentage of the residual probability for the slice\n",
"\n",
" ######################################### NOT USED YET ##########################################\n",
" #for i in range(cl_nb_part-1): # minus 1 slice than the number of categories\n",
" # f.write(\"slice_size_%s\\t\\\"\\\"\\tr\\t(0,1)\\n\"%i) # percentage of the residual size for the slice\n",
" #################################################################################################\n",
" f.close()"
]
},
{
"cell_type": "markdown",
"id": "65fcb69d",
"metadata": {},
"source": [
"# Fonction to generate problem dedicated target-runner.py"
]
},
{
"cell_type": "code",
"execution_count": 21,
"id": "a18ba251",
"metadata": {},
"outputs": [],
"source": [
"def target_runner(origin=\"irace-config/target-runner.py\", path=\"target-runner.py\", problem=1):\n",
" \n",
" generalTR = open(origin, \"r\")\n",
" dedicatedTR = open(path, \"w\")\n",
" for line in generalTR:\n",
" if re.search(\"problem = \", line, flags=0):\n",
" dedicatedTR.write(\"problem = \" + str(problem) + \"\\n\")\n",
" else:\n",
" dedicatedTR.write(line)\n",
" generalTR.close()\n",
" dedicatedTR.close()"
]
},
{
"cell_type": "markdown",
"id": "59421dee",
"metadata": {},
"source": [
"# Run script"
]
},
{
"cell_type": "code",
"execution_count": 28,
"id": "38dfec96",
"metadata": {},
"outputs": [],
"source": [
"results_directory = \"results\"\n",
"irace_path = \"/Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/irace/bin/irace\"\n",
"instances_file = \"instances.txt\"\n",
"scenario_file = \"scenario.txt\"\n",
"parameters_file = \"parameters.txt\"\n",
"target_runner_file = \"target-runner.py\"\n",
"\n",
"# create or clear the results directory\n",
"if not os.path.isdir(results_directory):\n",
" os.mkdir(results_directory)\n",
" \n",
"for pb in range(1,3): # for each problem\n",
" # create or clear a subdirectory for the problem\n",
" problem_directory = results_directory + \"/problem_%s\"%pb\n",
" if os.path.isdir(problem_directory):\n",
" shutil.rmtree(problem_directory)\n",
" os.mkdir(problem_directory)\n",
" \n",
" # generate a custom target runner file for the problem\n",
" target_runner(path = problem_directory + \"/\" + target_runner_file, problem = pb)\n",
"\n",
" # copy the config files for iraces\n",
" for filename in [instances_file, scenario_file, parameters_file, target_runner_file]:\n",
" src = r'irace-config/' + filename\n",
" dst = problem_directory + \"/\" + filename\n",
" shutil.copyfile(src, dst)\n",
" \n",
" # run irace for\n",
" cmd = [irace_path, \"--scenario\", problem_directory + \"/\" + scenario_file] #, \"&> irace.log\"\n",
" call(cmd)\n",
"#call(cmd)\n"
]
},
{
"cell_type": "code",
"execution_count": 59,
"id": "b707ff3b",
"metadata": {},
"outputs": [],
"source": [
"shutil.rmtree(\"results\")"
]
},
{
"cell_type": "code",
"execution_count": 25,
"id": "460c588e",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"-10"
]
},
"execution_count": 25,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"call([\"../../release/onlymutga\"])"
]
},
{
"cell_type": "code",
"execution_count": 43,
"id": "eb234425",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'problem_1/default.instances'"
]
},
"execution_count": 43,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import shutil\n",
"import os\n",
"src = r'irace-config/default.instances'\n",
"dst = r'problem_1/default.instances'\n",
"shutil.copyfile(src, dst)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "7a62c411",
"metadata": {},
"outputs": [],
"source": [
"chmod u+x script.py\n",
"cp -a a b"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.8"
}
},
"nbformat": 4,
"nbformat_minor": 5
}

View file

@ -0,0 +1,12 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Dec 14 12:16:17 2021
@author: labeiros
"""
import sys
print('Number of arguments:', len(sys.argv), 'arguments.')
print('Argument List:', str(sys.argv))

View file

@ -0,0 +1,119 @@
#!/usr/bin/python
###############################################################################
# This script is the command that is executed every run.
# Check the examples in examples/
#
# This script is run in the execution directory (execDir, --exec-dir).
#
# PARAMETERS:
# argv[1] is the candidate configuration ID
# argv[2] is the instance ID
# argv[3] is the seed
# argv[4] is the instance name
# The rest (argv[5:]) are parameters to the run
#
# RETURN VALUE:
# This script should print one numerical value: the cost that must be minimized.
# Exit with 0 if no error, with 1 in case of error
###############################################################################
import datetime
import os.path
import re
import subprocess
import sys
exe = "../../../../release/onlymutga"
problem = blabla
pop_size = 1
offspring_size = 100
fixed_parameters = ["--problem", str(problem), "--crossover-rate", "0", "--mutation-rate", "1", "--pop-size", str(pop_size), " --offspring-size", str(offspring_size)]
if __name__=='__main__':
if len(sys.argv) < 5:
print("\nUsage: ./target-runner.py <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,33 +1,43 @@
#include <filesystem>
#include <iostream> #include <iostream>
#include <cstdlib> #include <cstdlib>
#include <string> #include <string>
#include <memory>
#include <eo> #include <eo>
#include <ga.h> #include <ga.h>
#include <utils/checkpointing> #include <utils/checkpointing>
#include <eoInt.h> #include <eoInt.h>
#include <problems/eval/eoEvalIOH.h> #include <problems/eval/eoEvalIOH.h>
#include <IOHprofiler_ecdf_logger.h> #include <ioh.hpp>
#include <f_w_model_one_max.hpp>
/*****************************************************************************
* ParadisEO algorithmic grammar definition.
*****************************************************************************/
// using Particle = eoRealParticle<eoMaximizingFitness>;
using Ints = eoInt<eoMaximizingFitnessT<int>, size_t>;
using Bits = eoBit<eoMaximizingFitnessT<int>, int>; using Bits = eoBit<eoMaximizingFitnessT<int>, int>;
// by enumerating candidate operators and their parameters. // by enumerating candidate operators and their parameters.
eoAlgoFoundryFastGA<Bits>& make_foundry( eoAlgoFoundryFastGA<Bits>& make_foundry(
eoFunctorStore& store, eoFunctorStore& store,
eoInit<Bits>& init, eoInit<Bits>& init,
eoEvalFunc<Bits>& eval_onemax, eoEvalFunc<Bits>& eval,
const size_t max_evals, const size_t max_evals,
const size_t generations const size_t generations,
const double optimum
) )
{ {
// FIXME using max_restarts>1 does not allow to honor max evals. // FIXME using max_restarts>1 does not allow to honor max evals.
auto& foundry = store.pack< eoAlgoFoundryFastGA<Bits> >(init, eval_onemax, max_evals, /*max_restarts=*/1); auto& foundry = store.pack< eoAlgoFoundryFastGA<Bits> >(init, eval, max_evals, /*max_restarts=*/1);
/***** Continuators ****/ /***** Continuators ****/
foundry.continuators.add< eoGenContinue<Bits> >(generations); 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++) { // for(size_t i=1; i<10; i++) {
// foundry.continuators.add< eoGenContinue<Bits> >(i); // foundry.continuators.add< eoGenContinue<Bits> >(i);
// } // }
@ -35,17 +45,17 @@ eoAlgoFoundryFastGA<Bits>& make_foundry(
// foundry.continuators.add< eoSteadyFitContinue<Bits> >(10,i); // foundry.continuators.add< eoSteadyFitContinue<Bits> >(10,i);
// } // }
for(double i=0.0; i<1.0; i+=0.2) { // for(double i=0.0; i<1.0; i+=0.2) {
foundry.crossover_rates.add<double>(i); // foundry.crossover_rates.add<double>(i);
foundry.mutation_rates.add<double>(i); // foundry.mutation_rates.add<double>(i);
} // }
/***** Offsprings size *****/ /***** Offsprings size *****/
// for(size_t i=5; i<100; i+=10) { // for(size_t i=5; i<100; i+=10) {
// foundry.offspring_sizes.add<size_t>(i); // foundry.offspring_sizes.add<size_t>(i);
// } // }
foundry.offspring_sizes.add<size_t>(0); // 0 = use parents fixed pop size. foundry.offspring_sizes.setup(0,100); // 0 = use parents fixed pop size.
/***** Crossovers ****/ /***** Crossovers ****/
for(double i=0.1; i<1.0; i+=0.2) { for(double i=0.1; i<1.0; i+=0.2) {
@ -55,18 +65,25 @@ eoAlgoFoundryFastGA<Bits>& make_foundry(
foundry.crossovers.add< eoNPtsBitXover<Bits> >(i); // nb of points foundry.crossovers.add< eoNPtsBitXover<Bits> >(i); // nb of points
} }
foundry.crossovers.add< eo1PtBitXover<Bits> >(); // foundry.crossovers.add< eo1PtBitXover<Bits> >(); // Same as NPts=1
/***** Mutations ****/ /***** Mutations ****/
double p = 1.0; // Probability of flipping eath bit. double p = 1.0; // Probability of flipping each bit.
foundry.mutations.add< eoUniformBitMutation<Bits> >(p); // proba of flipping k bits, k drawn in uniform distrib // proba of flipping k bits, k drawn in uniform distrib
foundry.mutations.add< eoStandardBitMutation<Bits> >(p); // proba of flipping k bits, k drawn in binomial distrib foundry.mutations.add< eoUniformBitMutation<Bits> >(p);
foundry.mutations.add< eoConditionalBitMutation<Bits> >(p); // proba of flipping k bits, k drawn in binomial distrib, minus zero // proba of flipping k bits, k drawn in binomial distrib
foundry.mutations.add< eoShiftedBitMutation<Bits> >(p); // proba of flipping k bits, k drawn in binomial distrib, changing zeros to one foundry.mutations.add< eoStandardBitMutation<Bits> >(p);
foundry.mutations.add< eoNormalBitMutation<Bits> >(p); // proba of flipping k bits, k drawn in normal distrib // proba of flipping k bits, k drawn in binomial distrib, minus zero
foundry.mutations.add< eoFastBitMutation<Bits> >(p); // proba of flipping k bits, k drawn in powerlaw distrib 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) { for(size_t i=1; i < 11; i+=2) {
foundry.mutations.add< eoDetSingleBitFlip<Bits> >(i); // mutate k bits without duplicates // mutate k bits without duplicates
foundry.mutations.add< eoDetSingleBitFlip<Bits> >(i);
} }
/***** Selectors *****/ /***** Selectors *****/
@ -100,9 +117,13 @@ eoAlgoFoundryFastGA<Bits>& make_foundry(
return foundry; return foundry;
} }
/*****************************************************************************
* irace helper functions.
*****************************************************************************/
Bits::Fitness fake_func(const Bits&) { return 0; } Bits::Fitness fake_func(const Bits&) { return 0; }
void print_param_range(const eoParam& param, const size_t slot_size, std::ostream& out = std::cout) void print_irace_categorical(const eoParam& param, const size_t slot_size, std::string type="c", std::ostream& out = std::cout)
{ {
// If there is no choice to be made on this operator, comment it out. // If there is no choice to be made on this operator, comment it out.
if(slot_size - 1 <= 0) { if(slot_size - 1 <= 0) {
@ -115,37 +136,230 @@ void print_param_range(const eoParam& param, const size_t slot_size, std::ostrea
out << irace_name out << irace_name
<< "\t\"--" << param.longName() << "=\"" << "\t\"--" << param.longName() << "=\""
<< "\ti"; << "\t" << type;
if(slot_size -1 <= 0) { out << "\t(0";
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 { } else {
out << "\t(0," << slot_size-1 << ")"; out << "\t(" << min << "," << max << ")";
} }
out << std::endl; 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[]) int main(int argc, char* argv[])
{ {
/***** Global parameters. *****/ /***** Global parameters. *****/
enum { NO_ERROR = 0, ERROR_USAGE = 100 }; 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 }}
};
eoFunctorStore store; eoFunctorStore store;
eoParser parser(argc, argv, "FastGA interface for iRace"); eoParser parser(argc, argv, "FastGA interface for iRace");
const size_t dimension = parser.getORcreateParam<size_t>(1000, /***** Problem parameters *****/
"dimension", "Dimension size", auto problem_p = parser.getORcreateParam<size_t>(0,
'd', "Problem").value(); "problem", "Problem ID",
'p', "Problem", /*required=*/true);
const size_t problem = problem_p.value();
assert(problem < benchmark.size());
const size_t max_evals = parser.getORcreateParam<size_t>(2 * dimension, // const size_t dimension = parser.getORcreateParam<size_t>(1000,
"max-evals", "Maximum number of evaluations", // "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(); 'e', "Stopping criterion").value();
const size_t buckets = parser.getORcreateParam<size_t>(100, const size_t buckets = parser.getORcreateParam<size_t>(100,
"buckets", "Number of buckets for discretizing the ECDF", "buckets", "Number of buckets for discretizing the ECDF",
'b', "Performance estimation").value(); 'b', "Performance estimation").value();
/***** Generic options *****/
uint32_t seed = uint32_t seed =
parser.getORcreateParam<uint32_t>(0, parser.getORcreateParam<uint32_t>(0,
"seed", "Random number seed (0 = epoch)", "seed", "Random number seed (0 = epoch)",
@ -156,33 +370,52 @@ int main(int argc, char* argv[])
// rng is a global // rng is a global
rng.reseed(seed); 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();
auto problem_p = parser.getORcreateParam<size_t>(0, bool output_mat =
"problem", "Problem ID", parser.getORcreateParam<bool>(0,
'p', "Problem", /*required=*/true); "output-mat", "Output the aggregated attainment matrix instead of its scalar sum (fancy colormap on stderr, parsable CSV on stdout).",
const size_t problem = problem_p.value(); 'A').value();
/***** populations sizes *****/
auto pop_size_p = parser.getORcreateParam<size_t>(1, auto pop_size_p = parser.getORcreateParam<size_t>(5,
"pop-size", "Population size", "pop-size", "Population size",
'P', "Operator Choice", /*required=*/false); 'P', "Operator Choice", /*required=*/false);
const size_t pop_size = pop_size_p.value(); const size_t pop_size = pop_size_p.value();
const size_t pop_size_max = 200;
auto instance_p = parser.getORcreateParam<size_t>(0, auto offspring_size_p = parser.getORcreateParam<size_t>(0,
"instance", "Instance ID", "offspring-size", "Offsprings size (0 = same size than the parents pop, see --pop-size)",
'i', "Instance", /*required=*/false); 'O', "Operator Choice", /*required=*/false); // Single alternative, not required.
const size_t instance = instance_p.value(); 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.5,
"crossover-rate", "",
'C', "Operator Choice", /*required=*/true);
const double crossover_rate = crossover_rate_p.value();
auto mutation_rate_p = parser.getORcreateParam<double>(0,
"mutation-rate", "",
'M', "Operator Choice", /*required=*/true);
const double mutation_rate = mutation_rate_p.value();
/***** operators *****/
auto continuator_p = parser.getORcreateParam<size_t>(0, auto continuator_p = parser.getORcreateParam<size_t>(0,
"continuator", "Stopping criterion", "continuator", "Stopping criterion",
'o', "Operator Choice", /*required=*/false); // Single alternative, not required. 'o', "Operator Choice", /*required=*/false); // Single alternative, not required.
const size_t continuator = continuator_p.value(); const size_t continuator = continuator_p.value();
auto crossover_rate_p = parser.getORcreateParam<size_t>(0,
"crossover-rate", "",
'C', "Operator Choice", /*required=*/true);
const size_t crossover_rate = crossover_rate_p.value();
auto crossover_selector_p = parser.getORcreateParam<size_t>(0, auto crossover_selector_p = parser.getORcreateParam<size_t>(0,
"cross-selector", "How to selects candidates for cross-over", "cross-selector", "How to selects candidates for cross-over",
's', "Operator Choice", /*required=*/true); 's', "Operator Choice", /*required=*/true);
@ -198,11 +431,6 @@ int main(int argc, char* argv[])
'a', "Operator Choice", /*required=*/false); // Single alternative, not required. 'a', "Operator Choice", /*required=*/false); // Single alternative, not required.
const size_t aftercross_selector = aftercross_selector_p.value(); const size_t aftercross_selector = aftercross_selector_p.value();
auto mutation_rate_p = parser.getORcreateParam<size_t>(0,
"mutation-rate", "",
'M', "Operator Choice", /*required=*/true);
const size_t mutation_rate = mutation_rate_p.value();
auto mutation_selector_p = parser.getORcreateParam<size_t>(0, auto mutation_selector_p = parser.getORcreateParam<size_t>(0,
"mut-selector", "How to selects candidate for mutation", "mut-selector", "How to selects candidate for mutation",
'u', "Operator Choice", /*required=*/true); 'u', "Operator Choice", /*required=*/true);
@ -218,12 +446,6 @@ int main(int argc, char* argv[])
'r', "Operator Choice", /*required=*/true); 'r', "Operator Choice", /*required=*/true);
const size_t replacement = replacement_p.value(); const size_t replacement = replacement_p.value();
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();
// Help + Verbose routines // Help + Verbose routines
make_verbose(parser); make_verbose(parser);
make_help(parser, /*exit_after*/false, std::clog); make_help(parser, /*exit_after*/false, std::clog);
@ -235,36 +457,56 @@ int main(int argc, char* argv[])
eoEvalFuncPtr<Bits> fake_eval(fake_func); eoEvalFuncPtr<Bits> fake_eval(fake_func);
eoUniformGenerator<int> fake_gen(0, 1); eoUniformGenerator<int> fake_gen(0, 1);
eoInitFixedLength<Bits> fake_init(/*bitstring size=*/1, fake_gen); eoInitFixedLength<Bits> fake_init(/*bitstring size=*/1, fake_gen);
auto fake_foundry = make_foundry(store, fake_init, fake_eval, max_evals, /*generations=*/ 1); auto fake_foundry = make_foundry(store, fake_init, fake_eval, max_evals, /*generations=*/ 1, 0);
std::clog << std::endl << "Available operators:" << std::endl;
print_operators( continuator_p, fake_foundry.continuators , std::clog);
print_operators( crossover_rate_p, fake_foundry.crossover_rates , std::clog);
print_operators( crossover_selector_p, fake_foundry.crossover_selectors , std::clog);
print_operators(aftercross_selector_p, fake_foundry.aftercross_selectors, std::clog);
print_operators( crossover_p, fake_foundry.crossovers , std::clog);
print_operators( mutation_rate_p, fake_foundry.mutation_rates , std::clog);
print_operators( mutation_selector_p, fake_foundry.mutation_selectors , std::clog);
print_operators( mutation_p, fake_foundry.mutations , std::clog);
print_operators( replacement_p, fake_foundry.replacements , std::clog);
print_operators( offspring_size_p, fake_foundry.offspring_sizes , std::clog);
print_operators( pop_size_p, (size_t)1, pop_size_max , std::clog);
std::clog << std::endl;
// If we were to make a DoE sampling numeric parameters,
// we would use that many samples:
size_t fake_sample_size = 10;
std::clog << "With " << fake_sample_size << " samples for numeric parameters..." << std::endl;
size_t n = size_t n =
fake_foundry.crossover_rates.size() fake_sample_size //crossover_rates
* fake_foundry.crossover_selectors.size() * fake_foundry.crossover_selectors.size()
* fake_foundry.crossovers.size() * fake_foundry.crossovers.size()
* fake_foundry.aftercross_selectors.size() * fake_foundry.aftercross_selectors.size()
* fake_foundry.mutation_rates.size() * fake_sample_size //mutation_rates
* fake_foundry.mutation_selectors.size() * fake_foundry.mutation_selectors.size()
* fake_foundry.mutations.size() * fake_foundry.mutations.size()
* fake_foundry.replacements.size() * fake_foundry.replacements.size()
* fake_foundry.continuators.size() * fake_foundry.continuators.size()
* fake_foundry.offspring_sizes.size(); * fake_sample_size //offspring_sizes
std::clog << std::endl; * fake_sample_size //pop_size
std::clog << n << " possible algorithms configurations." << 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; 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. // Do not print problem and instances, as they are managed separately by irace.
std::cout << "# name\tswitch\ttype\trange" << std::endl; std::cout << "# name\tswitch\ttype\trange" << std::endl;
print_param_range( continuator_p, fake_foundry.continuators .size(), std::cout); print_irace( continuator_p, fake_foundry.continuators , std::cout);
print_param_range( crossover_rate_p, fake_foundry.crossover_rates .size(), std::cout); print_irace( crossover_rate_p, fake_foundry.crossover_rates , std::cout);
print_param_range( crossover_selector_p, fake_foundry.crossover_selectors .size(), std::cout); print_irace( crossover_selector_p, fake_foundry.crossover_selectors , std::cout);
print_param_range(aftercross_selector_p, fake_foundry.aftercross_selectors.size(), std::cout); print_irace(aftercross_selector_p, fake_foundry.aftercross_selectors, std::cout);
print_param_range( crossover_p, fake_foundry.crossovers .size(), std::cout); print_irace( crossover_p, fake_foundry.crossovers , std::cout);
print_param_range( mutation_rate_p, fake_foundry.mutation_rates .size(), std::cout); print_irace( mutation_rate_p, fake_foundry.mutation_rates , std::cout);
print_param_range( mutation_selector_p, fake_foundry.mutation_selectors .size(), std::cout); print_irace( mutation_selector_p, fake_foundry.mutation_selectors , std::cout);
print_param_range( mutation_p, fake_foundry.mutations .size(), std::cout); print_irace( mutation_p, fake_foundry.mutations , std::cout);
print_param_range( replacement_p, fake_foundry.replacements .size(), std::cout); print_irace( replacement_p, fake_foundry.replacements , std::cout);
print_param_range( offspring_size_p, fake_foundry.offspring_sizes .size(), 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"); // std::ofstream irace_param("fastga.params");
// irace_param << "# name\tswitch\ttype\tvalues" << std::endl; // irace_param << "# name\tswitch\ttype\tvalues" << std::endl;
@ -272,91 +514,105 @@ int main(int argc, char* argv[])
exit(NO_ERROR); exit(NO_ERROR);
} }
const size_t generations = static_cast<size_t>(std::floor( eo::log << eo::debug << "Maximum number of evaluations: " << max_evals << std::endl;
static_cast<double>(max_evals) / static_cast<double>(pop_size)));
// const size_t generations = std::numeric_limits<size_t>::max();
eo::log << eo::debug << "Number of generations: " << generations << std::endl; eo::log << eo::debug << "Number of generations: " << generations << std::endl;
// Problem configuration code.
struct Problem {
double dummy;
size_t epistasis;
size_t neutrality;
size_t ruggedness;
size_t max_target;
};
std::map<size_t, Problem> problem_config_mapping { /*****************************************************************************
{ 0, {0, 0, 1, 0, 1000}}, * IOH stuff.
{ 1, {0, 0, 3, 0, 333}}, *****************************************************************************/
{ 2, {0, 0, 5, 0, 200}},
{ 3, {0, 2, 1, 0, 1000}},
{ 4, {0, 2, 3, 0, 333}},
{ 5, {0, 2, 3, 0, 200}},
{ 6, {0, 4, 1, 0, 1000}},
{ 7, {0, 4, 3, 0, 333}},
{ 8, {0, 4, 5, 0, 200}},
{ 9, {0.5, 0, 1, 0, 500}},
{10, {0.5, 0, 3, 0, 166}},
{11, {0.5, 0, 5, 0, 100}},
{12, {0.5, 2, 1, 0, 500}},
{13, {0.5, 2, 3, 0, 166}},
{14, {0.5, 2, 5, 0, 100}},
{15, {0.5, 4, 1, 0, 500}},
{16, {0.5, 4, 3, 0, 166}},
{17, {0.5, 4, 5, 0, 100}},
};
assert(0 <= problem and problem < problem_config_mapping.size());
/***** IOH logger *****/ /***** IOH logger *****/
auto max_target_para = problem_config_mapping[problem].max_target; auto max_target = benchmark[problem].max_target;
IOHprofiler_RangeLinear<size_t> target_range(0, max_target_para, buckets); ioh::logger::eah::Log10Scale<double> target_range(0, max_target, buckets);
IOHprofiler_RangeLinear<size_t> budget_range(0, max_evals, buckets); ioh::logger::eah::Log10Scale<size_t> budget_range(0, max_evals, buckets);
IOHprofiler_ecdf_logger<int, size_t, size_t> logger( ioh::logger::EAH eah_logger(target_range, budget_range);
target_range, budget_range,
/*use_known_optimum*/false);
logger.set_complete_flag(true); ioh::logger::Combine loggers(eah_logger);
logger.set_interval(0);
logger.activate_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 << "FastGA";
for(auto& p : {
crossover_selector_p,
crossover_p,
aftercross_selector_p,
mutation_selector_p,
mutation_p,
replacement_p }) {
name << "_" << p.shortName() << "=" << p.getValue();
}
for(auto& p : {
crossover_rate_p,
mutation_rate_p }) {
name << "_" << p.shortName() << "=" << p.getValue();
}
for(auto& p : {pop_size_p,
offspring_size_p }) {
name << "_" << p.shortName() << "=" << p.getValue();
}
std::clog << name.str() << std::endl;
// Build up a problem description.
std::ostringstream desc;
desc << "pb=" << problem << "_";
desc << benchmark[problem]; // Use the `operator<<` above.
std::clog << desc.str() << std::endl;
std::filesystem::path folder = desc.str();
std::filesystem::create_directories(folder);
ioh::trigger::OnImprovement on_improvement;
ioh::watch::Evaluations evaluations;
ioh::watch::TransformedYBest transformed_y_best;
std::vector<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 *****/ /***** IOH problem *****/
double w_model_suite_dummy_para = problem_config_mapping[problem].dummy; double w_dummy = benchmark[problem].dummy;
int w_model_suite_epitasis_para = problem_config_mapping[problem].epistasis; int w_epitasis = benchmark[problem].epistasis;
int w_model_suite_neutrality_para = problem_config_mapping[problem].neutrality; int w_neutrality = benchmark[problem].neutrality;
int w_model_suite_ruggedness_para = problem_config_mapping[problem].ruggedness; int w_ruggedness = benchmark[problem].ruggedness;
W_Model_OneMax w_model_om; // std::string problem_name = "OneMax";
std::string problem_name = "OneMax"; // problem_name = problem_name
problem_name = problem_name // + "_D" + std::to_string((int)(w_dummy * dimension))
+ "_D" + std::to_string((int)(w_model_suite_dummy_para * dimension)) // + "_E" + std::to_string(w_epitasis)
+ "_E" + std::to_string(w_model_suite_epitasis_para) // + "_N" + std::to_string(w_neutrality)
+ "_N" + std::to_string(w_model_suite_neutrality_para) // + "_R" + std::to_string(w_ruggedness);
+ "_R" + std::to_string(w_model_suite_ruggedness_para);
// ioh::problem::wmodel::WModelOneMax w_model_om(
/// This must be called to configure the w-model to be tested. WModelFlat w_model_om(
w_model_om.set_w_setting(w_model_suite_dummy_para,w_model_suite_epitasis_para, instance,
w_model_suite_neutrality_para,w_model_suite_ruggedness_para); dimension,
w_dummy,
/// Set problem_name based on the configuration. w_epitasis,
w_model_om.IOHprofiler_set_problem_name(problem_name); w_neutrality,
w_ruggedness);
/// Set problem_id as 1
w_model_om.IOHprofiler_set_problem_id(problem); // FIXME check what that means
// w_model_om.IOHprofiler_set_instance_id(instance); // FIXME changing the instance seems to change the target upper bound.
/// Set dimension.
w_model_om.IOHprofiler_set_number_of_variables(dimension);
/***** Bindings *****/ /***** Bindings *****/
logger.track_problem(w_model_om); w_model_om.attach_logger(loggers);
eoEvalIOHproblem<Bits> onemax_pb(w_model_om, logger); /*****************************************************************************
* Binding everything together.
*****************************************************************************/
eoEvalIOHproblem<Bits> onemax_pb(w_model_om, loggers);
// eoEvalPrint<Bits> eval_print(onemax_pb, std::clog, "\n"); // eoEvalPrint<Bits> eval_print(onemax_pb, std::clog, "\n");
eoEvalFuncCounter<Bits> eval_count(onemax_pb); // eoEvalFuncCounter<Bits> eval_count(onemax_pb);
eoEvalCounterThrowException<Bits> eval_count(onemax_pb, max_evals);
eoPopLoopEval<Bits> onemax_eval(eval_count); eoPopLoopEval<Bits> onemax_eval(eval_count);
@ -364,9 +620,9 @@ int main(int argc, char* argv[])
eoBooleanGenerator<int> bgen; eoBooleanGenerator<int> bgen;
eoInitFixedLength<Bits> onemax_init(/*bitstring size=*/dimension, bgen); eoInitFixedLength<Bits> onemax_init(/*bitstring size=*/dimension, bgen);
auto& foundry = make_foundry(store, onemax_init, eval_count, max_evals - pop_size, generations); auto& foundry = make_foundry(store, onemax_init, eval_count, max_evals, generations, max_target);
Ints encoded_algo(foundry.size()); eoAlgoFoundry<Bits>::Encodings encoded_algo(foundry.size());
encoded_algo[foundry.crossover_rates .index()] = crossover_rate; encoded_algo[foundry.crossover_rates .index()] = crossover_rate;
encoded_algo[foundry.crossover_selectors .index()] = crossover_selector; encoded_algo[foundry.crossover_selectors .index()] = crossover_selector;
@ -379,39 +635,55 @@ int main(int argc, char* argv[])
encoded_algo[foundry.continuators .index()] = continuator; encoded_algo[foundry.continuators .index()] = continuator;
encoded_algo[foundry.offspring_sizes .index()] = offspring_size; encoded_algo[foundry.offspring_sizes .index()] = offspring_size;
std::clog << "Encoded algorithm:" << std::endl; // std::clog << "Encoded algorithm:" << std::endl;
foundry.select(encoded_algo); foundry.select(encoded_algo);
std::clog << foundry.name() << std::endl; std::clog << foundry.name() << std::endl;
// // Evaluation of a forged encoded_algo on the sub-problem /*****************************************************************************
// eoEvalFoundryFastGA<Ints, Bits> eval_foundry( * Run and output results.
// 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);
eoPop<Bits> pop; eoPop<Bits> pop;
pop.append(pop_size, onemax_init); pop.append(pop_size, onemax_init);
onemax_eval(pop,pop); try {
foundry(pop); // Actually run the selected algorithm. 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 *****/ /***** IOH perf stats *****/
IOHprofiler_ecdf_sum ecdf_sum; double perf = ioh::logger::eah::stat::under_curve::volume(eah_logger);
// iRace expects minimization
long perf = ecdf_sum(logger.data());
// assert(0 < perf and perf <= buckets*buckets); if(perf == 0 or perf > max_target * max_evals * 1.0) {
if(perf <= 0 or buckets*buckets < perf) { std::cerr << "WARNING: illogical performance? " << perf
std::cerr << "WARNING: illogical performance: " << perf << " Check the bounds or the algorithm." << std::endl;
<< ", check the bounds or the algorithm." << std::endl;
} }
// std::clog << "After " << eval_count.getValue() << " / " << max_evals << " evaluations" << std::endl; // std::clog << "After " << eval_count.getValue() << " / " << max_evals << " evaluations" << std::endl;
// Output if(output_mat) {
std::cout << -1 * perf << std::endl; 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

@ -0,0 +1,64 @@
https://github.com/drbild/json2yaml.gitBootstrap: library
From: ubuntu:20.04
%post
# Dependencies
apt -y update
apt -y install software-properties-common
add-apt-repository universe
apt -y update
apt -y dist-upgrade
apt -y install git clang-9 cmake make libeigen3-dev
apt clean
update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-9 90
update-alternatives --set c++ /usr/bin/clang++-9
# Temporary directory where we are going to build everything.
tmpdir=$(mktemp -d)
mkdir -p ${tmpdir}/fastga/
# Build IOH
cd ${tmpdir}/fastga/
git clone --branch feat+EAF --single-branch --recurse-submodules https://github.com/jdreo/IOHexperimenter.git
cd IOHexperimenter
mkdir -p release
cd release
cmake -D CMAKE_BUILD_TYPE=Release -D BUILD_TESTS=OFF -D BUILD_EXAMPLE=OFF -D BUILD_GMOCK=OFF ..
make
# Build Paradiseo
cd ${tmpdir}/fastga/
git clone --branch feat+num_foundry --single-branch https://github.com/jdreo/paradiseo.git
cd paradiseo
touch LICENSE
mkdir -p release
cd release
cmake -D CMAKE_BUILD_TYPE=Release -EDO=ON -EDO_USE_LIB=Eigen3 ..
make
# Build FastGA
cd ${tmpdir}/fastga/paradiseo/eo/contrib/irace/
mkdir -p release
cd release
cmake -D CMAKE_BUILD_TYPE=Release -D IOH_ROOT=${tmpdir}/fastga/IOHexperimenter/ -D PARADISEO_ROOT=${tmpdir}/fastga/paradiseo/ -D PARADISEO_BUILD=${tmpdir}/fastga/paradiseo/release/ ..
make
# Install FastGA
cp fastga /usr/local/bin/
# Clean-up
rm -rf ${tmpdir}
apt -y purge software-properties-common git clang-9 cmake make libeigen3-dev
apt -y --purge autoremove
apt -y autoclean
apt clean
%environment
%runscript
/usr/local/bin/fastga $*
%labels
Author Quentin Renau
Author Johann Dreo

View file

@ -15,7 +15,7 @@ execDir = "."
## File to save tuning results as an R dataset, either absolute path or ## File to save tuning results as an R dataset, either absolute path or
## relative to execDir. ## relative to execDir.
# logFile = "./irace.Rdata" logFile = "" # "./irace.Rdata"
## Previously saved log file to recover the execution of irace, either ## Previously saved log file to recover the execution of irace, either
## absolute path or relative to the current directory. If empty or NULL, ## absolute path or relative to the current directory. If empty or NULL,
@ -62,8 +62,8 @@ targetRunner = "./target-runner"
## Maximum number of runs (invocations of targetRunner) that will be ## Maximum number of runs (invocations of targetRunner) that will be
## performed. It determines the maximum budget of experiments for the ## performed. It determines the maximum budget of experiments for the
## tuning. ## tuning. (minimum: 180)
maxExperiments = 2000 maxExperiments = 100000
## Maximum total execution time in seconds for the executions of ## Maximum total execution time in seconds for the executions of
## targetRunner. targetRunner must return two values: cost and time. ## targetRunner. targetRunner must return two values: cost and time.
@ -129,13 +129,13 @@ digits = 2
## Number of calls to targetRunner to execute in parallel. Values 0 or 1 ## Number of calls to targetRunner to execute in parallel. Values 0 or 1
## mean no parallelization. ## mean no parallelization.
# parallel = 0 parallel = 0
## Enable/disable load-balancing when executing experiments in parallel. ## Enable/disable load-balancing when executing experiments in parallel.
## Load-balancing makes better use of computing resources, but increases ## Load-balancing makes better use of computing resources, but increases
## communication overhead. If this overhead is large, disabling ## communication overhead. If this overhead is large, disabling
## load-balancing may be faster. ## load-balancing may be faster.
# loadBalancing = 1 loadBalancing = 0
## Enable/disable MPI. Use Rmpi to execute targetRunner in parallel ## Enable/disable MPI. Use Rmpi to execute targetRunner in parallel
## (parameter parallel is the number of slaves). ## (parameter parallel is the number of slaves).

View file

@ -25,7 +25,7 @@ error() {
EXE="./fastga" EXE="./fastga"
LOG_DIR="irace_logs" LOG_DIR="irace_logs"
FIXED_PARAMS="--problem=0" FIXED_PARAMS="--problem={{PROBLEM}}"
CONFIG_ID=$1 CONFIG_ID=$1
INSTANCE_ID=$2 INSTANCE_ID=$2

View file

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

@ -1,19 +0,0 @@
#!/bin/bash
if [[ $# != 1 ]] ; then
echo "ERROR: build dir not indicated"
exit 1
fi
cd $1
pwd
# Fore some reason, irace absolutely need those files...
cp ../irace-config/example.scen .
cp ../irace-config/target-runner .
cp ../irace-config/default.instances .
# Generate the parameter list file.
./fastga -h > fastga.param 2>/dev/null
/usr/lib/R/site-library/irace/bin/irace --scenario example.scen 2>&1 | tee irace.log

View file

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

View file

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

View file

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

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