Bat Algorithm in Python
Objective
The main objective is to create an implementation of bat algorithm in Python programming language.
Installation
pip install BatAlgorithm
Example
The following example presents a simple use of bat algorithm. Fun() denotes the objective function that may be changed by the user. Control parameters should be defined within BatAlgorithm() constructor. Order of parameters is as
follows: BatAlgorithm(D, NP, N_Gen, A, r, Qmin, Qmax, Lower, Upper, function) where:
Ddenotes dimension of the problem,NPdenotes population size,N_Gendenotes number of generations (iterations),Aparameter denotes loudness,rparameter denotes pulse rate,Qminparameter denotes frequency minimum,Qmaxparameter denotes frequency maximum,Lowerdenotes lower bound,Upperdenotes upper bound andfunctionpasses objective function.
CODE EXAMPLE:
import random
from BatAlgorithm import *
def Fun(D, sol):
val = 0.0
for i in range(D):
val = val + sol[i] * sol[i]
return val
# For reproducive results
#random.seed(5)
for i in range(10):
Algorithm = BatAlgorithm(10, 40, 1000, 0.5, 0.5, 0.0, 2.0, -10.0, 10.0, Fun)
Algorithm.move_bat()
Bugs
Bugs and extension should be send via Github.
Authors
Iztok Fister Jr. and Marko Burjek
References
Yang, X.-S. "A new metaheuristic bat-inspired algorithm." Nature inspired cooperative strategies for optimization (NICSO 2010). Springer Berlin Heidelberg, 2010. 65-74.
Fister, I. Jr., Fister, I., Yang, X.-S., Fong, S., Zhuang, Y. "Bat algorithm: Recent advances." IEEE 15th International Symposium on Computational Intelligence and Informatics (CINTI), IEEE, 2014. 163-167.
Metadata
Release files for BatAlgorithm 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| BatAlgorithm-0.3.1.tar.gz | 3.0 kB | Without provenance | Details for BatAlgorithm-0.3.1.tar.gz |
Release files / BatAlgorithm-0.3.1.tar.gz
| Download URL | BatAlgorithm-0.3.1.tar.gz |
|---|---|
| Size | 3.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7dfb034272700fba8c9f77102fb5929ca838a938d2a2098283f1d167b293b7cc
|
|
BLAKE2b-256 checksum How to use checksums |
a6c22912eea1d744bb60603ad7060f3719863114b96d43d97996540d50bfd6f9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/2.7.16
|
Security for BatAlgorithm 0.3.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.