Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jbytecode/mccga.java
Machine-coded compact genetic algorithm in Java
https://github.com/jbytecode/mccga.java
Last synced: 22 days ago
JSON representation
Machine-coded compact genetic algorithm in Java
- Host: GitHub
- URL: https://github.com/jbytecode/mccga.java
- Owner: jbytecode
- License: mit
- Created: 2023-09-28T18:55:34.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-23T17:22:43.000Z (7 months ago)
- Last Synced: 2024-10-15T16:56:54.173Z (2 months ago)
- Language: Java
- Size: 17.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mccga.java
Machine-coded compact genetic algorithm in Java.## 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)
## Usage
Suppose the optimization problem is
$$
\min f(x, y) = \text{abs}(x - 3.14159265) + \text{abs}(y - \exp{1})
$$then the MCCGA searches for the minimum using
```java
OptimizationFunction of = new OptimizationFunction() {
@Override
public double f(double[] x) {
return Math.pow(x[0] - 3.14159265, 2.0) + Math.pow(x[1] - 2.71828, 2.0);
}
};double eps = 0.001;
double[] exp = new double[] { 3.14159265, 2.718282 };double[] mins = new double[] { -100.0, -100.0 };
double[] maxs = new double[] { 100.0, 100.0 };double mutrate = 0.001;
int maxiter = 10000;double[] result = Mccga.mccga(of, mins, maxs, mutrate, maxiter);
```