**3. AutoMoDe-TuttiFrutti**

TuttiFrutti is a modular automatic off-line design method; it produces control software for swarms of e-pucks that can display and perceive colors. More precisely, TuttiFrutti is an instance of AutoMoDe specialized in the design of robot swarms that act according to color-based information. The variety of collective behaviors produced by previous instances of AutoMoDe have been so far restricted by the limited capabilities of the robots—see Section 2. We conceive TuttiFrutti to overcome this restriction from a twofold perspective: on the one hand, e-pucks that display and perceive colors could enable the design of robot swarms in which the individuals exhibit color-based communication; on the other hand, these swarms could perform missions in complex and time-varying environments. By introducing communication capabilities and missions with complex environments, we meant to enlarge significantly the variety of collective behaviors designed with AutoMoDe.

Three fundamental components characterize TuttiFrutti: the robot platform, the set of preexisting software modules, and the optimization process that produces the control software. In the following sub-sections we describe each of these components, their relationship, and how they differentiate from other instances of AutoMoDe.

#### *3.1. Robot Platform*

TuttiFrutti produces control software for an extended version of the e-puck [54,55]—see Figure 1. The e-puck is a two wheeled, small, educational robot often used in swarm robotics research [8–11,14,45,46]. We consider a model of the e-puck endowed with a set of sensors and actuators defined by the reference model RM 3—see Table 1. We adopt the concept of *reference* *model* [5] to formally characterize the platform for which TuttiFrutti can produce control software. RM 3 represents the capabilities of the robot both in real and simulated environments.

**Figure 1.** Extended version of the e-puck. The picture indicates the set of sensors and actuators defined by RM 3. Alongside, we show the RGB blocks that we use in our experiments with TuttiFrutti.

**Table 1.** Reference model RM 3. Novelties with respect to RM 1.1 are highlighted in gray. They concern the capabilities of displaying and perceiving colors. Robots can perceive: red (*R*); green (*G*); blue (*B*); cyan (*C*); magenta (*M*); and yellow (*Y*). Robots can display no color (∅); cyan (*C*); magenta (*M*); and yellow (*Y*). *Vc* is calculated likewise *Vn*—for each perceived color, the positions of color signals are aggregated into a unique attraction vector.


Period of the control cycle: 0.1 s.

The sensors and actuators available to the e-puck are proximity and ground sensors, a range-and-bearing board [56], an omnidirectional vision turret [16], right and left wheels, and RGB LEDs. The e-puck can detect nearby obstacles by its eight proximity sensors (*proxi* ) distributed around its chassis. Three infrared ground sensors (*gndj* ) allow the e-puck to differentiate between black, gray and white floor. By means of its range-and-bearing board, the e-puck knows the number of neighboring peers (*n*) in a range of 0.5 m. A vector (*Vn*) represents an attraction force to the neighboring e-pucks—to which the robot is subject—following the framework of virtual physics [57]. The omnidirectional vision turret allows the e-puck to perceive red, blue, green, cyan, magenta and yellow lights (*camc*) in a 360° field of view and within a range of about 0.5 m. For each color perceived, a unit vector (*Vc*) is associated, which represents a steady attraction to robots or objects that display the color. Finally, the control software of the robot can adjust independently the velocity of each wheel (*vk*) between −0.12 and 0.12 m/s, and, using the three RGB LEDs placed on the top of the e-puck, can display cyan, magenta or yellow.

RM 3 is the first reference model adopted in the definition of a design method of the AutoMoDe family that includes the omnidirectional vision turret and the RGB LEDs of the e-puck platform. Vanilla, Chocolate and Maple are based on the simpler RM 1.1 [58]—the differences between RM 3 and RM 1.1 are highlighted in Table 1. Gianduja introduced the reference model RM 2 [58], associated to e-pucks that can exchange binary messages using their range-and-bearing board. An important difference between TuttiFrutti and other instances of AutoMoDe is that in RM 3 we removed the capability of the e-puck of measuring ambiance light. Although present in RM 1.1 and RM 2, this capability is incompatible with the RGB LEDs we added in RM 3.

#### *3.2. Set of Preexisting Modules*

The major characteristic of AutoMoDe is that it produces control software by assembling preexisting software modules. In TuttiFrutti, the modules are combined into probabilistic finite state machines—as in Vanilla, Chocolate, and Gianduja [8,9,14]. We conceived a set of modules that comprises six low-level behaviors—actions that a robot can take, and seven transition conditions—situations that trigger the change from one low-lever behavior to another. The set of modules of TuttiFrutti adapts and extends the modules originally conceived for Vanilla. We designed the modules to operate with RM 3 and they provide the e-puck different means to interact with robots and objects that display colors. Table 2 lists the low-level behaviors and transition conditions of TuttiFrutti. We further describe the modules in the following.


**Table 2.** Set of TuttiFrutti's modules. Novelties with respect to Vanilla are highlighted in gray. They concern to the capability of acting upon perceived colors. The modules operate according to RM 3, see Table 1.

\* All low-level behaviors display a color *<sup>γ</sup>* ∈ {∅, *<sup>C</sup>*, *<sup>M</sup>*,*Y*} alongside the action described.
