3.2.1. Low-Level Behaviors

In EXPLORATION, the robot moves straight until it detects an obstacle in front (*proxi* ). Then, it rotates for a number of control cycles determined by the integer parameter *τ*, in a range of

*τ*∈{0, ... , 100}. STOP maintains the robot standing still. In ATTRACTION and REPULSION, the robot moves closer (*Vd*) or farther from (−*Vd*) neighboring peers, respectively. In both cases, the velocity of the robot is a function of the number of robots detected (*n*) and the parameter *α*∈[0, 5]. If the robot does not detect other robots, it moves straight. COLOR-FOLLOWING and COLOR-ELUSION move the robot with constant velocity towards (*Vc*) or away (−*Vc*) from robots or objects displaying specific colors (*camc*). The parameter *δ*∈{*R*, *G*, *B*, *C*, *M*,*Y*} determines the color to which the behaviors react. Robots can display the colors *δ*∈{*C*, *M*,*Y*}, and other objects that might populate the environment can display the colors *δ*∈{*R*, *G*, *B*}. If the robot does not perceive the color determined by *δ*, it moves straight. ATTRACTION, REPULSION, COLOR-DETECTION and COLOR-ELUSION incorporate a physics-based obstacle avoidance [59]. In all the low-level behaviors, the parameter *<sup>γ</sup>*∈{∅, *<sup>C</sup>*, *<sup>M</sup>*,*Y*} determines the color displayed by the RGB LEDs of the robot. The parameters *τ*, *α*, *δ*, and *γ* are tuned by the automatic design process.
