Adapting Swarm Applications: A Systematic and Quantitative Approach