Scarlet Queen is a Rust framework for co-evolution.
The name is inspired by Red Queen's Hypothesis and Pokémon Scarlet and Violet.
Red Queen's Hypothesis is a hypothesis about co-evolution.
- mdbook
mdbook (https://pokemon-ga.github.io/scarlet-queen/)
- rustdoc
rustdoc (https://scarlet-queen.netlify.app/)
flowchart RL
initializer[scarlet-queen-initializer] --> core[scarlet-queen-core]
fitness[scarlet-queen-fitness] --> core[scarlet-queen-core]
selector[scarlet-queen-selector] --> core[scarlet-queen-core]
replenisher[scarlet-queen-replenisher] --> core[scarlet-queen-core]
generation[scarlet-queen-generation] --> core[scarlet-queen-core]
entrypoint["scarlet-queen-entrypoint (binary crate)"] --> core[scarlet-queen-core]
generation[scarlet-queen-generation] --> fitness[scarlet-queen-fitness]
generation[scarlet-queen-generation] --> selector[scarlet-queen-selector]
generation[scarlet-queen-generation] --> replenisher[scarlet-queen-replenisher]
entrypoint["scarlet-queen-entrypoint (binary crate)"] --> initializer[scarlet-queen-initializer]
entrypoint["scarlet-queen-entrypoint (binary crate)"] --> generation[scarlet-queen-generation]
flowchart LR
initializer["scarlet-queen-initialize (initializer)"] --> fitness["scarlet-queen-arithmetic of fitness (fitness)"]
subgraph generation
fitness["scarlet-queen-arithmetic of fitness (fitness)"] --> selector["scarlet-queen-select (selector)"]
selector["scarlet-queen-select (selector)"] --> replenisher["scarlet-queen-replenisher (replenisher)"]
replenisher["scarlet-queen-replenisher (replenisher)"] --> fitness["scarlet-queen-arithmetic of fitness (fitness)"]
end
https://scarlet-queen.netlify.app/doc/scarlet_queen_core/
Contains the core type definition and logic.
https://scarlet-queen.netlify.app/doc/scarlet_queen_initializer/
Contains the logic for initializing the group (environment).
- modules
random
: enables the random initialization.weight
: enables the weighted initialization.
https://scarlet-queen.netlify.app/doc/scarlet_queen_fitness/
Contains the fitness evaluation logic.
https://scarlet-queen.netlify.app/doc/scarlet_queen_selector/
Contains the logic for selecting individuals for the next generation.
- modules
random
: enables the random selection.roulette
: enables the roulette selection.tournament
: enables the tournament selection.
https://scarlet-queen.netlify.app/doc/scarlet_queen_replenisher/
Contains the logic for replenishing new individuals.
- modules
random
: enables the random generation.novelty
: enables the novelty search algorithm.
https://scarlet-queen.netlify.app/doc/scarlet_queen_generation/
Contains the logic for managing the generation process.
https://scarlet-queen.netlify.app/doc/scarlet_queen_entrypoint/
The binary crate that runs the Scarlet Queen framework.
cargo run --bin scarlet-queen-entrypoint
- run all tests
cargo test
- run tests for a specific package
cargo test -p <test_name>
project directory: docs/
Important
When editing docs for the first time, let it add mdbook
install command is under the command
cargo install mdbook
- start dev server
Tip
This commands cannot deal with hot reloading. You have to reload manually, when you change the docs.
mdbook watch -o ./docs
- build docs
mdbook build ./docs
mdbook plugins
- mdbook-mermaid
You can use mermaid diagrams in this docs.
example
```mermaid
graph TD;
A-->B;
A-->C;
B-->D;
C-->D;
```
project directory: hub/
Important
When editing hub page for the first time, let it add npm
and run npm i
in hub/
directory.
Important
The following commands are executed under hub/
.
- start dev server
npm run dev
- build hub page
npm run build
To format toml file and rust code, when you commit, you need to install husky
and lint-staged
.
Under the commands is setup commands for husky
, lint-staged
and prettier
.
npm i && npm exec husky-init -y && npm exec husky set .husky/pre-commit "npm exec lint-staged --allow-empty"
main branch is the release branch.
dev branch is the development root branch.
-
feat/#[issue-number]-[issue-summary]
example) feat/#12-add-card-button-component
-
chore/#[issue-number]-[issue-summary]
example) chore/#12-add-prettier-config
-
fix/#[issue-number]-[issue-summary]
example) fix/#12-change-title
-
update/#[issue-number]-[issue-summary]
example) update/#12-update-dependencies
flowchart LR
dev["dev"] -->|with strict checks| main["main"]
feature["feat/*"] -->|with loose checks| dev["dev"]
chore["chore/*"] -->|with loose checks| dev["dev"]
fix["fix/*"] -->|with loose checks| dev["dev"]
update["update/*"] -->|with loose checks| dev["dev"]
main["main"] -->|"with strict checks (cron)"| main["main"]
- dev-test (
push
andpull requests
) - docs-test (
push
andpull requests
) - docs (
push
)
- prod-test (
pull requests
) - docs-test (
pull requests
)
- prod-test (
cron
) - docs-test (
cron
)