Typenetic - Genetic algorithm for Typescript
Table of Contents
- Example usage
- Genetic operators examples
npm install typenetic --save
You need to set these options in
tsconfig.jsonfile in your project:
index.tsfile:;;// create population;// evolve population;
||Selection operator, which task is to select elities from population. If
||Crossover operator is responsible for crossing two units.|
||Mutation operator randomly modify genes in the unit.|
Genetic operators examples
Tournament selection chooses best units from population, based on unit's fitness.
In single point crossover, one point, randomly chosen is used to split parents and create new unit with genes from first parent before chosen point and with genes from second parent, beyond chosen point.
Mutation operator randolmy modify genes of units. The probability of mutation depends on mutation rate.