Robust and Self-repairing Formation Control for Swarms of Mobile Agents