Keywords

1 Introduction

After in the mid-1960 the legal foundations for racial discrimination in the U.S. were abolished, the tendency to segregate the population in U.S. cities by race or economical factors kept on going. Thomas C. Schelling studied the question whether this effect was a result of a general intolerance inside the population or if it might be an emerging pattern caused by a system of agents with only a small preference to group with its own kind [68].

To examine this phenomenon, Schelling developed a model of agents with two distinguishable features on a regular grid [8]. For practical reasons he chose to use two kinds of coins on a chessboard as a form of visual representation.

The neighbourhood of an agent can be defined as the eight closest surrounding squares. Looking at this neighbourhood, one can calculate the ratio r of agents having the same feature divided by total number of agents in the neighbourhood:

$$\begin{aligned} r=\frac{n_{same}}{n_{total}} \end{aligned}$$
(1)

This ratio also includes the agent itself. Depending on a threshold th common to all agents, each agent decides based on this ratio whether it is satisfied (\(r \ge th\)) or not (\(r<th\)). In the first case the agent stays in its current position whereas in the second case it moves to another square that meets its requirements. Schelling states that with a threshold \(th \ge 30\,\%\) one can observe a total segregation into regions of a high purity.

Since the publication of the original work a lot of research followed up on different aspects of Schelling’s model. We name only a few that influenced the work presented in this paper.

Brandt et al. examine the dynamics of randomly chosen unhappy agents on a one dimensional ring [1]. The role of randomness is examined by us as well in our probabilistic approach.

Laurie and Jaggi introduce a distance inside which an agent is able to see its neighbours. They study the role of this distance with respect to the stability of the system [4].

Pancs and Vriend discuss the stability of the system and show that even if agents have a preference for integration rather than for their own characteristic, a segregation still can be observed [5].

The work presented in this paper aims on adapting Schelling’s time and spatio discrete model to an algorithm that can be implemented on Eliza-3 swarm robots. We are interested in the question to what extend the effect of segregation can be reproduced.

In the introduction we shortly presented Schelling’s original model. Following the principles of this model we present our own segregation model in Sect. 2. The implementation of the algorithm onto Elisa-3 swarm robots is described in Sect. 3. Section 4 outlines the setup used for the experiments we conducted in order to analyze the resulting behavior of our model. The data obtained hereby is then interpreted in Sect. 5. We conclude our findings in Sect. 6 and give an outlook on future research options enabled by our setup.

2 Development of a New Continuous Segregation Model

The objective of this work is to examine to which extent the observations Schelling made on his model can be reproduced by an adapted model implemented on real swarm robots.

The original model works with spatio-discrete squares arranged as a two dimensional grid. The agents’ moves are round based and not limited in the distance they can travel within one discrete time step. To transform this model into a continuous one which respects the properties of real physical swarm robots several adaptations have to be made which are presented in this section.

2.1 Redefining the Neighbourhood

In the original discrete case the neighbourhood of an agent is defined as the agents in the eight squares surrounding this agent. This method works well on a grid in which only discrete positions are allowed. In the case of spatial continuity a different approach to define a neighbourhood is needed.

Instead of considering agents within a certain range as a neighbourhood, we chose a density based algorithm to form clusters of agents. To be able to recognize interdependent groups of different shapes we defined groups as clusters using the Density-Based Spatial Clustering of Applications with Noise - algorithm (DBSCAN) [2].

This algorithm is used to form clusters based on the position of each agent at a given time step. Information on the cluster an agent is affiliated with is passed on to it.

2.2 The Two Basic States of Agents

Similar to Schelling’s model each agent knows two states: satisfied in which the robot is stationary and searching in which it is moving. The decision making process is based solely on four variables determined by the clustering algorithm. The first two variables are the number of agents of the same feature \(n_{same}\) and the number of agents in total \(n_{total}\). These values respect only stationary agents. The so called extended cluster consists also of agents in motion that in this instant also are to be considered inside the cluster. The number of moving entities in the extended cluster are named \(n_{same,moving}\) and \(n_{total,moving}\). Clusters can also consist only of moving entities. This case is needed to form new clusters later in condition (5).

We define a function S(r) to determine if an agent is satisfied depending on the given ratio r as defined in (1). In accordance with the original model by Schelling we define:

$$\begin{aligned} S(r):= {\left\{ \begin{array}{ll} true &{} r \ge th \\ false &{} r < th \end{array}\right. } \end{aligned}$$
(2)

Satisfied. In this state the agent is stationary but constantly checking the conditions of the cluster it is affiliated to. The decision of an agent to leave the cluster, i.e. changing from satisfied to searching and to start moving, is made as soon as the ratio of agents having the same feature compared to total number of agents in the cluster drops below the threshold:

$$\begin{aligned} \lnot S\Big (\frac{n_{same}}{n_{total}} \Big ) \Rightarrow \text{ leave } \text{ cluster } \end{aligned}$$
(3)

This can occur if for example agents of the other kind join the cluster or agents with the same feature leave the group.

Searching. In this state the agent is moving linear inside the available plane, changing direction only to avoid collision with other agents or with the border. As soon as an agent reaches the proximity of an existing cluster, i.e. is a member of the extended cluster, it decides on joining it. This decision is based on whether the agent would feel satisfied if it would join the cluster. This condition is expressed as follows:

$$\begin{aligned} S\Big (\frac{n_{same} +1 }{n_{total}+1} \Big ) \Rightarrow \text{ join } \text{ cluster } \end{aligned}$$
(4)

So far an agent can only join an existing cluster. To form new clusters, we decided that a minimum of three agents is needed in order not to form too many small groups. This is expressed as:

$$\begin{aligned} n_{total,moving} >2 \wedge S\Big ( \frac{n_{same,moving}}{n_{total,moving}} \big ) \Rightarrow \text{ new } \text{ cluster } \end{aligned}$$
(5)
Fig. 1.
figure 1

Plot for different parameters k in the distribution \(P_k(r)\) (6) for \(th=0.5\)

2.3 Probabilistic Approach to State Changes

So far the threshold th is a fixed constant common to every agent. In order to make the scenario more dynamic and also more realistic we allow the decision function S(r) to be probabilistic.

We introduce a uniform distributed random variable \(x \in [0,1]\) and a probabilistic function \(P_k\)

$$\begin{aligned} P_k(r) = \dfrac{1}{e^{ k \cdot (r-th) }+1} \end{aligned}$$
(6)

\(P_k(r)\) describes an agent’s probability of being satisfied with a given ratio r and threshold th. The parameter k defines slope of the distribution as shown in Fig. 1. For the case \(k \rightarrow \infty \) the distribution behaves like a binary decision function similar to (2). We can then redefine S(r) as

$$\begin{aligned} S(r,x):= {\left\{ \begin{array}{ll} true &{} x \ge P(r) \\ false &{} x < P(r) \end{array}\right. } \end{aligned}$$
(7)

3 Implementation on Swarm Robots

We chose Elisa-3 robots produced by GCTronic [3] as a platform to implement our segregation model. They have a differential drive with magnetic wheels to improve the adhesion to a metal surface. This allows for controlled motions up to a velocity of while at the same time having a diameter of only 5 cm. This is an advantage over the systems driven by vibration motors as they tend to move slower leading to a longer duration of the experiments.

Our segregation model as described by Eqs. (6) and (7) is implemented directly in C on the Atmega 2560 microcontroller of each Elisa-3 unit. In case of a dissatisfied, i.e. moving robot we make use of the collision-free driving behaviour provided along with the Elisa-3 software. This function uses the eight infrared proximity sensors around the robot to prevent collisions by adjusting the speed and direction of the wheels sophisticatedly. This results in a linear movement when possible and a deflection from obstacles such as the borders or other Elisa-3 units.

The onboard RGB LED indicates the affiliation to a group by showing either a green or blue color. A video stream taken from a camera overlooking the experiment is analyzed to trace each individual robot. The DBSCAN algorithm is then applied to find clusters of entities as described in Sect. 2.1. A radio transmitter sends four variables to each entity:

  • The number of stationary robots in the cluster of the same color (\(n_{same}\))

  • The number of stationary robots in the cluster (\(n_{total}\))

  • The number of robots in motion in the cluster of the same color (\(n_{same,moving}\))

  • The number of robots in motion in the cluster (\(n_{total,moving}\))

The decision making process of the swarm behavior remains on the entity itself, the camera system only emulates a sense of vision for each unit.

The following pseudo code shows the implementation of the probabilistic approach

figure a

Using this function, our segregation model can be reduced to a state machine with two basic states:

figure b

The conditions for a state change are explained in Sect. 2.2. The waiting time of 2 s between the state changes is needed especially for the probabilistic behaviour to achieve stable decisions which are not reverted in the following iteration.

The following section describes how this algorithm’s effects are measured.

4 Experiments

4.1 Setup

For the experiments a plane of 118 cm \(\times \) 88 cm is used. Borders prevent the 30 Elisa-3 robots from leaving the area. Figure 2 shows the setup with robots forming clusters during an experiment.

Fig. 2.
figure 2

Elisa-3 units forming clusters during an experiment

The image recognition system described in the previous section is also used to log the number of units respective to their colors in each cluster. This information is available for every image frame of the camera resulting in a sample frequency of 15 Hz.

Prior to an experiment the robots move for 30 s on the plane without forming any clusters. This assures a random and homogeneous distribution at the starting point of each experiment.

A transition period between this random initial state and a behavior that is characteristic is to be expected. Several measurements each over a length of 5 min were performed to determine the end of this transition phase in order to prevent sampling non-characteristic behavior. The results show that starting after one minute for the duration of another minute is an adequate time frame for sampling data in an experiment.

4.2 Variations

Experiments were performed for a threshold of

$$th\in \{1\,\%,10\,\%,20\,\%,30\,\%,40\,\%,50\,\%,60\,\%,70\,\%,80\,\%,90\,\%,100\,\%\}$$

and a distribution parameter of

$$k\in \{{10},{20},{60},{110},{160}\}$$

Each experiment was repeated three times resulting in 165 experiments with a total of 148500 data sets. There is a fixed number of 15 blue and 15 green robots in each experiment, each having the same value for th and k.

Fig. 3.
figure 3

Forms of microscopic effects

5 Results

5.1 Microscopic Effects

We can observe the following 5 basic effects that determine the swarm behavior on a microscopic level which are shown in Fig. 3.

  1. 1.

    Formation of a new cluster by three robots.

  2. 2.

    The simultaneous arrival of two robots to a cluster with a different dominant color leads to a satisfactory condition for both entities. This might not be the case if only one would have arrived depending on the threshold.

  3. 3.

    One robot leaving a cluster worsens the ratio for other robots of the same color. If as a result the remaining robots of that color decide to leave the cluster as well this effect is called reaching a tipping point. A completely segregated (pure) cluster is the result.

  4. 4.

    An arriving robot leads to a merge of two clusters of the same dominant color.

  5. 5.

    An arriving robot connects two clusters of different dominant colors, which results in the cluster breaking up.

These effects on a microscopic level lead to phenomena on system level which will be analyzed in the next section.

5.2 Macroscopic Effects

Graphical Representation. To analyze the overall behavior of the system, a graphical representation of the data obtained by the large sets of experiments is needed. We developed a diagram that combines several aspects needed in order to draw conclusion from the measurements.

Each diagram shows all experiments for one value of k. Each column in this diagram represents the results obtained with one threshold th. Each box in this column represents a specific cluster size indicated on the x-axis.

Fig. 4.
figure 4

Diagram with k=10

For example the box in the bottom left corner in Fig. 4 shows that for the experiments with \(th=1\,\%\) about half of the robots were unclustered. This can be determined by comparing the shade of the box to the scale on the left of the diagram. The box above represents a cluster size of 3 robots. The shade on the left half shows that in average only a few robots can be found in a cluster of that size. The shade on the right half shows that the average purity p of that cluster is very high. The purity is defined as

$$\begin{aligned} p=\frac{n_{dominant\ color}}{n_{total}} \end{aligned}$$
(8)

The next box in top direction represents clusters with the size of 4 and so on. One column of boxes to the right the results of the experiments with a threshold of \(th=10\,\%\) can be seen.

With the help of these diagrams we interpret the data obtained from our experiments.

Fig. 5.
figure 5

Diagram with k=20

Interpretation. Looking at the experiments with \(k=160\) (Fig. 8) which is the case of a sharp binary decision criterion the following observations can be made: The number of unclustered and therefore unsatisfied robots increases with the threshold. For \(th < 30\,\%\) the overall cluster purity is very low compared to the cases with \( th \ge 30\,\%\). This means a segregation takes place starting with a threshold of \(th\approx 30\,\%\) Furthermore the number of large clusters decreases for higher thresholds.

Fig. 6.
figure 6

Diagram with k=60

Fig. 7.
figure 7

Diagram with k=110

Smaller values for k (see Figs. 4, 5, 6, 7 and 8), which equals a softer, more probabilistic decision making process, lead to a higher purity even for thresholds smaller than \(30\,\%\). Figure 4 also shows that smaller k produces more unclustered robots for \(k>30\,\%\).

The results point to a behavior similar to the one observed by Schelling. Even when requiring only about 30 % of the same color in a cluster, an almost total segregation can be observed. This effect is amplified when introducing a probabilistic decision criterion.

Fig. 8.
figure 8

Diagram with k=160

6 Conclusion and Outlook

In this paper we successfully adapted Schelling’s discrete model to a new model that can be applied and studied using swarm robots. We transformed it from a round based model on a grid to a spatiotemporal continuous algorithm implemented on the Elisa-3 swarm robots.

The experiments we conducted reproduce Schelling’s original observation that a total segregation can already occur even if the entities have a high level of tolerance. Furthermore, by introducing a probabilistic approach to replace the decision criterion of a binary threshold we could amplify this effect.

So far we performed experiments with a fixed set of parameters common to all entities. In further research we plan to experiment with entities each having a unique set of parameters. It is also possible to implement an assimilation process so that entities can change their characteristic to adapt to the dominant feature. Also an equal distribution of 15 blue to 15 green robots have been analyzed so far. The effects of having a dominant majority seems also worth to study.

It can be concluded that the model we presented in this paper successfully reproduces Schelling’s original study on a swarm robot platform. Our setup can serve as a platform for further experiments.