Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jbytecode/mccga.rs
Machine-coded compact genetic algorithm in Rust
https://github.com/jbytecode/mccga.rs
Last synced: 3 months ago
JSON representation
Machine-coded compact genetic algorithm in Rust
- Host: GitHub
- URL: https://github.com/jbytecode/mccga.rs
- Owner: jbytecode
- License: mit
- Created: 2023-08-15T18:55:53.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-02T18:40:15.000Z (over 1 year ago)
- Last Synced: 2024-09-16T11:47:52.420Z (4 months ago)
- Language: Rust
- Size: 23.4 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# mccga.rs
Machine-coded compact genetic algorithm in Rust## In-short
The package implements the Machine-coded compact genetic algorithm defined in
Satman, M. H. & Akadal, E. (2020). Machine Coded Compact Genetic Algorithms for Real Parameter Optimization Problems . Alphanumeric Journal , 8 (1) , 43-58 . DOI: 10.17093/alphanumeric.576919 [Link](https://dergipark.org.tr/en/pub/alphanumeric/issue/55603/576919)
## Example
Suppose that the objective function is to minimize
```rust
fn f(x: &Vec) -> f64 {
return (x[0] - 3.14159265).powf(2.0) + (x[1] - 2.71828).powf(2.0);
}
```so the package allows to type
```rust
let mins: Vec = vec![-10000.0_f64; 2];
let maxs: Vec = vec![10000.0_f64; 2];let result = mccga(f, &mins, &maxs, 0.001, 100000);
```to minimize the objective function where result is a 2-element vector. One can test the result using
```rust
assert!(isequal(&result[0], 3.14159265, 0.001));
assert!(isequal(&result[1], 2.71828, 0.001));
```## Other implementations
- Python (https://github.com/jbytecode/mccga.py)
- Julia (https://github.com/jmejia8/Metaheuristics.jl)
- Java (https://github.com/jbytecode/mccga.java)