1. A method for assigning roles to agents in a first group of agents engaging in an activity, comprising: receiving a first set of detections, wherein each detection in the first set of detections comprises a physical location; defining an exemplar formation comprising an arrangement of each role in a set of roles; calculating a first cost function between at least one detection in the first set of detections and at least one role in the set of roles; generating a first set of permutations based on the first cost function; and assigning a first role in the set of roles to a first detection in the first set of detections based on the first set of permutations.