https://github.com/bencoveney/chromosomelibrary
Provides Bit-String functionality for use in genetic algorithms
https://github.com/bencoveney/chromosomelibrary
Last synced: about 2 months ago
JSON representation
Provides Bit-String functionality for use in genetic algorithms
- Host: GitHub
- URL: https://github.com/bencoveney/chromosomelibrary
- Owner: bencoveney
- Created: 2014-05-19T09:09:44.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-05-19T12:20:15.000Z (almost 11 years ago)
- Last Synced: 2025-01-13T21:26:30.015Z (3 months ago)
- Size: 176 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
What is ChromosomeLibrary?
--------------------------ChromosomeLibrary provides bit-string functionality for use in genetic algorithm projects:
* Creation of Chromosomes (from random or given data)
* Reproduction (including single-point crossover and mutation operations)Usage
-----To create initial random chromosomes use the following code:
```c#
int bitStringSize = 8;
Chromosome init = GenerateRandomChromosome(bitStringSize);
```Chromosomes can also be created from given data:
```c#
string data = "01101001";
Chromosome init = new Chromosome(data);
```Genetic data from two parents can be combined to produce child chromosomes:
```c#
float mutationRate = 0.001f;
float crossoverRate = 0.3f;Chromosome[] children = Reproduce(ChromosomeA, ChromosomeB, mutationRate, crossoverRate);
```