Polarith AI
1.8

◆ Assignment()

virtual void Assignment ( int  size)
virtual

Virtual method to assign the agents to the target positions.

Therefore, we assign a position to Formation.positionInFormation to each agent inside the formation.

Parameters
sizeThe number of agents that should be assigned to a target position.

We provide a simple and a complex assignment function. The simple version is fast, but non-optimal, meaning your agents will probably travel larger (non-optimal) distances to reach their assigned positions, and will intersect with other agents. The complex version is optimal, but slow. This results in short distances for your agents, but with high computational effort. Remember to call this method only ONCE if you update the Formation.Size or the list of assigned Agents manually.

Imprint