• No results found

A study of algorithms for 2-dimensional self-assembly in swarm robotics

N/A
N/A
Protected

Academic year: 2021

Share "A study of algorithms for 2-dimensional self-assembly in swarm robotics"

Copied!
39
0
0

Loading.... (view fulltext now)

Full text

(1)

DEGREE PROJECT, IN COMPUTER SCIENCE , FIRST LEVEL STOCKHOLM, SWEDEN 2015

A study of algorithms for

2-dimensional self-assembly in swarm

robotics

ADDRESSING THE LIMITATIONS OF EXISTING

SELF-ASSEMBLY ALGORITHM THROUGH

COMPUTER SIMULATION

AXEL BOLDT-CHRISTMAS AND BONNY WONG

(2)

A study of algorithms for 2-dimensional

self-assembly in swarm robotics

Addressing the limitations of an existing self-assembly algorithm through computer simulation

AXEL BOLDT-CHRISTMAS BONNY WONG

Degree Project in Computer Science, DD143X Supervisor: Michael Schliephake

Examiner: Örjan Ekeberg

(3)
(4)

Abstract

Intelligent Control is a novel way to solve problems involv-ing the control of complex systems in many areas. Among these areas are multi-robot systems. Swarm robotics is a multi-robot system that is inspired by natural swarms such as ones found among social insects.

(5)

Referat

En studie av algoritmer för 2-dimensionell

självorganisering inom svärmrobotik

Intelligent kontroll är en intressant metod som kan använ-das för att lösa problem som involverar kontroll av kom-plexa system inom många områden. Bland dessa områden ingår multi-robot system. Svärmrobotik är ett multi-robot system inspirerad av naturliga svärmar likt de man finner bland sociala insekter.

(6)

Contents

1 Introduction 1 1.1 Purpose . . . 2 1.2 Problem statement . . . 2 1.3 Structure . . . 2 2 Background 3 2.1 Swarm robotics . . . 3

2.1.1 Definition and Characteristics/Properties . . . 3

2.1.2 Robots . . . 4 2.1.3 Self-organization . . . 5 2.1.4 Application . . . 5 2.2 Control systems . . . 6 2.2.1 Open-loop systems . . . 6 2.2.2 Closed-loop systems . . . 7 2.2.3 Control methods . . . 7

2.3 Intelligent Control Systems . . . 8

2.3.1 Techniques for IC . . . 8 2.4 Rubenstein’s Algorithm . . . 9 2.4.1 Initial State . . . 9 2.4.2 Shape algorithm . . . 10 2.4.3 Limitations . . . 11 2.5 Math / Algorithms . . . 11

2.5.1 Law of Sine / Triangulation . . . 11

2.5.2 Point Inclusion in Polygon Test . . . 11

3 Method 13 3.1 Concept and Motivation . . . 13

(7)

3.2.4 Shape algorithm . . . 17

3.3 Implementation . . . 17

3.3.1 Simulation . . . 18

3.3.2 Shape Forming algorithm . . . 19

3.4 Metrics . . . 19

3.4.1 Coverage . . . 19

3.4.2 Shapes . . . 19

4 Results 21 4.1 Experiments . . . 21

4.1.1 100 Agents – Four Simple Shapes . . . 21

4.1.2 100 to 300 Agents – Different Complex shapes . . . 21

5 Discussion 25 5.1 Simulation . . . 25

5.1.1 Discrete Iteration . . . 25

5.1.2 Long Range Communication . . . 26

5.1.3 Sensor and Motor Errors . . . 26

(8)

Chapter 1

Introduction

Swarm robotics is an area that draws its inspiration from behaviors found among social insects such as bees or ants. Researchers are interested in how the seemingly simple nature and interactions of such insects still manage to give rise to many com-plex behaviors [9]. By mimicking these social insects using simple robots, attempts have been made by researchers to create robotic swarms with the goal of solving various problems.

One of the problems regard the forming of geometrical shapes. The idea is that different geometrical shapes can be formed by swarm robots, merely through interac-tion at local levels. Soluinterac-tions such as the shape forming algorithm by Rubenstein[7] exists and have been tested on real physical swarm robots.

A swarm of robots is a complex systems that needs to be controlled in some way in order to act accordingly. For such tasks, control systems are used. A control system can be seen as a collection of components that work together in order to process an input and to produce an output. Control systems are used in situations where the behaviors of a system need to be monitored and modified [2].

Within the recent decades many new methods for modeling control systems have been developed. Methods such as Intelligent Control (IC) that relies on com-puter intelligent rather than human intelligence has become increasingly popular. Whereas Classical Control (CC) requires a human designer to model a system, IC relies on cleverly constructed algorithms instead [11].

IC allows for the modeling of a system without all the details being available [11]. This makes IC methods useful when a complex system such as a robotic swarm needs to be modeled. In a robotic swarm several hundreds of robots may interact with each other to create a desired behavior, modeling such a system through classical methods would be a hard task to do.

(9)

CHAPTER 1. INTRODUCTION

1.1

Purpose

Swarm robotics is an area that has seen an increase in popularity. While the area is still relatively new, many projects exists that explores the potential uses of swarm robotics.

The purpose of this thesis is to get an insight into the field of swarm robotics and self-assembly in two dimensions. It will examine an existing shape forming solution within swarm robots as described by Rubenstein and it will try to address some of its limitations.

1.2

Problem statement

This thesis will investigate a two-dimensional self-assembly algorithm in swarm robotics as described by Rubenstein[7], and if improvements and modification can be made to address some of its limitations.

1.3

Structure

This thesis is divided into several sections that aim to provide the reader with the background, methodology, discussion, results and finally the conclusion in a structured manner.

The background will give the reader some of the background and theory that this thesis is based on, which includes a general introduction to swarm robotics and control systems. Furthermore, the related work and the most vital mathematics are explained.

In the methods chapter, the entire implementation process is detailed. The concept involving the agents and environment is explained followed up with the algorithms that builds up the simulation of self-assembling swarm robots.

(10)

Chapter 2

Background

In this section the background and theory behind this thesis is provided. The first section aims to give a broad picture of what swarm robots are are and how they work. In the section that follows control systems, which plays an important part in swarm robotics are explained. The latter sections will explain Rubenstein’s work and also essential math that are used in method section.

2.1

Swarm robotics

Swarm robotics is an area that aims to study how the design of small and simple lo-cally interacting robots may give a desired collective behavior. Its inspiration stems from the behavior found among social insects such as bees, ants or termites [9]. A single member of the colony is rather insignificant. It has a limited knowledge about its environment and is only capable of carrying out simple tasks. However when working in groups complicated tasks such as building large self-regulating structures or maintaining a colony of thousands and thousands of individuals becomes doable, despite the lack of a centralized leadership. All these complex actions are the results of their local interactions with each other [6]. Swarm robotics aims to mimic these properties found in nature in order to apply them to problems in our world.

2.1.1 Definition and Characteristics/Properties

From othe bservation of natural swarms, three important properties have been iden-tified that any multi-robot systems should exhibit. These are robustness, flexibility and scalability [9]. They all relate to the adaptability of natural swarms and their ability to perform tasks despite a changing environment.

Robustness: A robust swarm robotic systems prevents malfunction or

(11)

CHAPTER 2. BACKGROUND

should not affect its operation, since a swarm is decentralized an no informa-tion is kept by a specific robot. Environmental changes should also not affect the overall perception of the swarm since any sensing is done locally by each individual robot [8].

Flexibility: The swarm robots should be flexible enough to be able to complete

tasks despite of the varying environment. Among social insects different strategies are used to find the shortest path to a food source or when car-rying a large prey back to the colony. The path to the source of food and the prey will always vary, but same methods are applied to solve the problem. A robotic swarm should also possess the capability of being flexible [8].

Scalability: Scalability refers to the swarms ability to work with a varying number

of members. Ultimately the loss or gain of robots should not affect a swarms ability to perform a task significantly [8].

These three properties are important for swarm robotic system, although they are not the distinguishing features of a swarm robotic system. There are a number of criteria used to separate a swarm robotic system from other multi-robot systems. Navarros[6] gives five main criteria:

1. A member of the swarm must be able to sense and move autonomously in the

physical world.

2. There must be a larger number of robots, so that a swarm is formed. 3. The robots must be homogeneous.

4. Cooperation is required for a task to be solved.

5. The robots can only have local sensing and communicative capabilities.

2.1.2 Robots

While the combined efforts of a swarm robotic system may be impressive, they are still only carried out by simple robots. A general robot consist of the actuators, the processor, the sensors, some kind of communication device and sometimes a positioning system.

The actuators provides the means for a robot to move. It may be wheeled or use legs, more novel ways such as using vibration as shown by Rubenstein[7] may also be used to change the position of the robot.

(12)

2.1. SWARM ROBOTICS

A positioning system is sometimes also used in order to allow robots to locate themselves in a swarm, IR sensors are often used for this task.

Lastly a processor is required in order to process the information from the sensors and also to control the robot itself. It is essentially the brain of the robot [6].

Due to these components the design of swarm robotic system also puts require-ments on the robots themselves. While restrictions are less strict in the simulation of swarm robotics, a real world swarm robot is limited by a number of factors. One has to balance the functionality of a robot with the cost, so that it both can perform necessary task and at the same time be cost-effective [5]. Just applying the most expensive components doesn’t necessary have to mean it will perform better, and aside from that it will raise the cost of the robot. While not necessary to account for in simulations, attributes such as power, cost and size are important to consider when swarm robots are to be applied in the real world. So while they may be simple robots, the designing of a "perfect" robot is still a task that requires time.

2.1.3 Self-organization

One noteworthy feature that natural swarms possess and that swarm robotics aims to replicate is self-organization. Self-organization can be explained as the organiza-tion that appears when individuals interact with each other and the environment [6]. It is one of the coordination mechanisms that exists in natural swarms and is based on positive and negative feedback that appears at local levels of interaction. The behaviors that causes positive feedback generally causes the triggering of the same behavior, negative feedback is introduced to provide stability. Often negative feedback is related to when resources or depleted or when goals are met [8].

2.1.4 Application

Swarm robotics have many potential application areas. While current technology may limit its uses in real world situations, research and development are making progress to make robots cheaper and components better. Sahin[8] mentions several possible domains of application, among them areas that involves covering geograph-ical regions or environments deemed too dangerous for humans.

Work that covers a region may involve tasks such as environmental monitoring of forest or lakes. A swarm robotic system would be able to sense its environment for hazardous events such as forest fires or oil spillage. The communicative prop-erties of swarm robots and self-organizing nature may allow it to quickly relay this information to humans and even allow themselves to correct the problem.

(13)

CHAPTER 2. BACKGROUND

2.2

Control systems

A swarm of robots is a complex system that needs to be controlled. For such pur-poses, control systems are used. A control system can be thought of as a collection of components that together perform a task so that a desired state or behavior a system is obtained [1]. They are systems that process inputs in order to give a desired output. Since the definition of a control system is wide, their area of ap-plication varies greatly. The act of keeping an airplane on the correct course and altitude, maintaining the pressure and temperature inside an oil tank or maintain-ing the velocity of a car are all tasks that can be achievable by the use of control systems [1].

Sometimes a control system reuses an output signal for error correction or other purposes, thereby creating a loop back to itself. This loop is referred to as the feedback loop. Depending on the existence of a the feedback loop, a control system may be called either a closed or an open system [2].

2.2.1 Open-loop systems

An open-loop system is a type of control system that lacks feedback loop, hence it is "open". As a result of this open-loop systems are never aware of its own output and will not be able to perform actions such as self-correction which is dependent on receiving an output signal back in order to compare it with a desired signal. Open systems are generally very simple and consists only of input and output signals [2]. Their simplicity is also the reason for their wide use since it also means that they are more cost-effective.

Process

Input Output

Figure 2.1: An open-loop system.

(14)

2.2. CONTROL SYSTEMS

2.2.2 Closed-loop systems

A closed system is based on the existence of a feedback loop. By measuring the output signal that is produced more complex actions can be performed, among them actions such as error correction as it now is possible to compare the given output with a desired output. These systems essentially allows a variable to form relationships with other variables and allow their differences to be used for control purposes [2].

Process

Input Output

Measurement Inspection

Figure 2.2: A closed-loop system.

Figure 2.2 shows how a close-loop system may look like. The output signal is measured and sent back to the beginning of the system. The input and the feedback is inspected to see if any corrections can be made in order to get closer to the desired output.

Closed-loop systems can be found in many places. Examples of closed-loop sys-tem often incorporate self-correcting actions. Examples may be an air-conditioning system. The input signal is the desired temperature and the output is the current temperature of the room. The feedback signal is compared to the input to see if any action has to be taken to lower or raise the temperature of the room.

2.2.3 Control methods

The feedback loop is not the only distinguishing feature of a control system. They can be further divided into groups depending on how the system is modeled and how it works. Two groups are usually identified, the Classical Control(CC) systems and the Intelligent Control(IC) systems [11].

Classical Control

(15)

CHAPTER 2. BACKGROUND

Intelligent Control

An IC system differs from CC systems on a number of points. It is an approach that essentially does not require a human designer, which also has made it to be known as the "Lazyman’s method". Only the behavior of a system needs to be known for an IC system to work. The details and mathematics are left for the IC system itself to figure out via the use of clever algorithms. As a result of this, IC can be used to model systems with high complexity using lesser effort than CC [10].

2.3

Intelligent Control Systems

An intelligent approach in creating and using control systems refers to the use of methods inspired by biological intelligence to model a system [10]. The idea is that by using a limited set of information and these intelligent methods, the IC system will be able to abstract the model itself. The underlying details does not need to be fully known, neither by the human designer or the control system itself [11]. Such methods are suitable to be used for swarm robots, as they are hard to model precisely. And it’d seem suitable to use control methods inspired by nature to control a system also inspired by nature.

2.3.1 Techniques for IC

Several techniques exists that draws its inspiration from nature. For this thesis Fuzzy Control was used in the control of the robotic agents.

Fuzzy Control

The Fuzzy Control approach attempts to mimic how a human brain handles control situations. A human reasons in approximate manners and in many cases can not give an absolute answer to questions that asks for a specific quantity. If asked about what the temperature is or how windy it is rarely can a human give an exact measurement, instead approximate answers such as "hot", "very hot", "very windy" and so on are given [11]. With the human mind as inspiration fuzzy control is sometimes used for control systems. The process of using fuzzy control is divided into several important steps as explained by Smith [11] and Samad[10].

• Rule system: A set of rules need to be defined in order to know how the control is to be executed.

• Fuzzification: The inputs are transformed into sets that are used later during the inference process.

(16)

2.4. RUBENSTEIN’S ALGORITHM

• Defuzzification: A process that returns back the true value from the fuzzy sets.

An example given by Smith[11] is the controlling of distance between two cars

A and B. Three variables are defined, the distance D between the cars, the velocity

of v of car B and the breaking force F that is needed to be applied by car B. The input variable are D and v, while the output is the force F.

These three variables goes through the fuzzification stage and given three subset intervals as shown in figure 2.3. Depending on the value of the input, they get placed into respective set, in this case D and v may be placed in set low, medium or high and the output F may be placed in subsets small, medium or big. It is here where the rule system and inference comes into play. A rule may say that if D is within the medium subset and if the velocity is withing the high subset then the breaking force F applied should be big. Finally the the output is defuzzified so that a numeric result that can be applied to the brakes is given.

Figure 2.3: Fuzzy subset intervals [11]

2.4

Rubenstein’s Algorithm

In this section a description of the collective self-assembling shape forming swarm algorithm presented in Rubenstein’s paper[7] will be given. Rubenstein’s algorithm is the basis for the algorithm used in this paper and a general understanding of it is required to know what adaptation this paper has done to it.

2.4.1 Initial State

The algorithm described by Rubenstein requires a very specific setup. Their agents are simple circular robots which can rotate fully around their own center as well as move straight forward in a single direction. They also have an infrared sensor that is used to communicate basic information and to find the distance from other surrounding agents.

(17)

CHAPTER 2. BACKGROUND

2.4.2 Shape algorithm

The robots starts by forming a gradient by using its infrared communication sensors. To get their gradient number an agent picks the minimum gradient number of adjacent agents and adds one to it as seen in figure 2.5b. The highest gradient robots then start moving along the edge in a clockwise motion around the rest of the robots by trying to constantly maintain a fixed distance from the closest robot as shown in figure 2.5a.

The robots are actively trying to ascertain their position by localizing based on distance information of already localized robots. This is done by selecting the position which minimizes the sum of the difference of distances to the other localized agents as seen in figure 2.4.

When the robot is edge-moving inside the shape it stops moving when it is about to exit the shape or is next to another robot of the same gradient as itself.

Figure 2.4: Localization [7]

Figure 2.5: Features of Rubenstein’s algorithm [7]

(18)

2.5. MATH / ALGORITHMS

2.4.3 Limitations

While Rubenstein’s algorithm works well for forming shapes, it does have certain limits. The seed agents need to be placed along the edges of a shape that is intended to be formed. Furthermore the other robots needs to be clumped together within the immediate proximity of the seeds and they are not allowed to be within the shape when the algorithm is initialized. As a result the setup is very specific and not as flexible as could be desired.

2.5

Math / Algorithms

In this section the non-trivial math properties and algorithms used in the method described in this paper are explained.

2.5.1 Law of Sine / Triangulation

The localization part of the method presented in this paper makes heavy use of triangulation based on the law of sine. Given three points A, B and C they form in-between them a triangle as seen in figure 2.6. If only the point A and B as well as the angles α and β are known it is possible to obtain the point C. The length c is obtained using Pythagoras theorem and the angle γ using the sum of angles in a triangle. The lengths a and b are obtained using the law of sine:

a sin α = b sin β = c sin γ

With this information the exact position of point C can be obtained.

Figure 2.6: Triangle

2.5.2 Point Inclusion in Polygon Test

(19)

CHAPTER 2. BACKGROUND

I run a semi-infinite ray horizontally (increasing x, fixed y) out from the test point, and count how many edges it crosses. At each crossing, the ray switches between inside and outside. This is called the Jordan curve

(20)

Chapter 3

Method

This section details the approach that was used to implement the solution to the problem statement. Below the algorithm, environment and concept will be ex-plained in detail as well as the implementation and emulation of said things. The method described here is based on the collective swarm robotics algorithm described by Michael Rubenstein, Alejandro Cornejo and Radhika Nagpal in their paper “Pro-grammable self-assembly in a thousand-robot swarm” [7]. It aims to adapt the al-gorithm to robots with different capabilities and introduce a clustering component to eliminate some of the limitations of the original algorithm.

3.1

Concept and Motivation

As described in the problem statement the concept is about having swarm robots form predefined shapes in a two-dimensional environment. The emulation exists two parts, the swarm which is made up of the robot agents that executes the self-assembly algorithm and an environment in which the swarm resides in.

Rubenstein’s algorithm is as mentioned in the background section, not very flexible. One of the key features of swarm robotics is flexibility. By removing some limitations such as the strict positioning of seed-agents and regular agents the shape forming algorithm will be able to work with greater flexibility and with greater similarity to real swarms.

3.1.1 Agents

(21)

CHAPTER 3. METHOD

of movement in the two-dimensional plane as a generalization for adaptability and ease of implementation.

The robots also have two different types of communication. One long range communicator which can pulsate information in all direction. This communicator also have a corresponding receiver that can receive pulses from other units, the receiver is able to deduce the angle of incoming signals and their strength. The other type of communication is a proximity communication which can be used to deliver data to adjacent robots, this type of communication is more reliable in accuracy as the communicating units are guaranteed to be close in proximity with nothing in between them. In contrast to Rubenstein’s robots these communicators have no capabilities to tell the distance of the other communicator but does instead rely on the ability to determine the angle, or direction of the communication.

When it comes to the computational abilities of the robots they have a finite memory and limited processing power. This means they cannot keep information about the whole swarm in memory. Indeed the only thing the robots keep in mem-ory is a two-dimensional bit vector which represents the image they are trying to form, a couple of counters, storage for one long range package and six proximity packages and a handful of floats and Booleans for keeping track of state and posi-tional information. For processing the most advanced calculations it has to do is some float point number calculation for triangulation including trigonometric base functions like sine and cosine. The execution of one evaluation of the state is upper bound by a constant time complexity.

3.1.2 Environment

The environment is a simple flat two-dimensional infinite surface. The image of the shape which the swarm is to form is a two-dimensional array consisting of Boolean pixels which determine if a pixel is to be filled or not. There are also four seed robot agents which are placed beforehand inside the shape and know their own position. As these agents never move and do not act like any of the other robots in the swarm they can be seen as being a part of the environment as well as of the swarm. Their purpose could just easily be seen as beacons that are part of environment instead of stationary agents that are part of the swarm.

3.2

Algorithms

(22)

3.2. ALGORITHMS

they find a position inside the shape that is suitable. When a predetermine number of steps have passed without an agent finding a suitable slot in the shape has passed all agents switch back to the initial clustering state and repeat the algorithm, thus forming the shape.

3.2.1 Initial State

The initial state is created by placing four seed agents together at any random position inside the shape with knowledge of their own exact location. The rest of the agents are then placed randomly anywhere on the surface. Each unit is aware of the size of the swarm so that the scale of the shape can be determined. The scaling is balanced so that the robots total area is 90 percent of the total area of the shape.

3.2.2 Clustering algorithm

All agents (except the seeds which are always in the seed state) start in this state. Here they use their long range communication to create a gradient which they can follow. This gradient is formed by each agent pulsating information of their own gradient number. Agents obtain their gradient by selecting the best incoming signal and adding one to it. What determines what is the best signal is by taking the signal with the highest signal strength and looking at all incoming signals within a certain margin of that signal strength and selecting the lowest gradient number.

At each step after obtaining the best incoming signal the agent tries to move towards the origin of that signal. The result is that the agents start to cluster up towards the seeds and the shape, as shown in figure 3.1. After a finite number of steps the units switch over to the localization state.

Figure 3.1: Agents moving toward the seeds.

3.2.3 Localization algorithm

(23)

CHAPTER 3. METHOD

agent selects the gradient of the lowest surrounding unit and adds one to it for itself. Thus the seeds have the lowest gradient number and each subsequent layer of units have one higher with the outward most agents having the highest gradient numbers. This can be seen in figure 3.2a.

To find each agents location the algorithm starts from the seeds and moves out-wards using proximity communication. The locations are determined using triangu-lation and fuzzy logic controller. Each agents have three states, certain, uncertain and unknown. They all start out being unknown except for the seeds which are

certain. Each agent will receive the perceived location and the state of all adjacent

agent using proximity communication, if their state is unknown they are ignored otherwise their information is used to determine the location of the agent. The state of the agents location is selected based on the number of certain data points and the gradient number of the agent as errors have propagated further at higher gradients.

If only one proximity data point is known the agent moves towards the source as far as it can and then assumes it location to be on the line that the trajectory formed one robot diameter from the location of the other agent. In this case the location state is always set to uncertain.

In the case of two or more proximity data points the agent uses pairwise tri-angulation using the law of sine and taking the average location of these pairwise calculations. If the state is determined to be uncertain the agent stays in the local-ization state for a few steps more trying to obtain a better state before going to the next state. If the location state however is certain it switches directly to the next state.

The next state is either the shape state or the done state. This is chosen de-pendent on if the perceived location is within the shape. If it is the agent goes to done state where it stays until it has not received a done signal for a predetermined amount of time and switches back to the initial cluster state. If the agent is not in the shape however it switches to the shape state.

Figure 3.2: Localization phase.

(a) Agents given a gradient.

(24)

3.3. IMPLEMENTATION

3.2.4 Shape algorithm

In this part of the algorithm the agents that are not inside the shape start moving clockwise around the rest of the swarm until they find a suitable location inside the shape. Each agent using proximity communication determines if there are no higher gradient agents adjacent to the agent and then starts moving around the swarm. This is done by moving directly left to neighbors. When the robot enters the shape it continues moving until it is about to exit the shape where it stops and switches to the done state as well as send a done signal which is propagated throughout the swarm.

Because the agent is constantly moving the location is continually recalculated using the same method as in the localization state. And as in the done state if a predetermine number of steps have occurred since a done signal has been received the agent goes back to its initial cluster state.

Figure 3.3: Shape forming phase. The violet agents are about to move. The dark green agents have been correctly inserted into the shape.

(a) An agent is about to move. (b) First agent moved into the shape. The next agent prepares to move.

(c) All agents are inside the shape now.

3.3

Implementation

(25)

CHAPTER 3. METHOD

The software is written in C++ using the C++11 standard (ISO/IEC 14882:2011) as implemented and compiled by the Visual C++ 12.0 compiler. No external li-braries are used for the implementation except for a generic graphics library for image rendering of the simulation and event handling for user input and a graphical interface.

3.3.1 Simulation

The program uses two main classes one representing the swarm and the environment and one representing a single agent. There are also a couple of help types used for representing data related to communication between agents and data used to carry location information. There are also half dozen helper functions related to frequently used mathematical functions.

Environment and swarm class has a two-dimensional Boolean vector which rep-resents the shape they are going to form and a vector of all agents. The class handles the setup of the original state of the simulation. Creating seeds and agents with the correct initial parameters and placing them at appropriate locations in the environ-ment. This class also handles information about the individual agents’ interactions with the environment and the rest of the swarm, it handles collision detection, propagation of signals and communication and can be quarried about information about the final shape. This class also has a separate section with parameters sole responsible for the graphical representation and rendering with multiple toggles for different information to be viewed.

The environment is updated in discrete time steps which is not directly time based but allows each agent to do one evaluation of its current state and move a maximum of one robot diameter. To avoid deterministic behavior and minimizing the affect agents evaluation order has on the simulation each time the environment takes a step a random enumeration order is pick for the agents.

The proximity communication is implemented by iteration over all other units and checking if any unit is within a certain distance of the agent. Similarly is the collision detection done but instead checks if the range is less than the agents’ diameter. All these calculations are done with the agents’ real position in contrast to the calculations done on agent level which uses their perceived locations.

The long range communication is based on a signal strength system. This system is implemented by for each pair of agents create a polygon between them and use

Point Inclusion in Polygon Test to check if another agent is in-between. First the

signal is reduced linearly based on the distance between the agents and then it is reduced exponentially based on the number of agents found inside the polygon. This part of the program is the most computational taxing as it has a cubic lower time complexity bound. As the long range communications is only used by the swarm if agents are in the clustering state the evaluation skips this if no such agent exists.

(26)

3.4. METRICS

The movement is handled by splitting up the distance it want to move into discrete predefined steps which in essence is the minimum distance step an agent can move in any given direction. Then moving the agent that distance and checking for a collision if it did occur the movement attempt stops. This discrete step method provides a less deterministic movement as the agent does not have direct access to it owns real position and errors are introduced each time it moves to its perceived location.

3.3.2 Shape Forming algorithm

This works as the method section describes it. It has a state variable and performs a switch lookup on it to determine what to do. It then uses the provided functions and data it receives and sends to the swarm and the environment to make its decision on movement, actions and state transitions.

3.4

Metrics

Here two different types of metrics are presented which are used in this thesis to evaluate the results of the simulation. One metric is a pure geometrical ratio and the other is one more subject about shapes.

3.4.1 Coverage

This metric is simple. It is the ratio or percentage of the intended shape that is occupied by agents. The ratio has an upper bound of 90 percent as the method scales the size of the shape to just that area.

3.4.2 Shapes

(27)
(28)

Chapter 4

Results

In this section the results of the experiments preformed for this paper will be pre-sented.

4.1

Experiments

Two different experiments are given. One quantitative using the coverage metric described in the method section and one qualitative using the shape metric described in the method section.

4.1.1 100 Agents – Four Simple Shapes

The first experiment is a quantitative test where the simulation is run a hundred times per shape for four different simple shapes. The shapes used are a House, a Cross, a Square and a Circle 4.1. Each simulation is randomly initialized and uses one hundred agents. The simulation is run for three thousand iteration steps and at the end the coverage metric is calculated.

House Cross Square Circle Mean 82.63% 80.54% 83.47% 82.61% Median 82.88% 80.96% 83.64% 82.73% Standard

Deviation 1.27% 1.92% 1.18% 1.32%

4.1.2 100 to 300 Agents – Different Complex shapes

(29)

CHAPTER 4. RESULTS

Figure 4.1: Four simple shapes.

(a) Circle (b) Cross

(c) House (d) Square

of agents ranging from one hundred to three hundred. The number of iteration steps was variable and different from each simulation. The simulation was stopped when the person responsible for the experiments deemed the simulation finished. This generally meant when the changes between clustering and shape states did not alter the shape by a noticeable amount. An example can be seen in figure 4.2.

The scores were as follows: Very Dissimilar (5), Dissimilar (2), In between (3), Similar (8), and Very Similar (17)

(30)

4.1. EXPERIMENTS

There were three patterns that kept reoccurring throughout the simulations. They are as seen in 4.3, 4.4 and 4.5. These were patterns of five or more agents which were locked in circular shape around empty space. If the patterns with five or six agent were located more than two gradient layers of agents from the edge of the swarm they were never resolved in observed simulations. If they were within two gradient layers of agents form the edge of the swarm resolutions into a close bound pattern was observed. The patterns of seven agents in a circle was only not resolved in one observed simulation and did only rarely occur in early stages of other observed simulations. The pattern with five agents was observed in multiple locations in different forms in each simulation and in most observation one or more patterns of six agents were observed.

Figure 4.2: The house shape, before and after shape forming.

(a) Start (b) End

(31)

CHAPTER 4. RESULTS

Figure 4.4: 6 shape.

(a) Version 1

(b) Version 2

(32)

Chapter 5

Discussion

In this section of the paper the method and results will be discussed with the aim of laying the ground for the conclusion as well as discussing any shortcomings the method and implementation of the method might have.

5.1

Simulation

Software simulations are programs which tries to mimic a real phenomenon and inherent in them is the fact that they never achieve complete accuracy and repre-sentation. This is true for the implementation that is presented in this thesis. Here a few of these shortcomings will be addressed.

5.1.1 Discrete Iteration

The first issue addressed is the simulations digital nature. For all intents and purposes real life is an analog system. The simulation is done in a computer which is inherently digital. The length of a time step in the iteration was chosen as a compromise between realism and feasibility. Designing a simulation where the actual computational components on the agents were simulated would require too much detail. Instead each agent was allowed to run through one evaluation of its state per iteration. In reality the state evaluation times would be variable and all agents would desynchronize their executions. This gives the simulation an unnatural synchronization between agents which would not occur with real robots. However assuming that the state evaluation can be done in a reasonable short time on a real robot and have similar execution length for different agents and states the effect of the nonexistence of an inherent synchronization is negligible. Another thing that is done is to have the iteration order be random. Being a computer there is always a global ordering of execution but by introducing pseudo randomness into this order it reduces the effect the global execution ordering has on the algorithm.

(33)

CHAPTER 5. DISCUSSION

slower in each time step would make the simulation times so long that it would be unfeasible to achieve the results needed in the available time. Also when the choice of allowed distance was set to a predefined constant some parts of the simulation is implemented with this assumption. Because of this the implementation of the method would only be valid under this assumption.

The discrete collision detection and movement is also an issue that will be ad-dressed. An alternative to keeping the discrete length constant would have been to reduce it down to the machine epsilon as the objects are near to collisions. Here the constant number was chosen to introduce a certain error in the motors behavior and make them able to only move a minimum distance to take into account the issues of acceleration and deceleration inherent in physical motors.

5.1.2 Long Range Communication

The second issue is that of the long range communication sensors. They are sup-posed to work on a signal strength basis which in reality would take into account the medium it travels through, the length and potential disturbances. The simulation tries to mimics this by using a basic type of ray tracing from the sensor to detect if there are other agents in between the communicator and the receiver and thus try to determine a suitable signal strength. A solution would be to make the ray tracing more accurate but it is already the bottleneck of the program with its cubic time complexity bound in the number of agents. The computational complexity of this part of the simulations the number of agents that can be feasibly simulated. The test with three hundred agents were the limit that could be achieved within the available time. This unfortunate limits the usefulness of the simulation. If swarms of thousands of robots should be attempted the implementation must be changed to be more efficient or use an alternative way to simulate the sought after behavior.

5.1.3 Sensor and Motor Errors

The last issue is the existence of errors and imperfections in real sensors and motors. The implementation tries to resolve this issue by adding some random errors to each sensor and the motors. However the accuracy of such errors and their similarities with errors in reality are hard to ascertain and adds another unreliability to the simulation.

5.2

The Algorithm

(34)

5.2. THE ALGORITHM

5.2.1 Changes

The most obvious limitation of Rubenstein’s algorithm was that it has a very specific setup. The seed agents are required to be setup on the edge of the shape and the rest of the agents must be placed in immediate proximity, clumped together outside the shape. The aim of the algorithm in this paper was to eliminate this limitation by introducing a clustering part to the algorithm where the agents first tries to cluster up and then start edge-moving. The change was a rather simple one but it did require some new sensors on the robots. The long-range communication was added so that robot did not have to be in proximity to communicate. The localization also changed from Rubenstein’s algorithm because the agents described in this paper cannot sense distance and only direction.

5.2.2 Improvements

The algorithm in this paper allows for agents to be placed anywhere in the environ-ment (as long as they are in long-range communication range) in any configuration and seeds can be placed anywhere inside the shape as long as they are clumped up together. The state switching between clustering and shaping also made it possible to find configurations which were more accurate along the edge of the shape than those that Rubenstein’s algorithm produced.

5.2.3 Regressions

The addition of the clustering also introduced some issues. The first is the inability to accurately form shapes which has holes in them. Because the clustering part is performed without regards to the final shape during clustering agents are trapped inside these holes and have no chance to escape. The second issue is an increased number of these five, six and sever circle patterns in the final shape. The Ruben-stein’s algorithm would occasionally produce them but not to the extent that the clustering part of the algorithm presented in this paper does.

One solution to these problems would be to introduce another part to the al-gorithm which allowed agents to repulse each other. So if there are trapped agents they have a way of escaping and if agents are trapped in circular patterns the same thing could be done to let them escape and try again.

(35)

CHAPTER 5. DISCUSSION

5.2.4 Results

The paper has already shown that the algorithm was able to eliminate some lim-itations that the source had as well as introduced some regressions but here its intended purpose of forming two-dimensional shapes will be discussed.

Looking at the quantitative experiment the result shows that the algorithm is performing well. All results are above 80 percent on a scale between 0 and 90. It has a standard deviation which is low and a median which is close to its mean in each sample. This means that it is not only efficient but also consistent.

This is also reflected in the qualitative experiment where more complex shapes with more agents was used. If the shapes with holes in them are discarded each simulation produced a shape which got a qualitative score of three or above with the majority of shapes achieving the maximum five score.

(36)

Chapter 6

Conclusion

Through the use of swarm robotic simulations, this thesis has aimed to examine a two-dimensional self-assembly algorithm with the goal of addressing some limits in an existing solution as described by Rubenstein.

Limitation rooted in Rubenstein’s method of placing seed agents have been addressed and improved upon by the introduction of a clustering algorithm that allows for the placement of agents anywhere withing communicative range. Aside from algorithmic changes, the hardware of the agents has been altered to provide long range communication capabilities. Through the use of a shifting clustering and shaping algorithm it was also possible to find configurations that allowed for more accurate ways of forming shapes, especially along the edges of the shapes.

While certain issues regarding the formation of holes unoccupiable by the agents appear more often after the changes, it has still shown to yield favorable results during the simulation.

(37)
(38)

Bibliography

[1] Donald Christiansen, Charles K Alexander, and Ronald Jurgen. The electronics engineers’ handbook. In The Electronics Engineers’ Handbook, chapter 19. McGraw-Hill, 5th edition, 2005.

[2] Richard C Dorf and Robert H Bishop. Modern Control Systems. Pretice Hall, 2001.

[3] W. Randolph Franklin. Pnpoly - point inclusion in polygon test, 2014.

[4] Roderich Gross. Swarm robotics companion slides for the book bio-inspired artificial intelligence: Theories, methods, and technologies, 2008.

[5] Nicholas Hoff, Robert J Wood, and Radhika Nagpal. Effect of sensor and actuator quality on robot swarm algorithm performance. In IROS, pages 4989– 4994. IEEE, 2011.

[6] Inaki Navarro and Fernando Matia. An introduction to swarm robotics, 2013.

[7] Michael Rubenstein, Alejandro Cornejo, and Radhika Nagpal. Programmable self-assembly in a thousand-robot swarm. Science, 345(6198), 2014.

[8] Erol Sahin. Swarm robotics: from sources of inspiration to domains of ap-plication. In Erol Sahin and W Spears, editors, Swarm Robotics Workshop:

State-ofthe- Art Survey, pages 10–12, 2005.

[9] Erol Sahin, Sertan Girgin, Levent Bayindir, and Ali Emre Turgut. Swarm robotics, 2007.

[10] Tariq Samad. Perspectives in control : new concepts and applications. In

Perspectives in control : new concepts and applications. IEEE Press, 2001.

(39)

References

Related documents

The purpose of this thesis is to study the Islamic banking system in order to promote it as an alternative to conventional banking in a Western market, such as Sweden, and if it

We claim that the category of FII will have an advantage due to them having more access to private information. One reason for this is that they are closer to key position holders

The energy level and number density of particles in plasma affect current density and potential of the spacecraft. The LEO orbit is not a favorable region for use of

To compensate for this, every agent will have their memory of agents at that blue exit decreased by two per turn instead of one, and each time any blue agent takes the max of

I have argued that when a government actor is supported by       an external state with high soft power, in the form of political and economic capital,       the government is

(2010b) performed a numerical parameter study on PVB laminated windscreens based on extended finite element method (XFEM). According to their finding, the curvature does play

Thanks to the pose estimate in the layout map, the robot can find accurate associations between corners and walls of the layout and sensor maps: the number of incorrect associations

fasta på utveckling av pedagogik och arbetsformer för att bättre svara upp mot individens behov av lärande; rådgivning och vägledning, som baseras på redan förvärvade