adaptive-mutation-rate

1.0.0 • Public • Published

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

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i adaptive-mutation-rate

      Weekly Downloads

      2

      Version

      1.0.0

      License

      GPL-3.0

      Unpacked Size

      38.3 kB

      Total Files

      5

      Last publish

      Collaborators

      • hj91