The Dealer is responsible for giving each robot the best possible role on the field. The system worked with a Hungarian algorithm that would use a score map for each robot (n) and role (m) resulting in a scoring matrix (m,n), where a lower score is better and the score is based on the distance to the role-location and the given flags. The algorithm checks the optimal distribution based on minimizing the score of the entire team. In other words, it would minimize the total score of the team. This caused the issue of the closest-to-ball robot, where the score difference between the closest and other robots was not significant enough to ensure picking the closest-to-ball robot. The current solution was to force a score of 0 on the closest-to-ball robot and increases the other scores of the same role with a static score.

A total refactor of how the dealer functioned was made which added a few new features:

  • Adjusting the weights system for factors (i.e. close to their goal) to be a normalized function to better compare roles to one another. This allowed for a better comparison of if a robot is better suitable for each individual role.
  • Adding a role priority feature that first deals the highest priority role, removes that robot and role and continues down the priorities until all robots/roles are given away. This ensures that a role with factors (like close to ball) and a high priority is given to the best possible robot for those factors.
  • Giving the option to force a role on a robot ID. The addition of forced IDs allows for the play designer to ensure that the receiver role stays the same in between plays, not requiring delayed information from the world view.

The new functionality of the dealer is as followed: After a play is initialized, creating the roles and initializing the flag map, the dealer distribution function is called that outputs a map linking a role name to a robot view.

Algorithm 6: Dealer::distribute(Robots, Roles, Info)
forall forced ID’s do
→ Deal IDs to roles in Map;
→ Remove ID and Role from lists
Get Role X Robot score matrix for remaining elements;
foreach priority in order do
→ Get the scores associated with this priority;
→ Get best assignments with the Hungarian algorithm;
→ Deal ID’s to roles in Map;
→ Remove ID and Role from lists;
return Distribution Map;

The score value of these flags are distance-based and are normalized to the diagonal length of the field or boolean where true is 0 and false is 1.

The current flags include:

  • Closetotheirgoal: Distance from point to enemy goal,
  • Closetoourgoal: Distance from point to friendly goal,
  • Closetoball: Distance from point to ball,
  • Closetoposition: Distance from point desired location,
  • Withworkingballsensor: 0 if the sensor is working,
  • Withworkingdribbler: 0 if the dribbler is working,
  • Keeper: if the robot has the same ID as the referee has,
  • Closesttoball: 0 if robot is the closest to the ball

Adding a value to the score is the same as adding distance to a position. The current solution was to add a fields distance worth of score to undesired roles.

The current priority order is:

  1. Keeper (Highest),
  2. Required,
  3. High Priority,
  4. Medium Priority,
  5. Low Priority (Lowest)

Flowchart of how the dealer::distribution() function works