Skip to content

Commit 523f683

Browse files
authored
Merge pull request #93 from ntnu-ai-lab/evo2
Evo2
2 parents fff789d + 964dbc0 commit 523f683

File tree

19 files changed

+603
-76
lines changed

19 files changed

+603
-76
lines changed

.all-contributors.rc

Lines changed: 0 additions & 40 deletions
This file was deleted.

.github/workflows/documentation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- uses: actions/checkout@v2
1919
- uses: julia-actions/setup-julia@latest
2020
with:
21-
version: "1.7"
21+
version: "1.9.3"
2222
- name: Install dependencies
2323
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
2424
- name: Build and deploy

CITATION.cff

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ authors:
66
orcid: "https://orcid.org/0000-0003-2271-439X"
77
affiliation: "Norwegian University of Science and Technology"
88
title: "EvoLP.jl"
9-
version: 1.2.0
9+
version: 2.0.0
1010
license: MIT
11-
date-released: 2023-07-31
11+
date-released: 2025-09-30
1212
url: "https://github.com/ntnu-ai-lab/EvoLP.jl"
1313
preferred-citation:
1414
type: conference-paper

CONTRIBUTING.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ There are many ways in which you can contribute to EvoLP!
1616

1717
Having a clearer documentation benefits everyone. In this sense, you can help either fixing it or expanding it in multiple ways: with wording or clarification, reporting typos, adding corrections or even creating new pages on topics that could need further explanations.
1818

19-
The manuals are written in Markdown, and are built using [Documenter.jl](https://github.com/JuliaDocs/Documenter.jl). All the source files of the documentation can be found [here](https://github.com/ntnu-ai-lab/EvoLP.jl/tree/main/docs).
19+
The manuals are written in Markdown, and are built using [Documenter.jl](https://github.com/JuliaDocs/Documenter.jl). All the source files of the documentation can be found at the docs [GitHub Page](https://github.com/ntnu-ai-lab/EvoLP.jl/tree/main/docs).
2020

2121
If your submission is small (typos or one or two sentences) then probably using GitHub's online editor is the best idea.
2222

@@ -46,7 +46,7 @@ Contributing code is also possible via fork & pull request:
4646
EvoLP follows the ColPrac: Contributor's Guide on Collaborative Practices for Community Packages guide from SciML.
4747
This guide is a collection of best practices when contributing to packages.
4848

49-
You can read the full guide [here](https://github.com/SciML/ColPrac).
49+
You can read the full guide at SciML's [ColPrac repository](https://github.com/SciML/ColPrac).
5050

5151
## Code style guidelines
5252

@@ -55,7 +55,7 @@ You can read the full guide [here](https://github.com/SciML/ColPrac).
5555
EvoLP follows Invenia's Blue code style guide.
5656
This is a set of style conventions for Julia code that are based on a series of grounding documents (like Julia's own style guide and PEP8).
5757

58-
You can read the full guide [here](https://github.com/invenia/BlueStyle).
58+
You can read the full guide at Invenia's [Blue Style repository](https://github.com/invenia/BlueStyle).
5959

6060
## Source code organisation
6161

@@ -65,6 +65,7 @@ The following table shows how the EvoLP code is organised:
6565
|:-------------:|:-------------:|
6666
| docs | Documentation |
6767
| examples | Examples |
68+
| ext | Extensions |
6869
| src | Source code |
6970
| test | Test suites |
7071

Project.toml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "EvoLP"
22
uuid = "71f1f4bb-392f-41f8-8452-d535d061e0f4"
33
authors = ["Xavier Sánchez Díaz <[email protected]>"]
4-
version = "1.4.0"
4+
version = "2.0.0"
55

66
[deps]
77
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
@@ -10,23 +10,31 @@ LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1010
NamedTupleTools = "d9ec5142-1e00-5aa0-9d6a-321866360f50"
1111
OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
1212
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
13-
StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3"
13+
Revise = "295af30f-e4ad-537b-8983-00126c2a3abe"
1414
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
1515
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
1616
UnicodePlots = "b8865327-cd53-5732-bb35-84acbb429228"
1717

18+
[weakdeps]
19+
MPI = "da04e1cc-30fd-572f-bb4f-1f8673147195"
20+
21+
[extensions]
22+
EvoLPIslandsExt = "MPI"
23+
1824
[compat]
1925
Distributions = "0.25"
20-
Documenter = "0.27"
26+
Documenter = "1.14"
27+
MPI = "0.20.22"
2128
NamedTupleTools = "0.14"
22-
OrderedCollections = "1.6"
23-
StableRNGs = "1.0"
29+
OrderedCollections = "1.8"
2430
StatsBase = "0.33"
2531
UnicodePlots = "3.6"
26-
julia = "1.7"
32+
julia = "1.9"
2733

2834
[extras]
35+
MPI = "da04e1cc-30fd-572f-bb4f-1f8673147195"
36+
StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3"
2937
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
3038

3139
[targets]
32-
test = ["Test"]
40+
test = ["Test", "StableRNGs", "MPI"]

README.md

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
<div align="center">
77

88
[![Stable](https://img.shields.io/badge/docs-latest-blue.svg)](https://ntnu-ai-lab.github.io/EvoLP.jl/)
9-
[![Julia version](https://img.shields.io/badge/Julia-1.7+-blueviolet.svg?logo=julia)](https://julialang.org)
9+
[![Julia version](https://img.shields.io/badge/Julia-1.9+-blueviolet.svg?logo=julia)](https://julialang.org)
1010
[![GitHub](https://img.shields.io/github/license/ntnu-ai-lab/EvoLP)](https://github.com/ntnu-ai-lab/EvoLP/blob/main/LICENSE)
11-
[![All Contributors](https://img.shields.io/github/ntnu-ai-lab/EvoLP/all-contributors?color=ee8449&style=flat-square)](#contributors-)
11+
[![All Contributors](https://img.shields.io/badge/all_contributors-2-red)](#contributors)
1212

1313
[![Code Style: Blue](https://img.shields.io/badge/code%20style-blue-blue.svg)](https://github.com/invenia/BlueStyle)
1414
[![ColPrac: Contributor's Guide on Collaborative Practices for Community Packages](https://img.shields.io/badge/ColPrac-Contributor's%20Guide-blueviolet)](https://github.com/SciML/ColPrac)
@@ -26,6 +26,7 @@
2626
- Several crossover and mutation methods
2727
- Test functions for benchmarking
2828
- Convenient result reporting and a statistics logbook
29+
- Support for parallelization and island models (via an extension that uses [MPI.jl](https://github.com/JuliaParallel/MPI.jl))
2930

3031
Combine these blocks to make your own algorithms or use some of the included minimisers: GA, 1+1EA and PSO.
3132
Additionally, you can extend EvoLP to create new operators.
@@ -58,7 +59,7 @@ Please report any issues via the GitHub [issues tracker](https://github.com/ntnu
5859

5960
## Citing EvoLP.jl
6061

61-
If you find EvoLP.jl useful in your work or research, we kindly request that you cite the following [paper](https://ceur-ws.org/Vol-3431/paper7.pdf):
62+
If you find EvoLP.jl useful in your work or research, we kindly request that you cite the following [conference paper](https://ceur-ws.org/Vol-3431/paper7.pdf):
6263

6364
```bibtex
6465
@inproceedings{Sanchez-DiazEvoLP2023a,
@@ -75,41 +76,51 @@ If you find EvoLP.jl useful in your work or research, we kindly request that you
7576
}
7677
```
7778

79+
You can also cite EvoLPIslands, our MPI Extension, by citing the following [conference paper](https://www.ntnu.no/ojs/index.php/nikt/article/view/5667):
80+
81+
```bibtex
82+
@article{sanchez-DiazEvolutionaryComputationIslands2023,
83+
title = {{Evolutionary Computation with Islands: Extending EvoLP.Jl for Parallel Computing}},
84+
shorttitle = {{Evolutionary Computation with Islands}},
85+
author = {Sánchez-Díaz, Xavier F. C. and Mengshoel, Ole Jakob},
86+
year = {2023},
87+
month = nov,
88+
journal = {Norsk {IKT}-konferanse for forskning og utdanning},
89+
number = {1},
90+
issn = {1892-0721},
91+
copyright = {Copyright (c) 2023 Norsk IKT-konferanse for forskning og utdanning},
92+
}
93+
```
94+
7895
## Contributors
7996

8097
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
8198
<!-- prettier-ignore-start -->
8299
<!-- markdownlint-disable -->
83-
<table>
100+
<table align="center">
84101
<tbody>
85102
<tr>
86103
<td align="center" valign="top" width="14.28%">
87104
<a href="https://github.com/saxarona">
88105
<img src="https://avatars.githubusercontent.com/u/5231167?v=4" width="100px;" alt=""/><br />
89106
<sub><b>Xavier F. C. Sánchez-Díaz</b></sub>
90107
</a><br />
91-
<a href="#question-saxarona" title="Answering Questions">💬</a>
92-
<a href="https://github.com/all-contributors/all-contributors/commits?author=saxarona" title="Documentation">📖</a>
93-
<a href="https://github.com/all-contributors/all-contributors/pulls?q=is%3Apr+reviewed-by%3Asaxarona" title="Reviewed Pull Requests">👀</a>
94-
<a href="#talk-saxarona" title="Talks">📢</a>
108+
<a href="https://saxarona.github.io/" title="Website">📝</a>
109+
<a href="https://github.com/ntnu-ai-lab/EvoLP.jl/commits?author=saxarona" title="Documentation">📖</a>
95110
</td>
96111
<td align="center" valign="top" width="14.28%">
97112
<a href="https://github.com/Jafagervik">
98113
<img src="https://pbs.twimg.com/profile_images/1761848615432073216/gMycbhZv_400x400.jpg" width="100px;" alt="Jørgen A. Fagervik"/><br />
99114
<sub><b>Jørgen Aleksander Fagervik</b></sub>
100115
</a><br />
101-
<a href="#question-Jafagervik" title="Answering Questions">💬</a>
102-
<a href="https://github.com/ntnu-ai-lab/EvoLP/commits?author=Jafagervik" title="Documentation">📖</a>
103-
<a href="https://github.com/ntnu-ai-lab/EvoLP/pulls?q=is%3Apr+reviewed-by%3AJafagervik" title="Reviewed Pull Requests">👀</a>
104-
<a href="#talk-Jafagervik" title="Talks">📢</a>
116+
<a href="https://github.com/ntnu-ai-lab/EvoLP.jl/commits?author=Jafagervik" title="Documentation">📖</a>
105117
</td>
106118
</tr>
107119
</tbody>
108120
</table>
109121

110122
<!-- markdownlint-restore -->
111123
<!-- prettier-ignore-end -->
112-
113124
<!-- ALL-CONTRIBUTORS-LIST:END -->
114125

115126
## Acknowledgements

docs/make.jl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
push!(LOAD_PATH, "../src/")
22

3-
using EvoLP, Documenter
3+
using EvoLP, MPI, Documenter
44

55
DocMeta.setdocmeta!(EvoLP, :DocTestSetup, :(using EvoLP); recursive=true)
6+
modules = [
7+
EvoLP,
8+
Base.get_extension(EvoLP, :EvoLPIslandsExt),
9+
]
610

711
makedocs(
8-
modules = [EvoLP],
12+
modules = modules,
913
doctest = true,
1014
clean = true,
1115
sitename = "EvoLP",
@@ -31,12 +35,14 @@ makedocs(
3135
"Reporting results" => "man/results.md",
3236
"Logging statistics" => "man/logbook.md",
3337
"Custom operators" => "man/extending.md",
38+
"Island Models" => "man/islands.md",
3439
],
3540
"Tutorials" => [
3641
"The OneMax problem" => "tuto/oneplusone_onemax.md",
3742
"The 8 queens problem" => "tuto/8_queens.md",
3843
"GA for continuous optimisation" => "tuto/ga_rosenbrock.md",
3944
"PSO for continuous optimisation" => "tuto/pso_michalewicz.md",
45+
"Parallel Evaluation in EvoLP.jl" => "tuto/parallel.md",
4046
],
4147
"API" => [
4248
"Types" => "lib/types.md",
407 KB
Loading

docs/src/index.md

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Welcome to the documentation for EvoLP!
44

55
[![GitHub source](https://img.shields.io/badge/GitHub-source-green.svg?logo=github)](https://github.com/ntnu-ai-lab/EvoLP.jl)
6-
[![Julia version](https://img.shields.io/badge/Julia-1.7+-blueviolet.svg?logo=julia)](https://julialang.org)
6+
[![Julia version](https://img.shields.io/badge/Julia-1.9+-blueviolet.svg?logo=julia)](https://julialang.org)
77
[![Code Style: Blue](https://img.shields.io/badge/code%20style-blue-blue.svg)](https://github.com/invenia/BlueStyle)
88
[![ColPrac: Contributor's Guide on Collaborative Practices for Community Packages](https://img.shields.io/badge/ColPrac-Contributor's%20Guide-blueviolet)](https://github.com/SciML/ColPrac)
99

@@ -16,7 +16,7 @@ Welcome to the documentation for EvoLP!
1616
- Random [population generators](man/generators.md) (vectors and particles)
1717
- Parent [selection operators](man/selection.md)
1818
- Several [crossover](man/cross.md) and [mutation](man/mutation.md) methods
19-
- [Test functions](man/benchmarks.md) for benchmarking
19+
- [Test functions](man/testfunctions.md) for benchmarking
2020
- Convenient [result reporting](man/results.md) and a [statistics logbook](man/logbook.md)
2121

2222
Combine these blocks to make your own algorithms or use some of the [included](man/algorithms.md) _minimisers_: GA, 1+1EA and PSO.
@@ -26,13 +26,18 @@ Additionally, you can extend EvoLP to create [new operators](man/extending.md).
2626

2727
- Read the [quick start](man/quickstart.md) page for information about installation and to get a quick overview.
2828
- Browse some of the [examples](tuto/oneplusone_onemax.md) to see how to use the built-in algorithms.
29-
- For a more comprehensive tutorial, read the [8-queens problem](tuto/8_queen.md) where we make an algorithm from scratch.
29+
- For a more comprehensive tutorial, read the [8-queens problem](tuto/8_queens.md) where we make an algorithm from scratch.
3030

3131
Alternatively, you can browse the [type](lib/types.md) and [functions](lib/functions.md) indices to view all available functionality.
3232

33+
## Parallel evaluation and Island Models
34+
35+
EvoLP provides island support via MPI as an extension.
36+
Read more [about island models in EvoLP](man/islands.md) and how to achieve [parallel evaluation](tuto/parallel.md).
37+
3338
## Citing EvoLP.jl
3439

35-
If you find EvoLP.jl useful in your work or research, we kindly request that you cite the following [paper](https://ceur-ws.org/Vol-3431/paper7.pdf):
40+
If you find EvoLP.jl useful in your work or research, we kindly request that you cite the following [conference paper](https://ceur-ws.org/Vol-3431/paper7.pdf):
3641

3742
```bibtex
3843
@inproceedings{Sanchez-DiazEvoLP2023a,
@@ -49,6 +54,22 @@ If you find EvoLP.jl useful in your work or research, we kindly request that you
4954
}
5055
```
5156

57+
You can also cite EvoLPIslands, our MPI Extension, by citing the following [conference paper](https://www.ntnu.no/ojs/index.php/nikt/article/view/5667):
58+
59+
```bibtex
60+
@article{sanchez-DiazEvolutionaryComputationIslands2023,
61+
title = {{Evolutionary Computation with Islands: Extending EvoLP.Jl for Parallel Computing}},
62+
shorttitle = {{Evolutionary Computation with Islands}},
63+
author = {Sánchez-Díaz, Xavier F. C. and Mengshoel, Ole Jakob},
64+
year = {2023},
65+
month = nov,
66+
journal = {Norsk {IKT}-konferanse for forskning og utdanning},
67+
number = {1},
68+
issn = {1892-0721},
69+
copyright = {Copyright (c) 2023 Norsk IKT-konferanse for forskning og utdanning},
70+
}
71+
```
72+
5273
## Acknowledgements
5374

5475
EvoLP started as a toolbox for internal use by PhD students of [NTNU's Open AI Lab](https://www.ntnu.edu/ailab/ai-lab), and whose funding is provided by [Project no. 311284](https://prosjektbanken.forskningsradet.no/en/project/FORISS/311284) by [The Research Council of Norway](https://www.forskningsradet.no/).

docs/src/man/islands.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Island Models using MPI
2+
3+
!!! note
4+
This is a somewhat advanced topic. If you are new to parallel computing, we recommend reading the page on [Parallelism](../tuto/parallel.md) first.
5+
6+
EvoLP has newly implemented support for island models of evolutionary algorithms as an extension.
7+
The extension, EvoLPIslands, is implemented using the [weak dependency](https://pkgdocs.julialang.org/v1/creating-packages/#Weak-dependencies) feature added to Julia in v1.9.
8+
9+
!!! details "Loading the extension"
10+
EvoLPIslands will be activated if and only if you have both `EvoLP` and `MPI` loaded into your current scope via the `using` or `import` keywords.
11+
12+
## About Island Models
13+
14+
In an island model, multiple populations (or _islands_) evolve concurrently, and a subpopulation (or _deme_) occasionally drifts from one island to another in a process called _migration_.
15+
Migration passively helps with diversity preservation, which in turn benefits the exploration of large search spaces.
16+
17+
### Migration
18+
19+
The migration process is broken down in three steps: `drift`, `strand` and `reinsert!`:
20+
21+
![The three operators of EvoLP: drift, strand and reinsert.](../assets/EvoLPIslands_operators.png)
22+
23+
To implement these operators, EvoLP uses [MPI.jl](https://juliaparallel.org/MPI.jl/stable/), a wrapper of MPI for Julia.
24+
MPI is a communication standard available in many parallel computing architectures, most notably High Performance Computing clusters, but it can also be used in your local machine.
25+
26+
Specifically, EvoLP uses the `Send` and `Receive` MPI directives, which are **blocking**.
27+
However, there is no need to use these directly. Instead, using the `drift`, `strand`, and `reinsert!` operators in your algorithms should suffice.
28+
29+
```@docs
30+
drift
31+
strand
32+
reinsert!
33+
```
34+
35+
## Selecting a Deme
36+
37+
To send, receive, and reinsert a deme, we introduced `DemeSelector`s that allow for two different types of selection: random, and worst.
38+
39+
```@docs
40+
RandomDemeSelector
41+
WorstDemeSelector
42+
```
43+
44+
As with other operators in EvoLP, the deme selectors can be passed to the `select` method—both for selecting the deme that will _migrate_ as well as selecting the deme that will be replaced.
45+
46+
```@docs
47+
select(::RandomDemeSelector, y)
48+
select(::WorstDemeSelector, y)
49+
```
50+
51+
We also provide a built-in toy algorithm, the island GA:
52+
53+
```@docs
54+
islandGA!
55+
```
56+
57+
## Further Reading
58+
59+
- Our paper [Evolutionary Computation with Islands: Extending EvoLP.jl for Parallel Computing](https://www.ntnu.no/ojs/index.php/nikt/article/view/5667).
60+
- EvoLP's [Parallel](../tuto/parallel.md) documentation page.
61+
- The [MPI.jl documentation](https://juliaparallel.org/MPI.jl/stable/).

0 commit comments

Comments
 (0)