Finds assignments for a list of agents and target positions in a greedy manner.
The optimization looks iteratively for the best available assignment to the current agent.
- Parameters
-
agents | A list of the agents AIMFormation that should be assigned to positions inside the formation. |
targetPositions | A list of Vector3 positions inside the formation that are available to the agents. |
maxTargets | Determines the maximum number of available targets. Note that this must be less or equal to the real number of available targets to split computation into a greedy and an optimal part. |
- Returns
- An array of assignments; element i is the index of the assigned position from the targets list for the agent on position i of the agents list.