## 2 Problem Specification
### Low-Level Controller Design  
We used two fuzzy systems to define the microscopic controllers of the system. The first system was in charge of avoiding obstacles and direct collisions. It used the information from 13 angular readings (see Equation (3)) obtained by the LiDAR sensor, grouping them into three zones (\(left=[0..3]\), \(right=[9..12]\), \(front=[4..8]\)). From this information, it emitted the translational and rotational speeds of the agent to avoid collisions. \[\left\{ \begin{array}{ll}0:&-105\\ 1:&-90\\ 2:&-75\\ 3:&-55\\ 4:&-35\\ 5:&-15\\ 6:&0\\ 7:&15\\...&\\ 12:&105\end{array} \right. \tag{3}\]  
The second microscopic system (rendezvous) directed the agent towards a stated goal. To do this, it obtained the position of the robot relative to the goal and emitted the required rotational and translational speeds. Both systems are presented in Table 1.  
In Figure 1, the fuzzy terms and sets for both microscopic systems are presented. The Takagi-Sugeno inference was used to extract knowledge from both behaviors, using the weighted average Takagi-Sugeno decoder. As a conjunction rule, we used the algebraic product, while for the disjunction rule, we used the algebraic sum. The final microscopic controller was required to combine the output of both systems. In our case, we limited the rules of the fuzzy avoidance system to those areas far from the target goal since the task of pushing the box required collision. This limitation could lead to random, low-speed collisions between robots if there were an active target, but this is unavoidable if more advanced information (for example, knowing the kind of objects that are detected by the range sensor in addition to their distance) is not available. Specifically, the final microscopic system--i.e., the one used in our experiments--is presented in Table 1.  
Swarm Formation  
Once the microscopic tasks of the system were defined, we combined them to develop a foraging task. This task used high-level data, leaving the low-level details to the fuzzy drivers. The two microscopic behaviors presented above allowed each individual in the swarm to be arranged in a certain position to avoid obstacles in their movement. To develop the foraging task, a U-shaped swarm formation, obtained by combining the two previous behaviors, was proposed. An example of this robot formation is presented in Figure 2. This training was used in the subsequent learning phase to move the swarm, scale it or rotate it to solve this problem. It is important to note that the existence of swarm coordination was assumed. This coordination can occur exogenously [10] or endogenously, as in this case, where the agents needed to be visible to a zenith agent controller, which guided the swarm towards the required goal. In this way, it should be noted that the microscopic behavior of each individual in the swarm was responsible for moving its robot so that it could be placed in the position required by this formation. Therefore, the next step to be carried out was to learn how to move this robotic formation to achieve the required foraging task. Figure 1: Fuzzy terms and sets for the microscopic controller. This controller was executed by each robot member of the swarm. (**a**) Fuzzy set used for the perception of lasers. The available readings were discretized into three groups (left, right, front), where each one contained three angle readings. The terms for this set are near, far, and emergency (emer). (**b**) Fuzzy set dist, which specifies the distance to the goal. The terms in this set are near, med and far. (**c**) Fuzzy set ang, which was used to represent the angle of the box with respect to the goal. The terms used are far left (farl), medium left (medl), near, medium right (medr) and far right (farr). (**d**) Fuzzy set that represents the rotational speed of the robot. The terms are high left (hleft), left, none, right and high right (hright). The Takagi-Sugeno weighted average was used as a defuzzifier, with a default value of 0.