Probability-triggered formation control with adaptive roles