Add tutorial READMEs and fix tutorial return codes
Add README.md files for moeo/tutorial/Lesson{1-4}, smp/tutorial/Lesson{1-4},
and mo/tutorial/Lesson9 — these tutorials had no documentation.
Fix return 1 → return 0 in 28 tutorial main() functions across mo/ and
smp/ that unconditionally returned failure status.
This commit is contained in:
parent
54a44a177f
commit
c1a44fd2a6
37 changed files with 371 additions and 30 deletions
27
smp/tutorial/Lesson3/README.md
Normal file
27
smp/tutorial/Lesson3/README.md
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
# Heterogeneous island model
|
||||
|
||||
Two islands running different algorithms: an `eoEasyEA` on the QAP problem
|
||||
and a PSO on a bitstring problem, connected via conversion functions.
|
||||
|
||||
## Running
|
||||
|
||||
From the `build/smp/tutorial/Lesson3` directory:
|
||||
|
||||
```shell
|
||||
./lesson3_heterogeneous
|
||||
```
|
||||
|
||||
## How it works
|
||||
|
||||
When islands use different representations, you need conversion functions
|
||||
to translate individuals during migration. In this example, `fromBase()`
|
||||
and `toBase()` convert between the QAP permutation and the PSO bitstring:
|
||||
|
||||
```c++
|
||||
Indi2 fromBase(Indi& i, unsigned size) { ... }
|
||||
Indi toBase(Indi2& i) { ... }
|
||||
```
|
||||
|
||||
The conversions here are dummy placeholders (they just create random
|
||||
individuals), but in a real application you would implement meaningful
|
||||
mappings between representations.
|
||||
Loading…
Add table
Add a link
Reference in a new issue