The Project was done in association with a PhD student from DAV University. The project was totally research oriented mimicking the behavior of grey wolfs’ strategy of hunting. I implemented this genetic algorithm in C++ programming language, the main motto of this project was to compare the performance over different programming languages. The github link for the project is- https://github.com/shubham-11700069/GWO
Open FinalFinalGWO.cpp for latest working code.
Still need to add other fitness functions from benchmarks.cpp but yeah now it is almost done .. :) :)
I know it's not professional code or like professional coder's work, blame the algo :)
1. Initialize the grey wolf population Xi (i = 1, 2, ..., n)
2. Initialize a, A, and C
3. Calculate the fitness of each search agent
4. Xα=the best search agent
5. Xβ=the second best search agent
6. Xδ=the third best search agent
7. while (t < Max number of iterations)
8. for each search agent
9. Update the position of the current search agent by equation (3.7)
10. end for
11. Update a, A, and C
12. Calculate the fitness of all search agents
13. Update Xα, Xβ, and Xδ
14. t=t+1
15. end while
16. return Xα
- Make sure your gcc version is 4.9.2 or higher You can check it in Devcpp in compiler options
You can download it from here - Go to your compiler settings and add "-std=c++11" in the commands when calling the compiler
and "-static-libgcc" in the commands when calling the linker - select the 'TDM-GCC 4.9.2 64-bit Release' I don't know why but, for 32 bit it is not
working maybe a bug