1.0.0 • Published 12 months ago

adaptive-mutation-rate v1.0.0

Weekly downloads
-
License
GPL-3.0
Repository
github
Last release
12 months ago

Adaptive Mutation Rate

This is a Node.js module that calculates an adaptive mutation rate for genetic algorithms. The mutation rate is calculated based on the current generation, the total number of generations, and the maximum and minimum mutation rates.

Installation

Run the following command to install the module:

npm install adaptive-mutation-rate

Usage

Here's a simple example of how to use the module:

const calculateMutationRate = require('adaptive-mutation-rate');

let currentGeneration = 5;
let totalGenerations = 100;
let mutationMax = 0.1;
let mutationMin = 0.01;

let mutationRate = calculateMutationRate(currentGeneration, totalGenerations, mutationMax, mutationMin);

console.log(`The mutation rate for generation ${currentGeneration} is ${mutationRate}`);

This will calculate and output the mutation rate for the 5th generation of a genetic algorithm that runs for 100 generations, with a maximum mutation rate of 0.1 and a minimum mutation rate of 0.01.

License

This project is licensed under the GPL-3.0 License.

Author

Harshad Joshi @ Bufferstack.IO Analytics Technology LLP, 2023