Monday, March 26, 2012

Last Pet Project: Glowworm Swarm Optimization in C++

Lately @irrati0nal and I have been working on a C++ pet project: glowworm++
It is a C++ implementation of the Glowworm Swarm Optimization algorithm as described in the original paper from Krishnanand, K.N. and Ghose, D., Glowworm swarm optimization for simultaneous capture of multiple local optima of multimodal functions, published in Swarm Intelligence, 3, 2, June 2009, 87-124.

I wanted to practice TDD in C++ and was looking for an interesting pet project. So when I knew about @irrati0nal wanting to use GSO optimization for his research on protein docking, I asked him if he wanted to implement it in C++ with me and he gladly accepted. I had worked with genetic algorithms before and I thought that Bio-inspired algorithms were just beautiful.

We worked in short sessions once a week after work and in longer sessions during the weekend once a month, we called the long ones "hackathons". It wasn't difficult to follow the description of the algorithm in the paper, but we had to implement the coordinates and objective function code several times until we were happy enough with the result.

From the very beginning we wanted to release glowworm++ so other people could use it if they wanted. Now it's finally done. If you want to use it you can find the code here.

We applied TDD using the CppUTest framework and pair programming throughout the whole development. We are newbies in these two thecniques. We tried to do our best but, in the end, I think we did a nice job at TDD but not that good at pair programming. We had a lot of fun though. We need to read more about how pair programming works and how to do it well.
We also learn a lot of C++ and realize that we still have so much more to learn.

I'll try to improve my TDD and pair programming skills with my next pet project: I'm working with @remosu on a single page application using Backbone.js

In the near future, I'll have to devote most of my time after work to the UOC, so I won't have more time for glowworm++. However @irrati0nal is starting to use it in his research and will go on improving it to adapt it to his needs. Next summer, once the semester in the UOC is over, I'd like to use glowworm++ as well. I'll try to apply it to search special genetic networks.

@irrati0nal, thanks a million for all the good times we spent rubbing elbows together.

-----------------------------

Update:
I've continued evolving the code in this fork.
I mainly fixed a bug, simplified the code a bit and used some C++11 new features.

No comments:

Post a Comment