This is a very basic code made in Python, with the intention of simulating a SmartGrid with 5 electronic devices, applying the Bat Algorithm in order to optimize the energy consumption of the devices. This code was made for a final project in the Biologically Inspired Artificial Intelligence course at Universidad Carlos III de Madrid, UC3M.
- Download Python
- Download the Numpy library
- Download matplotlib library
Change only the values of Scan Rate (a) Frequency Update Rate (r), number of bats (num_bats) and the number of iterations (num_iterations) according to the needs of your problem.
At the end of the code execution, outputs will be generated in the console about the results obtained and two graphs showing the bats trends towards the optimal solution.
This code it's a simple approach in order to understand the BA algorithm applying it to a real but basic problem. It's not ready for production, only for academic porpuses.