Two-phase attractors for finite-duration consensus of multi-agent systems