Formation Control and Collision Avoidance in Mobile Agent Systems