1.2.3 • Published 11 months ago

bat-algorithm v1.2.3

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago
npm install bat-algorithm
const { batAlgorithm } = require('bat-algorithm');
const batAlgorithm = require('bat-algorithm');

// Define the cost function
function sphere(x) {
	let sum = 0
	for (let i = 0; i < x.length; i++) {
		sum += x[i] * x[i]
	}
	return sum
}

// Call the batAlgorithm() function with optional parameters
const result = await batAlgorithm(sphere);
const result = await batAlgorithm(sphere, "./myFolder", 150, 10000, 100, 30, 2, 1, -10, 10, 0, 10);