Create swarm.cpp

This is the single portal model implementation. The comments are in correspondence with Doxygen guidelines.