This Genetic Algorithm is implemented with rust
Source Code: https://github.com/youmin1017/genetic-algorithm-rs/tree/main
Result
Code
There are 5 part of my code
Main function
One trait (used to define prototype of struct methods)
Three struct
- Genetic Algorithm
- Population
- Sqrt Chromosome
Main Function
Chromosome Trait
如果 struct 有 Chromosome 這個 Trait 就必須實作 Trait 中的函式
Genetic Algorithm
Methods
族群演化
族群競爭
Population
Methods
Initialize
Get_fittest
Sqrt Chromosome
Methods
Get_fitness
Mutate
Crossover