Photomorphogenesis for robot self-assembly: adaptivity, collective decision-making, and self-repair

Self-assembly in biology is an inspiration for engineered large-scale multi-modular systems with desirable characteristics, such as robustness, scalability, and adaptivity. Previous works have shown that simple mobile robots can be used to emulate and study self-assembly behaviors. However, many of these studies were restricted to rather static and inflexible aggregations in predefined shapes, and were limited in adaptivity compared to that observed in nature. We propose a photomorphogenesis approach for robots using our vascular morphogenesis model—a light-stimuli directed method for multi-robot self-assembly inspired by the tissue growth of trees. Robots in the role of ‘leaves’ collect a virtual resource that is proportional to a real, sensed environmental feature. This is then used to build a virtual underlying network that shares a common resource throughout the whole robot aggregate and determines where it grows or shrinks as a reaction to the dynamic environment. In our approach the robots use supplemental bioinspired models to collectively select a leading robot to decide who starts to self-assemble (and where), or to assemble static aggregations. The robots then use our vascular morphogenesis model to aggregate in a directed way preferring bright areas, hence resembling natural phototropism (growth towards light). Our main result is that the assembled robots are adaptive and able to react to dynamic environments by collectively and autonomously rearranging the aggregate, discarding outdated parts, and growing new ones. In representative experiments, the self-assembling robots collectively make rational decisions on where to grow. Cutting off parts of the aggregate triggers a self-organizing repair process in the robots, and the parts regrow. All these capabilities of adaptivity, collective decision-making, and self-repair in our robot self-assembly originate directly from self-organized behavior of the vascular morphogenesis model. Our approach opens up opportunities for self-assembly with reconfiguration on short time-scales with high adaptivity of dynamic forms and structures.

Here we interpret programmable self-assembly as an application scenario of swarm robotics [24]. The basic requirement for this application is the aggregation of robots into a formation of a specific shape or pattern. The eventual vision would be to build small, mobile robotic elements that are fully autonomous and assemble in desired structures that can reconfigure on demand [4,6]. In reconfigurable modular robotics, the self-assembly of autonomous modules has been shown [5,6,8]. In swarm robotics, mobile robots have been developed that can self-assemble in small groups by physically attaching to each other [12,25,26]. In more recent advances, simple mobile robots-Kilobots [13]-were used to essentially emulate self-assembly, in an approach similar to the one we employ here. Groups of up to 1024 Kilobots were shown to autonomously position themselves next to each other in predefined patterns [27].
Robots can be programmed to form predefined shapes, but self-assembly gets more challenging if the shapes need to be dynamic. If the assembled swarm adapts its shape for instance to dynamic features of the environment or to failures in individual robots at runtime, then the assembly's structure also needs to be dynamic. Our main scientific question here is how, for adaptive self-assembly, a robot swarm can explore the environment, detect changes, and then adapt its shape and structure appropriately, while self-repairing if it encounters damage. In an adaptive case, the shape is not simply assembled once and then kept there indefinitely; rather, the shape is assembled and then continuously reconfigured on short time-scales (of minutes, or even seconds). The required speed of reconfiguration may be determined by the time-scale of changes in the dynamic environment. A study in simulation has investigated how self-assembly with a multi-agent system can adapt to changing system size-i.e. agents are removed or added, and the predefined shape scales accordingly [28,29]. The removal of agents can also be seen as damage to the shape, which then needs to reassemble, meaning the swarm has some capability of self-repair. A more recent work studies self-organized morphogenetic engineering with a swarm of Kilobots, specifically using reactiondiffusion systems [14]. The tested scenarios start from a regularly arranged disk shape, which is reshaped autonomously by the robots. The desired shapes are not explicitly predefined-properties such as a fourfold symmetry emerge from the self-organized behavior. This work also successfully tested the effect of damage, cutting off parts of the structure that then regrew [14]. In adaptive selfassembly, a key challenge is that damage to the assembled structure that occurs during the process or even after the shape has been fully formed needs to be repaired autonomously. Repair may be executed by regrowing the damaged parts or by appropriately reconfiguring the shape. In a dynamic environment it may be advantageous to regrow the missing parts in an adapted, updated form.
In robot self-assembly some form of localization or data structure is required to map at least local aspects of the current shape to each robot's memory. This is often implemented by gradients [10,27]. If information about gradients or other data representing the current robot aggregation needs to be propagated through the swarm, then errors can spread and accumulate [30]. Robustness to errors is a general challenge in robot self-assembly. A notable aspect of the self-assembly with 1024 Kilobots by Rubenstein et al [27] is its low degree of scalability. All robots essentially line up consecutively and need to be positioned one after the other. This causes a time complexity that is linear in the number of robots. That needs to be considered a limitation, compared to the high standards for scalability that are generally set in swarm robotics [24]. A recent work introduced the alternative concept of self-disassembly, where all available robots are initially positioned regularly in a standard shape (e.g. a rectangle) [31]. The desired shape is then formed by the excess robots removing themselves autonomously. As robots can only be removed, potential for reconfiguration is limited. The feasible shapes are also limited, as excess robots need to have a free path in order to leave. Scalability with system size is a challenge in robot self-assembly.
In a realistic application of the full self-assembly process, there are sub-tasks that are rarely considered in existing research. For instance, the robot swarm may need to first detect that self-assembly is required, before the process is initialized. As the next sub-task, the swarm needs to collectively agree on which robot starts the self-assembly (i.e. selecting a seed or leader), and where. The question of which robot is the well-known leader selection problem. The question of where relates to aggregation processes in reaction to an environmental feature. A biological example of such behavior is seen in the aggregation of young honeybees [32], where they form a cluster in response to a specific temperature. In an application of robot self-assembly we may have similar requirements, if for example the assembly should be positioned in certain areas preferentially.
We propose a photomorphogenetic method for adaptive robot self-assembly, inspired by light-driven growth processes in plants and other organisms. A plant's vascular system is patterned in part according to light distribution in the environment, which in turn distributes resources among the organs and influences the effective shape of the plant. The photomorphogenesis of plants includes adaptive behaviors such as phototropism, through which light stimuli trigger plants' directional growth and motion. In a distributed way, we run our self-organized virtual vascular system on the aggregated robots, triggering self-assembly that is capable of adaptivity, collective decision-making, and self-repair. To address the wider context of self-assembly, we also study the sub-tasks of leader selection and of the selection of an appropriate area to begin growth. We propose algorithms for a swarm of Kilobots to collectively select a leader, aggregate according to environmental features, forage for light as a resource, reconfigure and adapt to a dynamic environment, and self-repair when damage occurs.
This work builds on the following components from our previous conference publications: collective leader selection and robot self-assembly inspired by diffusion-limited aggregation [33] is built upon in sections 3.3.2, 3.3.3 and 4.1; robot self-assembly inspired by vascular morphogenesis [15] is built upon in sections 3.3.4, 4.2 and 4.4; and site-selection in robot selfassembly [34] is built upon in sections 3.3.4 and 4.3. The additional contributions here consist firstly of considerably extended robot experiments, especially of self-repair, and of extension with simulated experiments. They secondly consist of an extended analysis of our approach concerning leader election and site selection, and a scalability analysis of up to 1024 robots via simulation. Furthermore, we give the first comprehensive presentation of our photomorphogenetic approach to self-assembly, utilizing our model on real mobile robots.
Our research is part of the European project flora robotica [35][36][37]. We develop the methodology to shape natural plants in desired patterns directed by a distributed robot system. The project's objective is to grow architectural structures as a bio-hybrid system of plants and robots. One key concept is to exploit thigmotropism, that is a plant's reaction to touch. We guide climbing plants by structures that provide scaffold [38], in addition to other stimuli. We have technology to construct these scaffolds autonomously and adapted to plant growth [39,40]. The artificial growth of the scaffolds may mimic plant growth and react to environmental features in similar ways. That is why in flora robotica we investigate self-assembly and control approaches inspired by growth, motion, and photomorphogenesis of plants [41]. In addition, we are inspired by other light-driven growth processes, as well as phototaxis and other stimuli-driven responses in social insects [32]. The robots running our photomorphogenetic model create logical tree structures, select seed locations, continually monitor environ mental features, and negotiate the distribution of a virtual scarce resource. The resource is increased by sensed environmental features (e.g. light) and regulates the timing and location of robots that join or leave the selfassembled shape. The growth process then adapts to environmental changes and is capable of self-repair.

Related work
We categorize the related work into two parts: engineered self-assembly systems and bioinspiration sources related to photomorphogenesis.

Self-assembly in engineered systems
Engineered self-assembly systems require a programmable substrate. This substrate needs to consist of entities with a certain degree of autonomythey require sensors, and means of communication.
Concerning locomotion of these entities, there are two options: passive or active. In passive self-assembly the entities are not self-propelled but excited by external forces, such as diffusion, currents in a fluid, or capillary forces. Although sometimes studied at the macroscale [42], passive elements are typically considered for selfassembly at the micro or nanoscale [43]. For example, there are studies on 'complex supramolecular structures … by the algorithmic self-assembly of DNA tiles' [44]. In passively driven granular media, self-organized sorting by size is observed in the 'Brazil nut effect' [45], which has also been applied for active self-assembly in swarm robotics [46]. Herein we focus mainly on active self-assembly with selfpropelled particles (i.e. robots), because following our motivating application of growing architectural structures [35] we are interested in the macroscale.
As mentioned above, the engineering aspect of our work mainly targets swarm robotics [24]. The swarm robotics literature on self-assembly can be separated into two categories: self-assembly of a few physically docked robots, and emulation of self-assembly by many robots positioned next to each other without docking.Autonomous physical docking of swarm robots is quite challenging. Self-assembly with physically docked robots is usually studied with only a few robots autonomously attaching and then moving collectively-for example, to cross a gap or to change means of locomotion from wheels to legs [6,7,11,12,25,47]. Bigger system sizes have only been reached by manually and statically docking the robots [48]. Robot and experiment complexity are evidently reduced once experiments are restricted to only an emulation of self-assembly-that is, robots do not physically dock but only position themselves next to each other to aggregate into shapes. The most prominent result from that domain is the work by Rubenstein et al [27], where a self-organizing approach is shown at large scales of 10 3 'Kilobot' robots. Similarly, Slavkov et al [14] show robot self-assembly with 300 Kilobots. Their main contribution is that the desired shapes are not explicitly predefined but emerge based on a reaction-diffusion system and Turing patterns [49]. We also use the Kilobot [13] in our work herein. Self-assembly with robot hardware focuses almost exclusively on predetermined or anticipated simple structures [12,27]. An exception is the work by Mullins et al [50] who study self-assembly in e-puck robots inspired by diffusionlimited aggregation and the above mentioned work of Slavkov et al [14]. More complex forms of emulated self-assembly have been investigated in simulation: for example, self-repair [28,29,51]. Further studies in simulation investigate emergent structures and emergent pattern formation [52,53].
As mentioned above, the broader context of robot self-assembly and its supporting sub-tasks is often ignored. Similarly, in swarm construction the collective decision of where to start the construction site is not always considered explicitly [54]. For a fully autonomous approach, the robots need to decide whereand triggered by whom-they want to start the selfassembly process.

Photomorphogenesis and sources of bioinspiration
In biology, morphogenesis can be roughly described as the group of processes that drive shape and distribution of an organism's structure [55]. Biological morphogenesis in both plants and animals has inspired advances across robotics [56][57][58][59], including approaches to self-assembly [27,60]. Our approach builds on this close relationship in the literature. Taking inspiration specifically from morphogenetic processes combined with biological responses to light stimuli, we establish a photomorphogenetic approach to selfassembly in a robot swarm. In minimal cognition and limited cognition organisms, decision-making is not centralized but rather is distributed, steered by various stimuli, for instance across interacting members building consensus in a hive [61] or across the sensimotor organization of a bacterium or plant [62,63]. In many organisms, light stimuli received by photoreceptors can drive directional movement (phototaxis) or directional growth (phototropism) [64,65]. Light stimuli have a substantial impact on plant patterning through photomorphogenesis [66,67]. To a lesser degree than in plants, light distribution has also been shown to have crucial impact on coral morphogenesis [16,68]. Phototaxis heavily influences the collective dynamics of social insects, for instance in foraging and division of labor in honeybees [69,70].

Social insect aggregation
The collective decision-making seen in social insects drives self-assembly in a number of species, including honeybees, ants, and termites. Driven to aggregate by certain stimuli and cues, these insects mechanically link to one another, self-assembling into chain, mesh, and cluster structures to solve immediate tasks [17] (see figure 1). Different species of honeybees, for instance Apis dorsata and Apis mellifera, form a living barrier on the outside of comb, to protect and thermoregulate the interior [17,75,76]. Honeybees can collectively manage their aggregation densities to regulate their swarm temperature [77], augmented by thermogenesis for heat production [78]. To achieve collective thermoregulations, Apis mellifera L. have been shown to prefer different thermal conditions when they form aggregates than when they are isolated, allowing them to act as a homeothermic superorganism [79]. To accomplish mechanical tasks, army ants for instance may self-assemble to form a bridge, crossing a gap that is too wide for a single ant, and ants or termites may form a plug or doorway at a hole [17]. The exploration behaviors seen in selfassembly extend to other behaviors such as foraging in ants [80], where a nest is connected to food sources by an emergent and adaptive trail system. In some species this system has a rooted acyclic structure [81], similar to the tree structures explored here.

Coral morphogenesis
Diffusion-limited processes can be seen for instance in coral morphogenesis (see figure 2), where the original diffusion-limited aggregation model [85] has been extended and studied in the context of coral morphology [86][87][88]. Advection and diffusion have been used more broadly in models of growth and branching in stony corals [87]. Real morphologies of the Madracis mirablis coral reefs can be generated exclusively via a diffusion-limited process [16].

Plant morphogenesis
The development of vascular patterning (see figure 3)-a central part of plant morphogenesisis impacted in part by auxin transport [89,90] and subsequently affects resource distribution to organs [91]. As can be seen in photomorphogenesis [66], a key resource in this process is light. In positive phototropism, when phototropins in stem tissue cells are sufficiently exposed to certain wavelengths, water is first moved to those tissues to swell them, after which auxin concentrations can affix the shape of the swelled tissues during stiffening [92,93]. In the context of bioinspired engineering, plant auxin transport and resource transport through the vascular system can be seen as a feedback system for distributed control. Our vascular morphogenesis model drives the growth of dynamic acyclic trees that continuously form and abandon connections to construct favorable paths according to resource distribution in the environment [94,95]. For more details of the bioinspired mechanisms of our vascular morphogenesis model, see below. Similar morphogenetic processes are seen in slime-mold, which can distributedly compute shortest paths in an environment [96,97]. Slime-mold has inspired approaches to path formation in robot swarms, where simulated robots contract from dispersal, aggregating between targeted locations [98]. The exploration aspect of distributed decision-making in morphogenetic processes is also applied in robotics via 'rapidly exploring random trees' [99].

Experiment setup
This section details the robot hardware utilized, as well as the arena and overall setup for the experiments.

Limited mobility robots
The robots we use here are Kilobots [13], shown in figure 6(a). Kilobots have three metal legs that execute a stick-slip motion via two vibration motors at the robot's sides. The robots communicate via infrared messages up to 9 bytes at a time, turn at speeds of up to π/4 rad s −1 , and can move at a nominal speed of 1 cm s −1 . The actual speed of each robot is set manually during a calibration phase. The vibration motors are controlled with the duty-cycle of the hardware pulse-width-modulation, dependent on the status of the battery level, vibration motors, and the robot's balance. The robots have light sensors mounted onboard (see the red circle in figure 6(a)), that have certain limitations discussed in section 3.3.1.   [17]. (Far-left) honeybees swarming in a 3D formation [71]; (left) honeybees swarming on a surface [72]; (right) army ants collectively forming a bridge [73]; (far-right) termites aggregating to a nest location needing repair [74].

Figure 2.
Some coral reef structures can be formed directly by diffusion-limited growth processes [16]. (Left) live coral table [82]; (center) Enallohelia stony coral [83]; (right) Goniocora stony coral [84]. the shadows cast by the robots, resulting in a wider light perception range. Depending on the direction, a robot at the darkest spot can perceive light values I ∈ [280, 1000], covering a substantial portion of its full perception range (i.e. I ∈ [0, 1023]). The swarm seeks to find one of the darkest locations in the arena and seed a structure that will grow towards the light. For the next three tasks, a video projector (max. 1200 lumens) is used as the light source and is positioned above the glass surface, further enough away to minimize the robots' self-cast shadows. We discuss in section 3.3.1 the limitations of this projection setup. The advantage is that the video projector is flexible, allowing us to project any pattern of light, see figures 4(d)-(j). The experiments are executed in a dark room to ensure controlled conditions for the light distribution. The experimental setup would favor a large difference in measured light, between the dark and the bright areas, to ideally cover the robot's full light sensing range (i.e. I ∈ [0, 1023]). However, the camera is our limiting factor, as even in the darker areas it requires a certain minimal level of light in order to capture the robots. Our setup therefore projects light to the entire arena, providing to the robots a reduced light range of I ∈ [280, 1023].

Experiment types
In order to examine the performance of our controllers, we follow several real and simulated robot experiments. We validate our control methods with multiple sets of experiments for leader selection, directed aggregation, adaptation to dynamic environments, site selection, and self-repair of damage. We use 50 Kilobots for leader selection and directed aggregation, and use 70 Kilobots for the remaining. Low swarm densities are expected to slow down the aggregation process due to low incidence of robot encounters, and high densities are expected to limit robot movement due to physical interference. Despite preliminary experiments to find useful swarm densities in our setup, we did not perform an exhaustive study to find an optimum swarm density.

Collective leader selection
We conduct eight experiments where the robots should collectively locate the darkest area in the arena, and select a leader to seed tree growth at that location. The robots are approximately uniformly distributed in the arena at initialization. They are exposed to a gradient of light that is bright on one side, gradually dimming to the other-see figure 4(b). The darkest areas are those closer to the right edge; the rightward area holds the ideal location for initiating a tree structure, which the robots should reliably find.

Directed aggregation
Eight experiments are conducted testing the robot swarm's ability to aggregate into static, permanent trees that grow toward the available light source. The arena setup here is the same as above, and the starting positions of the robots when beginning the directed aggregation experiments are those held at the occurrence of the above leader selection. The trees growing by directed aggregation should therefore grow leftward-directed towards the bright light sourcestarting from a seed position in a dark, rightward location. These experiments are continuations of the leader selection experiments. At each repetition, the two experiment types run for 60 min cumulatively.

Adaptation to a dynamic environment
Here eight runs of a 600 s experiment are conducted.
In each, the robots should grow a dynamic tree structure that finds the brightest location available in the arena, and adapts if the light conditions change. At initialization, the robots are distributed roughly evenly, with a predetermined seed location at the center. The arena lighting is divided into three discrete zones: bright on the right, dark on the left, and a thin gray bar in the center that serves as a buffer-see figure 4(d). After a duration of 200 s, the light conditions in the setup begin to change, with the bright and dark areas replacing one another over a transition period of 200 s, ending with the lighting shown in figure 4(e), which is also maintained for 200 s. In a successful experiment, the robots' dynamic tree structure should first find the brightest area on the right, then after the change in light conditions should adapt its structure to favor the opposite side.

Collective site selection
We conduct six experiments testing the robots' ability to collectively select the most advantageous growth site in the arena-valuing both brightness and proximity-and to adapt to any changes. At the start of the experiment, one robot is set at a predetermined seed location at the arena's center, and the rest of the robots are distributed randomly. In the first experiment phase, the light distribution is organized into two growth sites of equal brightness, with the rightward being nearly adjacent to the seed and the leftward being separated from the seed by a wide gap of full darkness (see figure 4(f)). In the second phase, the two bright growth sites are moved to be equidistant from the seed (separated on each side by a fully dark gap), and the brightness level of the rightward site is reduced (see figure 4(g)). In the first phase, the rightward is preferable because it is closer, and in the second phase, the leftward is preferable because it is brighter. Each experiment has a 20 min duration, with the transition between phases occurring gradually from minute 8-12. If an experiment is successful, the swarm in the first phase should discover the rightward site quickly and grow a tree into it. In the second phase the swarm should become dissatisfied with the rightward site. To adapt, it should first grow further into and explore the dark zone around the seed, finally discovering and preferring the leftward site.

Self-repair of damage
Six experiments are conducted to test the swarm's ability to regrow damaged areas, specifically when a majority of its self-assembled tree structure is severed. The experiments have three phases, each lasting 200 s. At initialization, one robot is designated the seed and is placed at the arena center, while the rest are distributed randomly. In the first phase, the setup matches the start of the 'adaptation to a dynamic environment' experiment-the rightward area is bright, the leftward area is dark, and they are separated at the arena center by a thin gray gap (see figure 4(h)). In the second phase, a narrow bar of full darkness is added, interrupting the bright rightward area (see figure 4(i)). This simulates damage, as any robots exposed to it will not be able to see the brightness nearby and will therefore be severed from any tree connections they have already established. In the third phase, the trigger of damage is removed and the light distribution returns to its initial first phase conditions (see figure 4(j)). In a successful experiment, the swarm should first grow a tree structure into the rightward zone. The majority of this initial structure will then become damaged when branch connections close to its seed are broken, severing all of the children robots connected to the damage. A successful swarm should then regrow the severed portions of the tree (into the rightward zone), once it is re-exposed to the initial environment conditions.

Simulation setup
To test the scalability of our approach, we simulate a swarm of 1024 Kilobots using Kilombo, a C-based simulator specialized on Kilobots [103]. We run simulation experiments with a 48 min duration, matching the setups of the following types described above: adaptation to a dynamic environment, collective site selection, and self-repair of damage. The simulation differs to the robot experiments in a few aspects: robots bounce off walls to avoid clustering at the arena boundaries, there is sparser robot density overall, and robots cannot displace each other. We run 20 repetitions of each of the three experiment types.

Bioinspired control approaches
The primary growth and motion control investigated here is inspired by plant photomorphogenesis-the light-driven progression of plants' developmental phases [66]. While this plant-inspired approach provides several advantages for self-assembly in an engineered system, supplemental light-driven bioinspired approaches are appropriate for certain sub-tasks and applications. We therefore look to honeybee aggregation for the sub-task of leader selection, to diffusion-limited growth in coral for the application of assembling static structures, and to plant photomorphogenesis for dynamic self-assembly inclusive of adaptivity and self-repair.

Honeybee-inspired aggregation
In a thermal gradient environment, young honeybees have been shown to favor areas with approximately 36°C temperature [104]. A single honeybee will move to a location with a nearly ideal temperature but will frequently leave it to explore further. By contrast, honeybees in a group are able to maintain the best thermal location once it is found, through a process of aggregation [79,105]. This has inspired a simple algorithm in the literature that mimics honeybees' behavior in finding the best location for aggregation. The algorithm is known as 'BEECLUST' and is used in collective decision making processes where agent memory is limited and reliably locating the optimum with a single agent is not feasible [32,106,107]. Beeinspired agents walk randomly, turning when they encounter an obstacle such as a wall. When two agents meet they will probabilistically pause their movement, for a time period proportionate to the temperature sensed at that location. The nearer the temperature is to 36°C, the longer the movement is paused. Once the waiting period has elapsed, the agents turn and resume their previous movement pattern.

Coral-inspired aggregation
Although extended diffusion-limited aggregation (DLA) has been used to model coral morphogenesis, DLA originated as a model of metal vapour condensation [85]. It has been explored broadly mathematically, including for aggregation on a tree [108]. In DLA, particles appear according to a random walk, and then attach to the first particle on the existing tree with which they collide. This basic process can be extended such that the random walk of particles is influenced by the distribution of resources in the environment, for instance as in models of coral growth [86].

Plant-inspired aggregation
The distribution of resources to a natural plant's organs depends on the quality and organization of its vessels. The vascular system in a plant actively directs shared resources from the root towards the branches through the flow of auxin, a growth and patterning hormone. Among the processes impacting morphology, higher light exposure near tips triggers greater auxin volume, increasing vessel thickness when flowing toward the roots. The resources of water and minerals travel better through thicker vessels, on the way to branch tips. Our vascular morphogenesis controller (VMC) [41] for directed acyclic graphs (i.e. trees) is inspired by this growth mechanism in plants, bringing their natural capacity for adaptation to artificial systems (see figure 5). The root (i.e. seed) of a VMC tree has by definition the highest resource R. Each node of the tree receives a portion of its parent's R dependent on the vessel thickness V between them, in competition with its siblings. Successin S is produced at each leaf of the tree, according to its perceived light values. As it is sent root-wards, S levels change V in the connections traversed.
S is calculated by where ω 0 and ω s are the constant and sensordependent production rates of S, respectively, I s is the value of a sensor, ρ is the constant transfer factor, Children is a set of all children of the considered node, and S c is the S received from a child node c. The value of ω 0 determines the amount of successin S produced at a leaf regardless of the environmental conditions, while ω s is a factor for the contribution of sensor inputs at each leaf to the production of S. To achieve a high sensitivity of leaves, and subsequently of the full structure, to the sensory input (e.g. light) we set ω 0 = 0 and ω s = 1. The value of ρ limits the length of branches, such that higher ρ will lead to exploitative structures with less adaptivity to changes. Lower ρ results in bushy structures with more branches, which are more explorative and possibly grow into less favorable regions. The value of ρ = 0.75 is chosen here for a less exploitative behavior, modulating the effects of erroneous positive feedback from noisy sensor information. S tunes V such that where α is the update rate of vessels and β is the competition rate. α influences the speed of adaptationa high α leads to quick update of the vessel system and faster reaction to changes in the environment. The downside of high α is sensitivity to noise in the environment and sensors. The range is 0 < α < 1. For α = 1 the vessels are instantly updated according to the value of S passing them. This leads to instability, due to noise and variations in the environment, as well as the intrinsic delay of information flow in the structure. For α set close to zero, the vessel system is expected to converge in a constant environment but with slow speed. Here we choose a moderate α = 0.5, to keep the system comparatively stable while still adapting to environmental changes with reasonable speed. By setting β = 1, vessels are updated towards the amount of S that passes them. Thus, the difference in the vessel quality of sibling branches is directly proportional to the difference between their produced S values. The difference in the amount of S, in turn, reflects differences in each branch's environment, and in its structural properties such as size (e.g. more leaves may produce more overall S). β < 0 relaxes competition between siblings by lowering the differences between their S, resulting in reduced sensitivity to differences in the environment. Values of β > 1 amplify the differences between S values and encourage competition between siblings. However, if β is too high, a branch with slightly better environmental conditions attracts problematically many robots, thereby lowering capacity for exploration of the environment and reducing adaptivity to change. Here we choose β = 2 to have high competition while avoiding a decrease in adaptivity. A parent node distributes R to its children proportionate to V , such that where V CH,p is the sum of the vessel quality of all children of parent p , and R p is the resource reaching the parent. The influence of the above parameters is discussed in further detail in [109].

Implementation details of the robot experiments 3.3.1. Sensing method
The Kilobot light sensor-marked with a red circle in figure 6(a)-is positioned such that self-shading may occur, making the robots' light perception one of our key implementation challenges. Depending on the projection angle and illumination degree, the sensor can be self-shaded or shaded by neighboring robots, interfering in precise perception of the projected light and therefore adversely affecting the robot's performance. Figure 6(b) details the significance of this challenge. Under a top-down projection with three brightness levels, we move a Kilobot by hand in a straight line crossing the arena from left to right. The most drastic impact of self-shading is seen when the robot is oriented north, but also in for instance the westward orientation, we see a drop of the sensor value at the right side of the arena due to shading from the robot's left vibration motor. Considering additional potential shading from neighbors, having a denser cluster of robots increases the interference.
To combat the shading challenge, in a probabilistic approach we consider the robot's own sensor history, as well as the history-based values communicated by neighboring robots. Each robot averages over the light values perceived in its neighborhood by keeping ten neighbors' communicated light intensity values in a ring data structure. Each robot i calculates a weighted sum to obtain the actual light intensity l i (t) of the current time step t by where each I local itself is an average over 300 correct measurements of the sensor. (In case of malfunctioning, the sensor returns −1 which is excluded from the mean.) The time series I local (t) represents the robot's own measurement history of the 20 most recent readings. The I neighbors (n) are measurements recently received from neighbor communication. After executing equation (4), a step function then maps the light value to a number between 0 and 9. Using this approach, the robots achieve high accuracy light perceptions of their local neighborhood. An exception occurs if their neighborhood straddles two discrete brightness zones, but this has low impact on overall performance of the controllers.

Honeybee-inspired leader selection
Our control approach for leader selection via aggregation is inspired by honeybee behavior and is based on the BEECLUST algorithm [32,106,107], modified to assess the environment according to light instead of temperature. The robots follow a random walk, with 75% probability to move straight, 12.5% to turn left, and 12.5% to turn right. The random motion When the waiting period elapses the robots turn at full speed for three seconds-either to the left or right at random-and then resume their original random walk. When a robot is in close proximity to other robots, the speed is set to a lower value for four seconds to minimize the displacement effect among the clusters of robots. As the robot tries to leave the cluster during this period, it ignores all incoming messages to avoid getting locked in place before getting the chance to leave the cluster. Darker spots attract many robots and therefore form bigger clusters which are more likely to persist. The robots also cast shadows on their neighbors, with increasing probability in denser environments. Hence, they remain in bigger clusters for even longer. The homogeneous swarm thereby searches collectively for the darkest spot in the area. The first robot that permanently decides to stay due to exceeding the waiting threshold serves as a seed (see leader selection [110]) and triggers the initialization of tree structure growth.

Coral-inspired directed aggregation
Similar to diffusion-limited growth processes used to model coral morphology [16], here we use a diffusionlimited aggregation process to grow a static directed structure. Because the Kilobots do not have access to dinformation, and localization requires a complex positioning and guiding method, we steer growth towards light in a way that requires only uninformed motion. The robots move randomly and approach the tree structure from any direction. Robots approaching from the area between the structure and the light source have a higher probability to join, compared to those approaching from other directions. This probability P l is calculated according to the highest light value perceived so far by the robots, l max , such that where X is a random variable with uniform distribution over the interval [0, 1), and l is the current light intensity value of the robot. If the measured light intensity is close to the maximum the swarm has observed, the robot gets a high P l to join the tree. The robots' aggregation is additionally influenced by tree depth, where robots approaching deeper leaves of the tree have a higher probability to join. This second probability P d is defined as where d max is the greatest depth observed in the swarm so far, and d is the current depth the robot observes. The values l max and d max are broadcast to the full swarm for the experiment duration. The intersection of the two probabilities (P l × P d ) defines a robot's probability to join the tree, instead of ignoring it and turning away. The combination of random motion and probabilistic joining results in an emergent structure that aggregates towards a light source. After deciding to join the tree, each robot performs a phototactic behavior for a short time. Here this is a zigzag movement pattern towards the light, as the light perception issue described above prevents a reliable sensor reading when the Kilobots are moving straight. Given light intensity thresholds θ low and θ high , the robots turn right if they sense a light value less than θ low . Otherwise, they turn left until the light value is greater than θ high , when the direction switches back to right. This simple motion results in a zigzag pattern towards the light source. The lower θ d = θ high − θ low is, the faster the frequency of the turns.

Plant-inspired directed growth
Inspired by plant photomorphogenesis, here we use our vascular morphogenesis model to grow adaptive and self-repairing tree structures according to light conditions in the environment. The seed robot has a fixed ID of 0 and every other robot uses a one-byte random ID and keeps it throughout the experiment. The birthday paradox among the robots may seem inevitable (i.e. at least two robots sharing the same ID), however we did not encounter noticeable drawbacks due to ID conflicts and our tests with unique IDs for each robot show a negligible difference in swarm performance. The joining process used here is of higher complexity than that described above, as the tree structure does not necessarily accept a moving robot's request to join. All robots follow a standard messaging protocol and 'narrowcast' to their neighborhood. The message is nine byte in size and includes: the control parameters (S, V , and R); the sum of the children's V ; the ID; the listener's ID in the case of a direct communication channel; the number of children still; whether the robot is looking for a parent; a one bit confirmation message for the listener to join as a child (which is dependent on several factors, explicitly, whether the listener is a moving robot and is a relevant candidate to join as a child, its current state, and a notification of completed joining with confirmation); a message announcing intention to leave the tree; and finally the light level. Similar to the directed aggregation procedure, a joining robot has probability P i to join the tree, in this case depending on the R i available at the point of entry i, given by where R root is the seed resource. If the robot is not saturated and X < Ri Rroot , then the robot is able to get one more child. Accordingly, the seed robot is always able to get saturated, while another robot with low R might get any children. A moving robot considers the content of the incoming message only if it comes from a robot in the tree. Our implementation allows the robots to join and leave the tree structure at any time during the experiments. The possibility of Kilobots pushing each other is reduced by triggering low speeds in the case of close proximity to the tree. When a robot gains a new child, a direct communication channel is virtually established by incorporating the listener's ID in the message. After receiving the confirmation message from a potential parent robot in the tree, the respective joining robot finalizes the process and joins the tree. The parent and child continually update their parameters as long as the connection is available. If this communication line breaks and either of them is not able to hear from the other one for a given period of time, the child robot will trigger the leaving process. The parent robot removes the child from its list and attracts moving robots again. The leaving robot ignores incoming messages for given time period in order to leave the area. Leaving can also be triggered by a lack of R, when R is below the threshold for five time steps. Asynchronous communication disrupts information flow through the branches of the tree, Figure 7. Schema showing the direction of tree growth as a metric. L r shows the direction of the growth and L best is the ideal growth direction towards the light source. The angle between L r and L best is shown as α. Secondarily, showing D 1 and D 2 to measure the distances between the selected seeds and the darkest points in the arena.  which is crucial in VMC for self-organized control of the growth process. Parameters need time to traverse the tree structure and sudden changes demand further verifications to ensure that the tree does not collapse. For instance, while adding a new child the weight V i of a robot i may lead to V i > V all , which means that the R received by the children should exceed that of the parent-however, this is impossible. In our implementation, we prevent these unstable conditions by giving a time buffer and applying some constraints when assigning R. Another of our VMC modifications is specifically relevant for the site selection experiments, where the tree should be able to spread and explore, despite a lack of S in the environ ment. For this case, we allow an even distribution of R when none of the children can supply S to the tree. This allows the tree to expand in a barren environ ment, so that it can explore until it finds an S-rich environment somewhere else. Similar to natural plants, the tree structure continuously grows regardless of its state and size. Therefore, the tree regrows damaged portions, adapting to any environ ment changes in the meantime. The simplified algorithm used for our plant-inspired selfassembly is explained in algorithm 1.

Analysis by image processing
An overhead camera records the experiments. We extract frames from the recorded videos and monitor robot movements over time. First the red channel of each image is isolated and converted to grayscale and noise is reduced with a Gaussian filter. Adaptive thresholding [111] is then applied to certain regions of the image depending on the local light conditions, to extract brighter foreground areas-which show the LEDs of the robots-from the darker background. By merging three consecutive images and applying a global threshold, only the LEDs belonging to stationary robots remain in the image. A blob detection algorithm then counts the roughly circular blobs that represent the LEDs of these robots. As only robots that are part of the tree maintain their position (excluding any stuck at arena corners), stationary robots provide a metric to measure the number of robots in the tree structure. Heatmaps are generated from the footprints of the robots over time to track densities of aggregated robots. Areas with denser footprints indicate longer

Results
For the leader selection and directed aggregation tasks, we present results from eight experiments on real robots. For the adaptation, site selection, and selfrepair tasks, we present results from, respectively, eight, six, and six real robot experiments, as well as results from 20 simulated experiments.

Collective leader selection and directed aggregation
In all eight experiments the swarm succeeds in collectively deciding on a seed robot and location. The swarm then succeeds in all eight experiments to aggregate a static tree structure that is correctly directed toward the light source.
The seeds should ideally emerge at the darkest points of the arena, specifically in the far top right or bottom right corners. As a metric to evaluate leader selection, we calculate the distance between the emerged seeds and the ideal darkest points (shown as D 1 and D 2 in figure 7), and take the lower of the two values. The results show that, in our arena of size 84 × 135 cm 2 , the average distance between the emerged seeds and the ideal points was 41.2 cm.
Nine frames of a selected experiment show the process of the seed emerging and initializing the tree structure in figure 8. In figure 9 the final tree structures of all eight directed aggregation experiments are highlighted, with the seeds from the collective seed selection task marked with thicker green circles. In one of the experiments (see figure 9(d)), two seeds emerge in the same arena. One seed emerges earlier, allowing the majority of the moving robots to join its tree before the second seed emerges. One of the seeds is farther away from the dark arena corners, and we consider this seed in the calculation of average distance to ideal points.
One way to evaluate the tree growth is to qualify the direction of aggregation. The direction from the seed towards the light source can serve as the best theoretical growth direction (shown as L best in figure 7). We find a line (L r ) from the seed through the aggregated tree, such that the sum over the distances of L r to the robots in the tree is the minimum, compared to any other line passing the coordinates of the seed. We then measure the angle α between L r and L best . The deviation (α) is therefore ideally minimized during the aggregation process, with a theoretical best equal to zero. Our results give an average α of 18.15° for the eight seed selection experiments.
High resolution videos and figures from the experiments are available online at Zenodo 4 . As seen in figure 9, the DLA structures formed by directed aggregation demonstrate a phototropic behavior, growing trees leftwards towards the light source. The collectively selected seeds are capable of attracting the majority of moving robots to join their subsequent DLA tree. After an experiment length of 60 min, only three to five robots are still moving. The heatmaps in figure 10 show the footprints of the robots in all eight experiments, individually (a)-(h) and cumulatively (i). Robots that do not join or join at later stages leave shading from their movements, mostly concentrated at the left side. Robots that get stuck while trying to move against a wall or corner leave darker shading at most spots on the arena boundary, except for the right-hand wall. Robot presence is sparser at the right side because the seeds emerge there, and robots close to a seed join the tree early in the experiment. As the trees grow towards the light source, progressively more robots aggregate and join the tree structure. Figure 11 shows that the tree size during all experiments increases over time. The blue area indicates the range between the upper and lower quartiles of the tree sizes and the median is shown with a blue line.

Adaptation to a dynamic environment
In each of the eight experiments with real robots, the swarm succeeds in growing a tree in the correct direction, and then succeeds in adapting to the environment reversal by dissolving its now obsolete tree and growing a new one in the opposite direction. Figures 12(a)-(d) and (i)-(k) demonstrate how the swarm reacts to changes in the light conditions in a selected experiment. The graph representations plotted in figures 12(e)-(h) and (l)-(n) illustrate the logical tree of the grown structure, at the corresponding time step. Initially the swarm contains only a seed robot, forming the root of the tree structure ( figure 12(a)). For 200 s the tree grows rightward toward the bright zone (figures 12(b) and (c)). During 200 s < t 400 s the light conditions transition gradually, to the opposite configuration which is maintained for the experiment Figure 14. Heatmap of all 'adaptation to a dynamic environment' experiments on real robots [15]. remainder (t 600 s). As a result of the light transition the swarm adapts itself, adding and removing robots to the tree, keeping the majority of nodes exposed to brightness. The effect can be observed in figures 12(a)-(d) and (i)-(k), as the structure follows the brighter zone. In the graph representation plots of the trees, the white nodes indicate robots in the structure that are concurrently in the bright area, while the gray and dark nodes represent those in the gray and dark areas. The majority of the tree comprises white nodes at every time step, indicating the effectiveness of our approach in achieving adaptive self-assembly.
Using image processing (see section 3.4), we count and plot the number of robots in the tree structure during the experiments, see a selected experiment in figure 13(a) and all eight experiments in figure 13(b). We use a sliding average to smooth the curve but figure 13(a) shows also the raw data as scattered points (every fifth value). The median sizes of the right (red) and left (blue) tree from all eight experiments are shown in figure 13(b) as well as shaded areas indicating the upper and lower quartiles. For the first 200 s, the tree size is substantially bigger in the bright right-hand zone as expected. For the next 200 s (200 t 400), the tree gradually disassembles, as robots leave the tree, causing a noticeable drop in the tree size. During the final 200 s (400 t 600), the now bright left-hand zone contains the majority of the tree structure. The robot footprints from all eight experiments are addi-tionally plotted in a heatmap (see figure 14), to show the occupancy of the robots in the arena over time.
Here, we examine the cumulative distribution of the robots by superimposing all frames of all experiments, excluding the grey buffer that divides the right and left zones. The dense spots around the boundary show a few robots that get stuck at the corners or walls. The trees in the right zone leave denser footprints than those in the left, because the first trees grown in the experiments get bigger than those grown after adaptation. The two halves of each experiment have the same duration, but in the first half the robots travel freely in the arena from randomly distributed starting positions, giving them a higher chance to find the growing tree structure. In the second half-in addition to many robots starting on the unfavorable side instead of being distributed evenly-some robots have already become stuck at the arena boundary during the first half, giving them a lower chance to find the new tree. This explanation is supported by the tree size observed in figure 13(b), where the gap between the size of the tree on the left and right sides is much larger during the first half than during the second.
For a performance metric, we define the ideal growth direction for the first phase to be straight towards the right of the arena, and for the second phase to be straight towards the left. Similar to the previous task, deviation from the theoretical best is calculated for all experiments. The results show the average deviation α to be 14.21 • in the robot experiments. In simulated experiments of the same setup, a swarm of 1024 robots demonstrates the scalability of our adaptive self-assembly method. The results (see figure 15(a)) show that in the beginning the number of robots in the tree structure-located at the bright side, right-hand-is rising over time (t < 1440 s). After the environ ment change, the tree dissolves from the right side and moves to the newly bright left-hand side. The average α for the simulation runs was 15.12 • . The results obtained from the real and simulated robots are consistent and verify the capability of the swarm to adapt its self-assembled structure to changes in the environment.

Collective site selection
In all six real robot experiments and all 20 simulated experiments, the swarm succeeds in finding and selecting the more advantageous site, and succeeds in adapting its choice after changes in the environment. Figure 16 shows the process of site selection. During the first phase the rightward zone is closer to the seed than the leftward, making the left area harder to reach even though they are equally bright. Therefore, as seen in figure 16(b), the swarm collectively decides to build a tree structure rightward. In the second phase, the gap on each side of the seed is equal, but the rightward zone becomes less bright. As a result, the tree disassembles and rebuilds itself leftward. This shows that our control method not only succeeds in choosing the closest of two bright sites and in distinguishing between the quality of two equally near sites, but also is sensitive enough to balance the factors of quality and proximity and adapt its structure appropriately. Similar to the experiments above, we also provide heatmaps of the results, in figure 17, with one experiment in (a) and (b) and all experiments in (c) and (d). Figure 18 shows the number of robots that reach each lit zone, for a single experiment in figure 18(a) and all six experiments in figure 18(b). These further support the swarm's change of preferred site due to changes in the environment. Figure 15(b) gives the results of the simulated collective site selection experiments, which match our results with real robots, demonstrating scalability of our collective site selection to 1024 robots. The ideal growth directions are similar to the previous task, and the results show the average deviation α to be 9.64° for the real robots, and α = 10.37 • for the simulated robots.

Self-repair of damage
In all six self-repair experiments on real robots, and in all 20 on simulated robots, the swarm successfully regrows its tree structure after the majority of it is damaged. A dark bar is projected in the bright area of the arena, to simulate damage by 'cutting' the structure self-assembled by the swarm. Figure 19 shows a formed structure before projecting the dark bar (t = 200 s),  Figure 20 shows the heatmaps of these same experiment stages. The tree successfully adapts itself to the bright area between the seed and the 'cutting' bar, and repairs itself after the barrier is lifted. The decreased tree size after projecting the 'cutting' bar in figure 21 shows the damage and recovery processes, until the tree grows again. The results obtained from simulation further support the self-repair capability of the swarm (see figures [21][22][23]. The blue area demonstrates the median number of the robots in the tree structure in twenty simulation runs. The tree size suddenly drops around t = 1440 when it is exposed to the 'cutting' bar. Soon after lifting the bar, the damaged area of the tree structure grows back, repairing the self-assemblage (see figure 15(c)). In order to quantify the performance of the robots in recovering from damage in the selfrepair experiments, we compare the maximum tree size before and after damage. An increased tree size after damage indicates a high quality of self-repair. The ratio of the median tree size after damage to the median tree size before damage is 1.07 for the results of the real robot experiments. This demonstrates the success of the self-repair process in growing these trees back to sizes comparable to their pre-damage condition and beyond (ratio of 1). For the simulated robots, the tree sizes after damage and before damage are also comparable but slightly below an expected fully regrown tree, with an average ratio of 0.86. Table 1 summarizes the results of our different experiment scenarios with real and simulated robots. The table shows that on average the seeds emerged close (41.2 cm) to the darkest spots, for the seed selection task. For the tasks of directed aggregation, adaptation, and site selection, we evaluated the deviation of the overall direction of the tree growth from the optimal direction. The average angles of deviation for these scenarios do not exceed 18.15°, indicating reasonably successful and consistent adaptation of growth to environmental conditions. In the self-repair task, we measured how much of the tree was regrown by looking at the ratio of size (after damage to before damage) and find that our system recovers well.

Discussion and future work
Here we discuss certain aspects of our photomorphogenetic control, then the broader issues of scalability and robustness in self-assembly, and finally hardware impacts and limitations.
In our honeybee-inspired approach to leader selection for tree growth, the process is both decentralized as well as probabilistic and may in some cases result in the selection of multiple seeds in one setup. Although the growth of multiple trees is not problematic in our current experiments, future work might investigate the effect of cooperative versus competitive behaviors among multiple photomorphogenetic trees. So far, our leader selection experiments have been calibrated to certain light conditions. Adaptivity could be achieved by dynamically adjusting light thresholds according to the swarm's collective sensor inputs [112]. In our coral-inspired approach to growth of static photomorphogenetic DLA trees, the rate at which individual robots join the tree decreases as the experiment progresses. This is a case of performance decreasing as the density of moving robots becomes further from optimal, a typical phenomenon observed in swarms [113]. Higher performance in later growth stages could be investigated in future work on self-reconfigurability, where robots' behaviors can adapt to the density sensed in the swarm [114].
As mentioned in section 1, robustness is a challenging feature in robot self-assembly. Our proposed approach assembles the robots into branches of a tree (or directed acyclic graph), which are then used as lines of communication, organizing message passing from robot to robot. Part of our robustness challenge is that our relatively involved communication protocol includes a number of robot states (e.g. request to join, confirmed to join). Due to asynchronous communication, pairs of robots can be in any combination of these states at a given time. An explicit consideration of all possible faulty combinations is not feasible. Instead we require robots to conclude their communications within given time windows. If no message is received within the time window, the respective branch of the tree may break and all robots of that branch leave. With increasing tree size-that is number N of aggregated robots-the depth of the tree increases with O(log N) and the lines of communication increase accordingly. In this regard our approach is certainly limited in its robustness. Future work may investigate whether the weights of graph edges between robots can adjust not only according to resource distribution and vascular patterning, but also according to the density and proximity of neighboring robots. If several robots aggregate closely next to each other, they might reasonably be considered equal and redundant in terms of the logical tree structure, providing increased robustness via multiple lines of communication per branch. This would even   In section 3.4 we have shown in simulation that our approach to adaptive self-assembly scales to a magnitude of 10 3 robots. Similar to the above consideration, the round-trip delay time between a leaf robot and the root robot increases with O(log N). These longer point-to-point communication times reduce the rate at which the tree structure can respond to changes in the environment. This speed of communication can be incorporated as a requirement, instead of being accepted as a limitation on scalability. Typically, the rate of communication will be within one second, while changes in the environment would typically occur over at least several minutes. Still, there seems to be no easy fix and only a more decentralized organiza-tion of the tree could help to introduce maximal scalability.
A common issue encountered with Kilobots is the challenging avoidance of corners and walls, as they have a tendency to form clusters there. There are several methods in the literature to deal with this tendency, such as the use of beacons [115], a specialized arena [116], or a sophisticated distribution of light that reflects wall placement in the environment-although our setup already includes the full light spectrum the Kilobot can utilize. We follow a simpler approach of a random walk. This reduces the tendency to cluster at walls as well as the duration of time spent there, but does not entirely eliminate the occurrence of these clusters. In our experiments, the Kilobot light sensor places some limitations on our implementation (see Figure 22. The initial four frames (see figure 23 for later frames), when shown every 9.5 min, of a tree structure formed by 1024 simulated robots during a self-repair experiment. These initial four frames show the initialization (a), early growth (b), later growth (c), and finally damage (d). Resource levels from high to low are green, red, cyan, purple, yellow, and white. Robots in black are not part of the tree structure (LED off). (a) t = 0 min. (b) t = 9.5 min. (c) t = 19 min. (d) t = 28.5 min. section 3.3.1). The Kilobot hardware could be modified in future work to improve light perception, by attaching a light-sensitive diode with through-hole mounting to the board (similar to the original design) and covering up the current light sensor-as suggested in [117]. A new plugin for the ARGoS simulation software with Kilobots has been introduced [118], which improves interchangeability between implementations on real and simulated Kilobots, as compared to Kilombo. Therefore, future work may proceed using ARGoS.
A main contribution of the work here is the achievement of adaptivity. The different parts of the structure grown by VMC are constantly in indirect communication with each other and decide on the shape of the collective by comparing the local conditions in different parts of the environment. Through this communication and comparison, the shape of the structure adapts to the changes in the environment as well as changes in its own structure-that is, selfrepair. In fact, we exploit the main advantage of our VMC algorithm here. On the other hand, there is evidently a limitation on the complexity of self-assembly possible with the algorithm in its current form. Other algorithms have been implemented previously using reaction-diffusion principle with the focus of producing specific shapes. For example, existing work using Kilobots arguably self-assembles more interesting or more varied shapes than our work here [27]. However, such algorithms do not incorporate environmental information and do not maintain adaptivity to the extent we show here. The contribution of the work presented here is not in the details of the shapes formed, but in the achievement of adaptivity. Rather than assembling robots into positions that they maintain indefinitely, adaptivity prioritizes that the robots continuously monitor their environment and make use of a sophisticated distributed communication proto col. A combination of our VMC with other methods focusing on specific shapes may lead to systems that make defined formations while staying adaptive, within a range of specifications of the defined shapes.  figure 22 for earlier frames), when shown every 9.5 min, of a tree structure formed by 1024 simulated robots during a self-repair experiment. These two ending frames show the repair ((a) and (b)) that occurs after the earlier damage (seen in figure 22(d)). Resource levels from high to low are green, red, cyan, purple, yellow, and white. Robots in black are not part of the tree structure (LED off). (a) t = 38 min. (b) t = 47.5 min.

Conclusion
Differences in the desired time-scales of configuration and possible reconfiguration in multi-robot selfassembly constitute fundamentally different application scenarios. If the focus is on using selfassembly to construct architecture or tools, then the time-scales may be big (days, weeks, years). One may tolerate that the configuration of the shape takes long because the self-assembled shape may not be required to be changed for even a multitude of the length of the construction process. However, if one desires to exploit the reconfiguration capabilities of such a system, then the time-scales may be considerably shorter (seconds, minutes, hours). The latter concept requires a high degree of adaptivity in the self-assembly system but also allows for adaptivity to the environment that may then change at similar rates. In an attempt to answer our main scientific question, we have shown in our approach the first implementation of this high degree of adaptivity in a robot swarm that self-assembles into desired shapes. This adaptivity is then exploited to let the swarm quickly respond to environmental changes. The state of the art in multi-robot self-assembly was mostly limited to form static shapes (long timescales of (re)configuration). We have shown a first step into the domain of short time-scale, high adaptivity self-assembly with rather dynamic structures. The high turnover rate of adding robots to the structure and allowing them to leave again creates novel challenges of how to ensure a minimal stability as well as how to balance exploration and exploitation of the assembly.
As in many works on robot self-assembly, we also face the problem of how to implement the next iteration in terms of finding and defining the appropriate hardware approach. Research in modular robotics is making slow progress and concepts, such as programmable matter, are still at an early stage. Future work has to prove that we can govern these hardware challenges but we also require more advanced studies of self-organizing control for multi-robot self-assembly.