master's thesis1022180/fulltext02.pdf · a development framework for smart city services...

94
MASTER'S THESIS A Development Framework for Smart City Services Integrating Smart City Service Components Samuel Idowu Nadeem Bari Master of Science (120 credits) Computer Science and Engineering Luleå University of Technology Department of Computer Science, Electrical and Space Engineering

Upload: others

Post on 12-Oct-2020

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

MASTER'S THESIS

A Development Framework for Smart CityServices

Integrating Smart City Service Components

Samuel IdowuNadeem Bari

Master of Science (120 credits)Computer Science and Engineering

Luleå University of TechnologyDepartment of Computer Science, Electrical and Space Engineering

Page 2: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

A Development Framework forSmart City ServicesIntegrating Smart City Service Components

Samuel Idowu, Nadeem Bari

Master’s thesis November 13, 2012

MSc. Mobile SystemsDepartment of Computer Science,Electrical and Space EngineeringLulea University of TechnologyLulea, SWEDEN

Page 3: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

A Development Framework for Smart City Services

Samuel [email protected]

Nadeem [email protected]

M.Sc Mobile SystemsDepartment of Computer Science,Electrical and Space EngineeringLulea University of Technology,Lulea, SWEDEN

Master’s thesis

Abstract

With advent of smart cities, information and communication technology is increas-ingly transforming the way city municipalities and city residents organize and op-erate in response to urban growth. In this thesis, we create a generic developmentframework that can help in the development and deployment of smart city services.The prototype development framework integrates soft real time data with simula-tion system. The motivation for integration with a simulation system is to act asdecision support for the real system, understand and estimate how future changesin the real system can affect the current system with its new change.As proof of concept, we applied our proposed system to a specific city and a specificcity service. Our target city is Skelleftea, Sweden, while our target service is wastemanagement service. The designed system is tailored to support and optimizewaste management operation and the system primarily uses a single metric dataacquired from recycle bins, which indicates level of wastes in bins. The designedsystem consists of components such as data retrieval system, a RESTful web service,simulation system, web based monitoring application system for waste managementcompany and mobile application for city inhabitants.

Page 4: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

Contents

0.1 Acknowledgement . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.2 Abbreviations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

1 Introduction 31.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31.2 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41.3 Purposes and Goal . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

1.3.1 Smart Cities Service Development Framework . . . . . . . . 61.3.2 Proof of Concept . . . . . . . . . . . . . . . . . . . . . . . . 7

1.4 Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81.5 Literature Review . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

1.5.1 Smart City Components Architecture . . . . . . . . . . . . . 91.5.2 Urban Planning and Smart Cities . . . . . . . . . . . . . . . 101.5.3 Smart Cities Critical Infrastructure Response Framework . . 121.5.4 Scalable Architecture for geo-localized service access in Smart

City . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131.5.5 A Simulation System for Waste Management . . . . . . . . . 13

1.6 Organization of Thesis . . . . . . . . . . . . . . . . . . . . . . . . . 161.7 Chapter Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

2 Methodology 172.1 Methodology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

2.1.1 Research Design . . . . . . . . . . . . . . . . . . . . . . . . . 172.2 Design and Architecture . . . . . . . . . . . . . . . . . . . . . . . . 19

2.2.1 System Overview . . . . . . . . . . . . . . . . . . . . . . . . 192.2.2 Control Flow . . . . . . . . . . . . . . . . . . . . . . . . . . 202.2.3 System Data Flow . . . . . . . . . . . . . . . . . . . . . . . 21

2.3 System Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . 212.3.1 Recycle Centers and Recycle bins . . . . . . . . . . . . . . . 212.3.2 Network Gateways . . . . . . . . . . . . . . . . . . . . . . . 222.3.3 Sense Smart City (SSC) Server/Cloud . . . . . . . . . . . . 222.3.4 Management System . . . . . . . . . . . . . . . . . . . . . . 24

Page 5: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

2.3.5 Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292.3.6 Guidance System for City Habitants . . . . . . . . . . . . . 32

2.4 Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342.4.1 SSC Server . . . . . . . . . . . . . . . . . . . . . . . . . . . 342.4.2 Gateway . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 352.4.3 Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 362.4.4 Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . 382.4.5 Management System . . . . . . . . . . . . . . . . . . . . . . 392.4.6 Guidance System . . . . . . . . . . . . . . . . . . . . . . . . 392.4.7 Geographical Search . . . . . . . . . . . . . . . . . . . . . . 392.4.8 Chapter Summary . . . . . . . . . . . . . . . . . . . . . . . 40

3 Result 413.1 Web Server: Amount of Data and Processing Time . . . . . . . . . 413.2 NetLogo: Performance and Processing . . . . . . . . . . . . . . . . 413.3 Application of Framework to target service . . . . . . . . . . . . . 423.4 Proof of Concept and Research Application . . . . . . . . . . . . . . 433.5 Management System Web Application . . . . . . . . . . . . . . . . 45

3.5.1 Route Optimization . . . . . . . . . . . . . . . . . . . . . . . 503.6 Mobile Application . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

3.6.1 Guidance System Mobile Application . . . . . . . . . . . . . 513.6.2 Mobile Client . . . . . . . . . . . . . . . . . . . . . . . . . . 513.6.3 Mobile Application Features . . . . . . . . . . . . . . . . . . 52

3.7 Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 573.7.1 Simulation Component . . . . . . . . . . . . . . . . . . . . . 57

4 Conclusion, Discussion and Future Work 694.1 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 694.2 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 704.3 Future Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71

A System Design Technologies and Motivation 73A.1 Design Technologies and Motivation . . . . . . . . . . . . . . . . . . 73

A.1.1 REST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73A.1.2 PHP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74A.1.3 JSON . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74A.1.4 MySQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75A.1.5 JAVA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75A.1.6 SQLite . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75A.1.7 JavaScript . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75A.1.8 Android . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76

Page 6: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

A.1.9 PhoneGap . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76A.1.10 Netlogo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76

B Haversine Formula 79B.0.11 Haversine Formula in SQL Query . . . . . . . . . . . . . . . 79

C Simulation Task Flow 81C.1 Details of Operation Flow Chat (Figure C.1) . . . . . . . . . . . . 81C.2 Details of Operation Flow Chat (Figure C.2) . . . . . . . . . . . . 82

D Algorithms 85D.1 Dijkstra Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . 85

References 86

Page 7: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

0.1. ACKNOWLEDGEMENT 1

0.1 Acknowledgement

We express solemn gratitude to God for his blessings. We are grateful to our parentsfor supporting us and encouraging us to pursue higher studies. They are our realinspiration.Special gratitude goes to our inspiring internal supervisor for our master thesis, ProfChrister Ahlund. He has been our mentor and teacher; we value and appreciate hisconstructive comments and suggestions on our research.We are grateful to our external supervisor, Itaya-san (NEC, Japan) who gave uspractical experience to know the art of research in international environment andintroduced us to few of the latest tools during our intern-ship. She supported uswith her wise and creative experience in this project and concurrently gave us thefeedback and kept the work ticking. We like to thank Sense Smart City projectmanager Jan Petersson, CDT for his involvement and support in this project. Histeam gave us the guidance and opportunity to work on Sense Smart City projectand thereby extending our work to start this thesis in Japan. The Sense Smart Cityteam have supervised, connected us to the industry, given their valuable insightsand supported us during pre and post work of our master thesis. We also like tothank Prof Robert Brannstrom, Prof Karl Andersson and other staff of Departmentof Computer Science, Space and Electrical Engineering at Lulea University of Tech-nology who have shared their valuable experience and been also inspired us duringour studies.Special thanks to Ishiguro-san and Iwamoto-san for handling our documents, travelplans and helping us with all guides and accommodation during our stay in Japan.We also thank NEC collaborator, Mr Peter Davis from Telecognix Pvt Ltd for hisinvolvement and inputs throughout our project.

Page 8: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

2

0.2 Abbreviations

IoT Internet of Things

SSC Sense Smart City

WSN Wireless Sensor Networks

IPv6 Internet Protocol Version 6

6LoWPAN IPv6 over Low power Wireless Personal Area Networks

CoAP Constrained Application Protocol

SAN Sensors and Actuators Networks

JSON JavaScript Object Notation

SQL Structured Query Language

ABM Agent Based Modeling

ACO Ant Colony Optimization

GIS Geographical Information System

SWM Solid Waste Management

OSM Open Street Maps

Page 9: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

Chapter 1

Introduction

This chapter presents an overview of the overall work done and research carried outin this thesis. It starts with an overview about smart cities, city services and themain objective of our thesis. It continues with some background information aboutsmart cities, environmental sensing, Internet of Things (IoT) and pervasive technol-ogy in general. In next section, we discuss detailed information about the purpose,motivation and goal of this work, which is mainly about development frameworkfor smart city services. Section 1.6 of this chapter highlights the organization of thethesis report and finally we present some related studies in smart cities.

1.1 Overview

More recently, there have been lots of initiatives and studies about smart cities bygiant companies and research institutes. These studies and researches aim to makeour cities smarter and thus effectively utilize available resources even with increasein population size. Smart City projects primarily rely on capturing and gatheringof data from the city. These data include weather information such as temperature,electric energy consumption information and information generated from public in-frastructure. Data retrieval components are essential parts of Smart Cities. Today,with great number of sensing devices with wireless communication capabilities, dataretrieval systems can effectively utilize the network capabilities of such devices togather most information about cities and for citizens. The role of mobile devicessuch as smart phones is of great importance since they can serve as sensing devicesand can also deliver information to user via mobile applications, which feed on thecity service data. Information about cities needs to be processed in some ways togive value added services to the citizens as well as municipalities, For example, his-tory of data in specific cities can be used to predict and forecast the future aboutsuch cities, which can help in better planning and service support for the citizens.

3

Page 10: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

4 CHAPTER 1. INTRODUCTION

Smart City services can be applied in various aspects such as traffic management,waste management, power management, waste processing management and manyothers.This research focuses on creating a development framework, which can help, indevelopment and deployment of smart city services, specifically in trying out mod-ifications in systems through the combination of real time sensed data with datagenerated from a simulated environment. Information and communication tech-nology is increasingly transforming the way city municipalities and city residentsorganize and operate in the area of urban growth. With desire for more city ser-vices also comes the need for optimization of operation for these city services. Theresearched development framework aims to effectively help realize city services thatare dependent on real-time data from city environments. This will be achieved byintegration of these data into a platform capable of some intelligent computationssuch as optimizations, modeling and visualization.

Our work also includes a proof of concept based on the focus of our research. Theidea of the proof of concept is to ascertain the feasibility of our designed developmentframework.We introduce Agent Based Modeling (ABM) for simulation as a way to argumentdata retrieval system thereby giving a new development framework design, whichcan be used, in different cases of city services. Simulation is an efficient way toanalyze various important variables in a specific system. This involves modeling thetarget environment, simulating the data flow and comparing with the real system.

The motivation for integrating simulation into this prototype system is mainlyto act as a decision support for the real system and estimate how likely modifica-tions in the real system or an alternative solution can affect the existing system.This can be used in performing tasks such as system validation and prediction.

1.2 Background

Our study includes sensor networks for environmental sensing and participatorysensing for cities to help connect people, society, city resources and municipalityoperations in an informative approach. The research framework integrates differenttechnologies such as IoT, Cloud Computing, Mobile Computing, Pervasive comput-ing and Wireless Sensor Networks (WSN).Rapid advancement in ubiquitous computing and communication technology in re-cent times is a reflection of the nature of technology that will drive our communityand environment in the nearest future. As we advance towards IoT, which is greatlyfavored and enabled, by millions of mobile devices with low power radio technologies

Page 11: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

1.2. BACKGROUND 5

and tiny microprocessors. The IoT promises to change the phrase ”Anytime, anyplace for anyone” to ”Anytime, anywhere, anymedia” [1].

A city is ”smart” when investment in social and modern communication infras-tructure promotes economic development and offers high quality of life to citizens,with wise and efficient management of available resources [2]A smart city builds its foundation on a digital infrastructure which is capable ofconnecting various local community and drives growth, efficiency, productivity andcompetitiveness [3]. These and many other advantages of smart cities are reasonsfor rapid increase in adopting smart city technology today. With the introductionof smart cities also come new services and new applications that will depend on newarchitecture of the IoT [4]. These new architectures will bring about paradigm shiftfrom host-centric to content-centric [2]. Our cities are increasingly moving froma collection of static buildings and infrastructures to dynamic and evolving smartecosystems known as, Intelligent Cities [3]

The main reason for development of Smart Cities is the need for improving thequality of services from municipality or government agencies to city inhabitants.Today, there are several smart city projects, which are built upon this key driver.

Smart cities and Internet of Things

In 1900, less than 20 percent of the world population lived in cities, in 2007, justmore than 50 percent of the world population lived in cities. In 2050, it has beenpredicted that more than 70 percent of the global population (about 6.4 billion peo-ple) will be city inhabitants. There is more pressure being placed on cities throughthis increase in population [5]. It is obvious that in the nearest future, city serviceswill be highly dependent on automated machine to machine interaction as citiesand organizations or companies providing services will desire to reduce cost andprovide more efficient services and activities [6]. Also, this will increase the needfor tight integration between essential services and hence results in complex systemof systems. For example, services such as city transport systems can be integratedwith traffic management and waste management systems in such as way that datafrom one service could be utilized in another service system. This will in returncreate a complex system at large. Increase in sensing capability of system has thedirect effect of increasing the fidelity of information, which is essential in obtainingreal time flow of information which can be used in decision making systems [7]. Acity service will benefit greatly from increase in quality and quantity of data. Inorder to achieve this, IoT is an important building block. In recent times, withthe help of IoT, it is now possible to have Internet connectivity and service downto the devices that directly interact with cities and inhabitants i.e. sensors andactuators [8]. IoT is built on WSN and there are lots of studies concerning the de-velopment of WSN. In these studies, it is shown that network application of IP on

Page 12: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

6 CHAPTER 1. INTRODUCTION

constrained devices, which are meant to run for duration of years on set of batterieshave limited processing power as well as little storage space and network bandwidthcapabilities [9]. Some researchers argues that implementation of Internet ProtocolVersion 6 (IPv6) on low powered sensors provides a more feasible option to networkapplication on constrained devices. IPv6 over Low power Wireless Personal AreaNetworks (6LoWPAN) made it possible for devices (sensors and actuators) to haveInternet connectivity using a unique identifier. 6LoWPAN is a low power variantof IPv6 that utilizes header compression to enable transmission of an IPv6 packetwithin the limited 802.15.4 link layer frame [9]. This has enabled IP connection ofSensors and Actuators Networks (SAN) to the Internet.

1.3 Purposes and Goal

The main goal of this project is the realization of a development framework, whichcan be used for various smart city services in cases such as system operations andvalidation.

1.3.1 Smart Cities Service Development Framework

Our development framework includes three major systems, an emulated target sys-tem, an implemented Sense Smart City (SSC) central system and a supportivesimulation system. The target system could be any city services e.g. waste manage-ment service. Action ’1’ in Figure 1.1 describes the process of representing targetsystem properties in core system. Action ’2’ describes fetching of target systemproperties by simulation system. After performing some simulation tasks, action’3’ represents the process of returning the result back to the core system. Lastly,action ’4’ represents applying output result from core system to the target system.These actions are described in detail in the next section

Phases in Development Framework

The development framework consists of few basic steps. These steps are the coresto achieving a suitable integration of real system with simulation system in such away that we obtain decision support capabilities from the simulation system. Thefollowing section describes the main steps:

• Stage 1: The first stage consists of modeling the target system in a simulationenvironment. To allow a fully automated system with support for differenttype of services, we designed a dynamic system that loads real system descrip-tion and parameters from an on-line database system.

Page 13: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

1.3. PURPOSES AND GOAL 7

Figure 1.1: Major systems in development framework

• Stage 2: The next step after creation of a similar real world system in simu-lation is to define actions and other necessary parameters for the simulation.Here we utilize an ABM approach, where specific actions of the target systemunder study are simulated. The simulation typically outputs list of results forvarious number of simulations carried out.

• Stage 3: As stated in the stage above, each simulation gives a result set, whichleads to multiple result sets for various simulation tasks. At this stage, theuser selects the preferred optimal result sets based on defined rules for targetsystem.

• Stage 4: Applying preferred solution from simulation result to target system.This step includes making changes to real system based on obtained resultfrom the simulation. This gives a new system configuration.

• Stage 5: This stage is a phase in which the target system with new configu-ration is monitored. There are two possible outcomes from this phase. Thefirst possible outcome is to get an expected outcome from the system; on theother hand, we could have an outcome that differs from expectations. In for-mer case, we can assume our modeled target system is valid, while later caseshows a need to review our simulation model.

1.3.2 Proof of Concept

There are various number of city services which can directly benefit from our pro-posed development framework, such includes energy systems, traffic systems, trans-portation systems, communication systems, smart buildings and healthcare systems

Page 14: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

8 CHAPTER 1. INTRODUCTION

Figure 1.2: Major steps in development framework

among others. All these services are good candidate for research in smart cityprojects.

For proof of concept, we focus on sustainability aspect, more specifically wastemanagement system, in which we considered the waste collection service. Despitechoosing waste collection service as proof of concept, the system is designed to beflexible enough for adaptation to other types of city services and not just restrictedto city waste management service alone.

Recycle bins and recycle stations serves as primary data source for the sys-tem, data will be acquired from recycle bin sensors placed at different locations.The real time data is stored and made available through a defined interface to themunicipality or private companies. A replica of the system shall be created in asimulation environment and data generated shall be compared with the real timedata to provide optimal system and validation.

The proof of concept also includes implementation of an end-user mobile appli-cation. This application provides city inhabitants with information about currentstatus of waste level in recycle bins. This information is essential in situations whereusers need to know availability of recycle bins beforehand.

1.4 Limitations

In this study, there are limitations, which limits the scope of our thesis. With thegoal of this research, we intend that our framework will be a generic system. How-ever, we do not intend to provide or implement a full generic framework, instead ourplan is to focus on the proof of concept. As a result of this, the resulting frameworksystem might require more work to apply it to other city services. Also, we will notbe working with real sensors, hence, we will assume the sensing aspect of our systemby using generated data from the assumed sensing component. Subsequently, we do

Page 15: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

1.5. LITERATURE REVIEW 9

not plan to carry out data mining operations on sensor data. Data mining sensordata can help to extract useful models. These models can be useful in predictionand hence anticipate what will happen in a city regarding waste management.

1.5 Literature Review

This section contains review of related studies on smart city services and applicationof simulation in similar areas.

1.5.1 Smart City Components Architecture

A study on smart city component architecture uses GIS operational platform as basefor managing infrastructure development components with systems operability foravailable city infrastructure related systems [2]. This work introduced a smart citydevelopment pyramid, Figure 1.3, which consists of four primary stages in buildinga smart city: smart infrastructure, smart database resources, smart building man-agement system and smart interface. Smart Infrastructure is the base foundation ofsmart city and its preparation should be considered and discussed during conceptof design of all infrastructure networks. The smart infrastructure is represented intransmitting and receiving the data using communication protocols from and to thenetwork devices. The second stage is building up proper database that can reflectexisting or proposed infrastructure networks. The database should reflect the com-pleteness of the networks assets as well as consistency and data integrity [2]. Aftercompleting the second stage which reflects the physical reality of the assets/networkcomponents. The third stage is building the most practical and efficient BuildingManagement System, which has automation work frame that has to be smartlyoperated. Smart interface provides an easy way to connect and utilize the systemcomponent as a whole, e.g. as dashboard or integrated web services [2].

In this work, we see smart city development pyramid which can be applied inother similar smart city development projects. The components of the pyramidsuitably match the convention of smart city projects and hence can be suitablyapplied during development of smart city systems. In relation to our developmentframework, a number of components discussed in this work [2] have similaritieswith components used in our development framework. Smart Infrastructure (de-velopment pyramid) relates to our data retrieval system. Smart database resource(development framework) relates to our SSC database server and smart interface(development framework) relates to SSC web services platform.

In conclusion, this work [2] helps in identifying the building blocks and hierarchyneeded in smart city development.

Page 16: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

10 CHAPTER 1. INTRODUCTION

Figure 1.3: Smart city development pyramid [2]

1.5.2 Urban Planning and Smart Cities

This related work [10] highlights and measures smart city and urban planning in-terrelation and identifies the meeting points among them. The notion of smart citywas approached as part of the broader term of digital city, where a generic multi-tiercommon architecture for digital cities was introduced and assigned smart city to thesoftware and services layer. [10]

A generic architecture, Figure 1.4, which can describe all the types of attributesneeded to support the smart city context, was presented. This generic architecturecontains the following layers [10]:

1. User Layer: This layer consists of all e-service end-users and stakeholders ofa smart city. Since this layer concerns both stakeholders who supervise thesmart city, and design and offer e-services and the end-users who consumesthe smart city services, hence this layer appears both at the top and bottomof the architecture

2. Service Layer: This layer incorporates all the particular e-services being offeredby the smart city.

3. Infrastructure Layer: This layer contains network, information systems andother facilities, which contribute to e-service deployment.

4. Information Layer: This layer presents all the information, which is required,produced and collected in the smart city.

Page 17: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

1.5. LITERATURE REVIEW 11

Figure 1.4: The multi-tier architecture of a digital city [10]

Page 18: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

12 CHAPTER 1. INTRODUCTION

In contrast to smart city architecture components as identified in [2], it is im-portant to also identify layers that contribute to a generic architecture. From thecomponents presented in [2] and generic architecture layers presented in this pa-per [10], we can identify intersections in the two sets, though they clearly describesmart city in different perspectives. The former describes smart city base on func-tional components while the later highlights components of smart cities based onoperational layers.

In conclusion, this work [10] helps in understanding the relationship betweenend-users and stakeholders of smart city, service consumers, user layer, service layerand infrastructure later.

1.5.3 Smart Cities Critical Infrastructure Response Frame-work

This related work [9] is about initial work on the Smart Cities Critical Infrastruc-ture Response Framework. The proposed framework aims to provide a responsestrategy to first responders based on smart cities information flows. Critical Infras-tructures are entities, which provide services to maintenance of the well being ofthe populace. These entities are very important such that if removed could causeharm or great disruption, e.g. telecommunication and electrical grid infrastructure.The protection of critical infrastructure has been noted as one of the major chal-lenges in 21st century, hence responding to an event and minimizing its impact oncritical infrastructure is important. To achieve this, there is a need for real-timeinformation gathering about the current state of the system and the effect that itsfailure will have on surrounding systems. Smart Cities and IoT technology bothlend themselves very useful in have real-time information with number of sensorsthat can improve decision-making process. [9]

It is important to note that, one of the important aspects of smart city is theinterconnection of systems. In complex system where a system sorely depends onanother, a failure in one system can affect other systems. With critical infras-tructures where city inhabitants depends sorely on its services, having a real-timeinformation about the state of system is essential and valuable, as this can help tomonitor systems for likely faults and easy to detect faults.

This work [9] shed light on an important aspect of smart city that needs focus.We believe it is important to consider some form of fault-finding system in smart citysystems as this can help to ensure monitoring of system components and enhancethe process of fault-finding.

Page 19: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

1.5. LITERATURE REVIEW 13

1.5.4 Scalable Architecture for geo-localized service accessin Smart City

This related work [11] proposed a geo-localized lookup procedure which helps to re-solve the locators of devices providing services in the IoT. This work uses unstruc-tured P2P overlay network assumed to be created and maintained by the accessnetwork devices providing the service publishers with a connection to the Internet.

It is pointed out that some Internet architectures are more suitable for the con-stant increase in number of advent of new technology, services or applications [11].Several researches in both academy and industry are currently investigating Service-Oriented Architecture (SOA), which enables physical objects to publish various orspecific services that can be accessed by different mobile clients. The results ofsuch research are more flexible human-to-machine and machine-to-machine (M2M)interactions.

This work also presented a realistic use case scenario in the context of smart citychallenge, in order to show the effectiveness of proposed geo-localized lookup. Au-thor believes advent of IoT and capillary diffusion of mobile devices will change thetrend of WSN that are developed and deployed for just specific purposes and usuallyisolated from themselves and other nodes in the network. This change in trend canbe observed with diffusion of standards such as 6LoWPAN [12] and ConstrainedApplication Protocol (CoAP) [13] specifically oriented for constrained devices. Theuse-case presented assumes that ”islands” of wireless sensing devices are spread inan urban area with each island having one or more concentrator devices, whichhandles the collection and aggregation of data from sensors. This nature of designarchitecture is common in systems using WSNs, in which the concentrators, suchas in scalable architecture presented have Internet access through an edge networkdevice such as gateways.

In conclusion, this was a good reference to understand the application of SOAin smart city systems as underlying architecture for services. The work also showsthe application of IoT and WSN in smart city, and more importantly describes ascalable architecture with edge network devices.

1.5.5 A Simulation System for Waste Management

Here we describe the literature review of ”A Simulation System for Waste Man-agement” [14], The author presents an example of simulation system that has beenapplied in the field of waste management and discussed it with regard to gen-eral requirements for decision support systems. Such a system can be viewed as amacro-level complement of the corporate information systems used for production,recycling planning and control on the micro level.

It relies on computer based numerical models to play an essential role and discuss

Page 20: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

14 CHAPTER 1. INTRODUCTION

practical experiences. With ongoing differentiation of society and increasing demandto consider sustainability principles, instruments to support the assessment, designand control of social-technical will gain importance.

The simulation system developed here is called EcoSolver IP-SSK - It combinesthe advantages of a system dynamics approach with expertise in the field from LifeCycle Assessment (LCA). It has been deployed in co-operation with key players ofthe waste management system and support the assessment of the flow of materials,energy and costs in regional waste management with regard to ecological and eco-nomic impacts, In this context, The design approach and problem presented in thispaper is similar to SSC waste management system simulation component.

It was a good reference to understand the need for simulation component [15]in the smart city development and design. According to the article, in the field ofplanning and decision-making, modeling and simulation techniques can particularlybe applied to

• Study the (dynamic) behavior of the social technical system of concern (e.g.the waste management system) in different scenarios;

• Check the robustness of a policy against possible changes in the scenarios;

• Simulate and assess the effects of different strategies with regard to basicprinciples of sustainable development.

Keeping in mind that the SSC framework had the similar purpose, our findingsfrom this study, helped us to keep the simulation system as a decision supportsystem [2].

Similarly, another article focused on a particular city called Sogod, in the area ofmunicipality Solid Waste Management (SWM). The study aims to understand howwaste flow parameters control the municipal SWM at (Sogod, Southern Leyte)[16],and then use this understanding to shed some light on the designed policies aimedat resolving the concern of the existing system.

A system-oriented technique is developed using dynamics analysis to simulatethe non-linear causality of variables, coming from outside and inner factors withinand across subsystems of the SWM system. The interacting subsystems encompasswaste generation, minimization scheme, segregation, collection, final disposal andSWM budget and costs.

The existing situation and common practices of the municipal SWM system [17]of the study area is assessed through the developed STELLA model 1. Simulationresults suggest the weakness of the SWM system. Proposed solution are integratedin the second simulation model, STELLA model 2, to simulate probable alternativesto address the problems present in STELLA model 1. This is important and a goodmeasure for any simulation system to have an iterative approach.

Page 21: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

1.5. LITERATURE REVIEW 15

Based on simulated option, five policies are carefully analyzed and designedthrough simulation to reinforce the proposed solutions. Thus, the policies providesolutions for the best SWM in Sogod, Southern Leyte [16]. These policies include,among others, waste reduction at the source through community-based recycling andcomposting, ”Pay as you throw policy” opening the new dump site and controlleddump, environmental awareness, concern and education policy and expansion ofSWM costs.

The study recommends the imposition of a public and environmental awareness,concern and education program, adoption of a community-based approach to sourcereduction, recycling and composing, utilization of environmental technology, andappraisal of institutional responsibility in SWM.

With the literature review of this article, it was easy to understand that thesimulation model should adopt an iterative and community based approach andthereby improvising the existing policies and methods. The future scope of thispaper aims to include sanitary landfill and other decisive factors to incorporate inSTELLA Model.

We then moved on to the next paper, to understand how an algorithm, AntColony Optimization (ACO) can be tested and used in the field of waste manage-ment system, another paper in the area of urban solid waste collection and routingwas studied, here the author used ”The Ant colony Strategic Approach”.

A quick review of the paper says that, it introduces the ACO Algorithm [17]for best routing identification applied in urban solid waste collection, the proposedSWM system is based on geo-referenced spatial database supported by GeographicalInformation System (GIS). The GIS takes into account all the required parametersfor solid waste collection. These parameters involve static and dynamic data suchas positions of trash-cans, road network, related traffic and population density. Inaddition, time schedules for trash-collection workers, truck capacities and technicalcharacteristics are considered which was a good hint to work on side-lining few ofthe performance metrics in the waste management system.

Since it also describes about an ACO spatio-temporal statistical analysis model[17] which is used to estimate interrelations between dynamic factors, like networktraffic changes in residential and commercial areas in a 24 hour schedule, and toproduce optimization solutions.

The user, in the proposed system, is able to define or modify all of the requireddynamic factors for the creation for an initial scenario. By modifying these partic-ular parameters, alternative scenarios can be generated leading to several solutions.The objective of the proposed system is to identify the most cost-effective alterna-tive scenario for waste collection and transport, to estimate its running cost and tosimulate its application.

Page 22: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

16 CHAPTER 1. INTRODUCTION

1.6 Organization of Thesis

The first chapter describes the introduction of our thesis, with sections such as thesisoverview, research background, purpose and goal of research, literature review anddiscussion on enabling technologies. The second chapter, methodology, describessystem design and system architecture with details on components of designed sys-tem. In the methodology section, we highlight the technologies involved in thesystem implementation and the motivation for choice of technologies used. The lastsection of methodology provides information about some useful details about theimplementation of the system. In the next chapter, Result, we discuss the obtainedresult from this research. Lastly, discussion and conclusion chapter highlights ourthoughts and observations on this project. The appendix section contains usefulinformation, which are not included in the body of the thesis text.

1.7 Chapter Summary

In summary, this chapter gave introductory details of the work done in this thesis.We presented smart cities and related technologies as one of the trending topics intechnology research in recent times. We discussed the need for smart city servicesand how this motivated our research work. The goal of this research work, smartcities service development framework was presented in this chapter. The importanceof integrating a city service with supporting component like simulation of data toprovide added value services and information was also discussed. Lastly, some ofthe various related researches that we studied during this thesis were discussed inbrief.

The next chapter will provide details about the methodology approach usedduring this thesis.

Page 23: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

Chapter 2

Methodology

2.1 Methodology

In this section, we discuss the methodology used to design and implement a devel-opment framework as well as a proof of concept system.

2.1.1 Research Design

Our research design followed a number of steps in order to achieve the final goalof this thesis. The first main step is studying of related works under smart cities.This step helps in understanding the state of the art of smart cities. From ourstudy, we identified a need for smart city development framework. Since a citywill usually require more than one smart service, it becomes essential to have someform of development framework to aid the process of creating new services. Afteridentifying a need for a framework, then we researched, designed and developed theproposed framework. In other to show the feasibility of the designed framework,we came up with a proof of concept, in which we applied the proposed frameworkto a specific city and a city service. In general, our thesis can be seen in two mainparts, the first part is a framework that supports integration of real systems withsimulation systems to develop smart city services. In the second part, we applythe framework system to a specific city service as proof of concept. During theentire period of the thesis, a weekly report on work progress was documented withfollow-up meetings with project supervisors once in every two weeks. The followingsub-sections show the main part of our research design.

State of the Art Study

We started the research work with an in-depth study of work under smart cities,and we also looked into various existing smart city systems. Some of the systems

17

Page 24: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

18 CHAPTER 2. METHODOLOGY

we looked into include Smart Energy Systems and Intelligent Transport System.We specifically studied systems that integrate intelligent systems using simulationssuch as IBM Intelligent Transport System for smart cities. Areas of interest in thisstep include data acquisition systems and how acquired data are used in creatingvalue added services. Another area of interest is the integration of sensed data intocomputing platform and communication of information among city services. Sincesimulation is a part of our proposed system, we researched on how interconnectedsystems can be extended by modeling, analyzing, optimizing and visualizing theoperation of the service. The areas of interest listed above basically sum up to bethe foundation of smart cities, i.e. Instrumented, Interconnected and Intelligent[18].

The Need for a Framework

In line with the aim of smart cities, cities will each have a number of city services.The development and deployment of smart city services can be tricky, especiallywhen there are no specific patterns to follow during the development stage. To easethe development and deployment processes and also follow a standard procedure inservice creation, it is essential to have a development framework in place.

Design and Implementation

This step started with a detailed description of the proposed system and its featuresas well as its functionalities. We made use of the documented descriptions to keeptrack of our progress on a weekly basis. Having it in mind that the main goal of thisresearch is a development framework for city services, this implies that it shouldapply to any city service of choice. Therefore, one of the features of the designedsystem we put into consideration at the early stage of our thesis is to have dynamicset-up, such that the system can be easily adapted to various city services.

Smart City Services and Proof of Concept

For our proof of concept city service, we chose waste management. This is a servicethat is needed globally, since waste management is a global objective. Also, wastemanagement service supports efforts towards sustainable environment. For ourproof of concept city, we chose Skelleftea, Sweden. A motivation for this is that, inSweden; there are strict laws about dumping of garbage at waste (recycle) stations.One of such is that inhabitants are not allowed to drop their garbage at wastestation in which waste bins are full to capacity. They are required to find anotherwaste station. As a result, this leads to waste of gas and time in locating availablewaste stations by inhabitants.

Page 25: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

2.2. DESIGN AND ARCHITECTURE 19

In next section, we discuss in detail the design and system architecture for oursystem.

2.2 Design and Architecture

2.2.1 System Overview

This section describes the major components of the system and how they relate toeach other. The system overview in Figure 2.1 gives a high level description of thesystem. It includes an assumed real world, SSC core system, a simulation systemand a management system.

Figure 2.1: System overview diagram

• The real world: The real world represents the city recycle-bins being monitoredwith sensors. It also represents every other entity that operates on the recyclebins, e.g. waste collection vehicles.

• Sense Smart City (SSC) Core: The cloud (server) system which stores datafeeds from the real world and provides interface for accessing the data feeds,both in real time and non-real time.

• Simulator: A simplified version of the waste management service is createdwithin the simulation environment. This includes the real world sensors (recy-cle bins) and their properties, the road network, the travel routes, the vehiclesused for waste collection. A replica of the SSC core system, functions like

Page 26: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

20 CHAPTER 2. METHODOLOGY

data computation (e.g. route optimization) on sensors data feed is also per-formed in the simulation component. The simulation system helps in tryingout modifications or changes before they are made in real system.

• Management System: This unit represents the control panel and monitoringunit for the system. Management system uses data from the SSC core unitas dataset for performing some value added computations. For example, itcan calculate the optimal route for the waste-collection vehicles during wastecollection process. It provides a real-time status and state of the recycle stationand recycle-bins in real world. It also displays output from the simulation,which helps in comparison of simulated system with the real system.

2.2.2 Control Flow

As illustrated in Figure 2.1, the arrow shows a high-level control flow of the system.All data used in the system are retrieved from the real world that represents therecycle stations and bins. A major part of SSC core component is the data retrievalsystem, which is responsible for collecting data from sensors in real world. TheSSC core has a well-defined interface through which data stored can be accessedby the simulator and the management system. The aim of the set-up in Figure 2.2is to achieve a stable results from both SSC Core and simulator under the samecondition and factor.

Figure 2.2: Control Flow

From Figure 2.2, function F1 and F2 are expected to be the same function to

Page 27: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

2.3. SYSTEM ARCHITECTURE 21

achieve a stable state between the two components. Once in a stable state, we canassume that the simulation environment is a replica of the real world. The nextstep here is to make changes in the simulation variables and observe the effect ofthe modification.

Our framework aims to solve problems regarding changes in various service op-eration and its effects. Through the management system, we can easily determinewhat the effect of the changes will be in the long run. This will ensure a stablesystem and reliable system under different circumstances.

2.2.3 System Data Flow

Figure 2.3 shows a data flow diagram from recycle-bin sensors through the gatewayto the SSC Server. Figure 2.3 also shows service application, guidance application,which connects to the SSC server to access information about recycle bin status.The main data used in the system is primarily generated from the recycle binsusing ultrasound sensors to measure the level of waste in each recycle bin. Thesedata are sent through the network gateway to SSC servers where they are storedin a database. The topmost layer of Figure 2.3 shows the management and thesimulation systems.

2.3 System Architecture

In this section, we describe the major components of the system as shown in thesystem architecture diagram in Figure 2.4. The major components are describedin the following sub-sections. It suffices to know that, as mentioned previously, ourproof of concept targets waste management system. Some of the components inthe architecture are in relation to the proof of concept, but the architecture can beeasily applied to other type of services.

2.3.1 Recycle Centers and Recycle bins

The recycle centers considered in this research are stations with specialized type ofrecycle-bins, which are equipped with ultrasound sensors to determine the level ofwaste in bins. The sensors have network communication capability. Using 802.15.4(Zigbee) network, the sensor device can communicate with a gateway device placedin same recycle center. The status of bins is periodically sent to the gateway withconfigurable time interval. The SSC server has a record of all deployed recycle binsensors with their its properties such as the association between each recycle stationand recycle bin sensor. Other properties include the waste type for each bin.

Page 28: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

22 CHAPTER 2. METHODOLOGY

Figure 2.3: System Data Flow

2.3.2 Network Gateways

The gateway helps to send data from the bin sensors to the SSC server using differentcommunication means such as 3G, LTE, Wi-Fi and possibly LAN network connec-tion. The gateway also provides features, which ensure all data are successfully sentto the SSC server even when network temporarily fails. This is made possible bya light database system, which stores records that cannot be sent directly to theserver due to network communication problem.

2.3.3 Sense Smart City (SSC) Server/Cloud

SSC server is the main part of the system. It works in connection with the sensorsand gateways to make the last tier in the data retrieval system. The SSC cloud alsoserves as data storage system, which stores the records of all sensor values. TheSSC server is designed as a RESTful server to ensure easy interfacing with other

Page 29: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

2.3. SYSTEM ARCHITECTURE 23

Figure 2.4: System architecture

Page 30: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

24 CHAPTER 2. METHODOLOGY

components. It provides a REST API through which data is sent and retrievedfrom the server, and also provides special interface for the simulator to load recordsof stored system’s properties dynamically when a simulation process is initiated.Lastly, SSC server supports communication with other third-party components orcompanies through well-defined APIs to retrieve data.

2.3.4 Management System

The management system provides tools to control the service and it utilizes datafrom the SSC clouds for its functions. The typical functions carried out are:

• User interface for system visualization: Maps and graphs showing real-timeinformation about status of target system and also simulation results.

• A trigger system, which signals when some actions are required to be taken(in our proof of concept, this relates to waste collection process).

• Dashboard for system control and preference settings.

The management component is highly dependent on the server component sinceit requires access to real time data from the server. It uses sensed data from thesensor bins to provide value added services such as optimization of travel distanceduring collection of waste by collection trucks. It also provides basic administrativefunctions such as management of the sensors, such as adding new sensors to recyclestation and general settings such as maximum trigger threshold, minimum thresholdas well as minimum number of stations that can be considered for waste collection.The maximum threshold level determines data value from bin-sensors that triggersthe system. It gives visual representation of the data from bin-sensors using mapsand high quality graphs. The management system helps in comparison of simulationresult and real application result.

In the management system, a feature known as the trigger system serves asan alternative to schedule system used by waste management companies for wastecollection. Usually, waste collection activities are done, by following some form ofroutine schedules. We believe that having a system that can monitor the amountof garbage in waste bins can give an alternative to the routine schedule systemof waste collection. We also believe that this alternative can prove more efficientsince optimization can be easily achieved using the information about the level ofgarbage in waste bins to inform the company of stations that need to be visitedat a particular time. This can eliminate waste of time and gas for trucks going tostations that are not yet eligible for waste collection. In our system, eligibility ofwaste stations determines if a station should be visited during a waste collectionprocess. We defined a percentage threshold parameter that can be changed to give

Page 31: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

2.3. SYSTEM ARCHITECTURE 25

the most optimal effect. For example, a company can define eligible stations asstations with waste level of 70 percent or more.In our system, we have three main eligibility states; all these states are representedin percentage of garbage level (quantity) at waste stations. Also, there are eventtriggers associated with switching between two states, most especially the change ofstates between “almost-eligible” and “eligible” states. The SSC core system listensto the events and takes necessary actions in respect to a fired trigger.

• ’Eligible’: This is a state when a waste station needs to be visited for wastecollection. This state requires urgent action to be taken.

• ’Almost eligible’: This is a state between “eligible” and “non-eligible” state.All stations in this state when a waste collection activity is on-going shouldbe considered as well for waste collection.

• ’Non-eligible’: This is a state when the station does not have enough waste orgarbage, which requires waste collection

Figure 2.5: Illustration of possible states of waste stations

Sample scenario: Assume we have a waste management company with tenrecycle bins of same type at different places. The interest of the company is toknow when to go for waste collection using our alternative approach to scheduletiming. They determine two main variables. The first is the eligibility settings andsecondly, the minimum number of bins that can be considered for any waste col-lection. Assume they have the following eligibility settings defined for their recyclebins:

• 0% - 60% waste level: defined as non-eligible state

• 61% - 85% waste level: defined as almost-eligible state

• 86% - 100% waste level: defined as eligible state

Page 32: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

26 CHAPTER 2. METHODOLOGY

• Minimum number of bins allowed per waste collection - 3 bins

• Total number of bins - 10 bins

Our proposed alternative to scheduled waste collection process critically dependson alert triggers during change in eligibility states. Since the minimum number ofbins considered per waste collection is three, hence, the company will be notified towaste collection action when 3 or more bins have reached or exceeded 86% wastelevel. At this time, a dispatch for waste collection is required. At the time ofcollection, all bins in the “almost-eligible” state are also collected.

Page 33: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

2.3. SYSTEM ARCHITECTURE 27

System Operations Flow Chat and Illustration

Figure 2.6: System operations flow chat and illustration

Page 34: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

28 CHAPTER 2. METHODOLOGY

Details of operation flow chat: The following steps explain the system op-eration flow chat in Figure 2.6.

1. System operation starts with launching the web application within a tradi-tional web browser

2. There are system operations that operators can perform. These include, mon-itoring status of recycle stations, management of sensors (e.g. adding newsensors) etc.

3. Waste collection process is required once trigger* is fired from the system’snotification feature (This depends on current threshold settings).

* Trigger Condition: This is a condition when one (or more) of the stationshas filling level greater than the maximum threshold value.

4. Operator sends list of stations that are valid for current waste collection toSSC server, and receives route as response from the server.

* List of stations sent: The stations sent to the SSC are stations withfilling level greater than the minimum-threshold.

5. Waste collection process is done, collection trucks takes suggested route.

6. When operator wants a more optimal system operations *: E.g.Operator wants to determine the best start point for a set of recycle sta-tions. Operator selects set of stations and start node at the simulation controlpanel (This can be repeated for different start nodes, which will give differentresults).

* System operations: Simple Scenario: A manager wants to have wastecollection truck waiting at the best place. Since the list of stations chosen forcollection in each trip are all logged in the SSC database, we can select setof stations (or just stations) that are chosen for collection most often (fromthe logged records). The list of frequently visited stations can be submittedto the simulator to get the optimal starting point.

7. Simulation engine outputs the optimal start point with list of stations andsends to SSC.

8. Operator changes the system settings (start point) and applied it to the nextcollection process.

9. Ideally, there should be improvement with the system operations (in respectto distance covered, or travel time). But, if otherwise, the simulation modelshould be reviewed for change

Page 35: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

2.3. SYSTEM ARCHITECTURE 29

2.3.5 Simulation

A replica representation of recycle bin, routes, collection vehicle etc. is createdwithin the simulation environment. We modeled the interaction between inhabi-tants, recycle-bins and waste management companies. With all factor being equalto the real life scenario, the result of data computation such as route optimizationgenerated in the simulation environment should yield same result with real system(base hypothesis).

Simulation system supports modification in simulation environment such as ad-dition of new recycle bin (station) in the city, modification of size, number of binsand number of vehicle used during waste collection. The modification can lend agreat help in learning how changes could affect the city waste management system.

It could also help to predict a new scheme or settings and establish the viabilityof such scheme or settings.

Figure 2.7: Simulation data flow

In Figure 2.7, the input module is used to define the input systems. The sim-ulation module is the core model representing operations such as waste collection,waste filing and other procedure-oriented operations. The output module representsthe results. We present a framework of dynamic data simulation by importing theinformation about real stations from the SSC system along with their locations,waste-bins information with threshold levels and other properties such as road net-work and distances between stations. For example:

Page 36: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

30 CHAPTER 2. METHODOLOGY

• Retrieve the recycle stations GIS information.

• Retrieve distances, initial settings or input parameters like max and minthreshold values for each station and posts the results during and after eachinstance of simulation.

• Modifications such as adding a new station, moving a recycle station or re-moving.

We recreate the process of waste filling and waste-collection.

Figure 2.8: Simulation data flow

The methodology is as follows:

• Each waste bin has amount of waste and capacity set by the operator.

• The model begins with filling waste at selected set of stations based on statis-tics shown on the management interface.

• The operator sets a percentage based threshold value at the managementinterface, When the waste level is greater then the threshold level an alert toempty the waste-bin is triggered at the management console.

Page 37: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

2.3. SYSTEM ARCHITECTURE 31

Figure 2.9: Waste level representation in simulation

• Likewise in the simulator, the waste collection process begins after an alert iscreated in a similar fashion during waste filling activity.

• Waste management company collects waste from waste-bin and empty thebins by using the shortest route to reach that location.

• The route for a set of eligible stations is calculated dynamically consideringthe ones that cross their peak levels.

• The truck can only take the bins according to its load capacity i.e. it is setby the operator.

• The truck moves to a route from a fixed start-point.

• The truck moves to the direction according to the route planned by the MSTalgorithm.

• The waste-collection process is dynamic and applicable to a set-of-bins withpeak values above the threshold level only.

• The time passes in discrete steps called ticks. A built in counter so you cankeep track of how many ticks have passed.

Page 38: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

32 CHAPTER 2. METHODOLOGY

• For every tick a certain amount of waste is added or distributed to waste-binsand it is a continuous process.

• Due to this dynamic and stochastic nature of waste collection, it is impracticalto pick a station when the truck is already scheduled or on a route. Presentlywe have thought that the driver can be alerted through communication aboutany station to be visited when he is on the road trip.

• The waste-filling process is basically as similar to the SSC system and canbe used to predict the time taken by the waste-bin to get filled and reach itsthreshold level, the route time for a set of stations, the time the waste stationtook to be emptied after reaching the threshold level and so on.

2.3.6 Guidance System for City Habitants

In cities with large number of habitants, it is quite common to find most recyclebin full to capacity when planning to dispose waste. City Inhabitants waste timeand fuel trying to locate other available recycle-bins or stations. Since smart citiesaims to provide a supportive [11] environment, we propose a guidance system forcity habitants, which easily provide information about usable recycle stations.

The following steps describe the operation flow of the guidance application inFigure 2.10.

1. Mobile app users selects operations (either finding station or checking statusof recycle stations)

2. (Option 1: Find nearest available stations) user sends waste type he/shewishes to dispose to the SSC server

3. (Option 1: Find nearest available station(s)) SSC server performs search fornearest station with enough space to dispose waste and returns result to mobileapp.

4. (Option 2: check status of recycle stations) Users select specific recycle station

5. (Option 2: Check status of recycle stations) SSC server fetches current statusdata of recycle bins at selected stations and return result to mobile app.

6. Application displays details of response from server to the user.

Page 39: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

2.3. SYSTEM ARCHITECTURE 33

Figure 2.10: Operation flow chat and illustration

Page 40: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

34 CHAPTER 2. METHODOLOGY

2.4 Implementation

2.4.1 SSC Server

The SSC sever is the central component of the whole system which stores data andalso provides protocol via which data can be retrieved from or sent to the server.The two main functions the server handles are receiving data from gateway andsending data in respond to requests from services that rely on the data, companiesand client applications. To effectively provide these two main functions, we madethe server a RESTful server. REST (see Appendix A.1.1) relies on stateless client-server cacheable communication protocol.

The back-end application is implemented using PHP (see Appendix A.1.2) script-ing language, and also using a powerful PHP MVC architecture framework calledCodeIgniter. The web server used is Apache server, which runs on CentOS Linuxoperating system.

Figure 2.11: Major software stack of a LAMP (Linux, Apache, MySQL and PHP)server.

SSC Server

The main technologies used are based on the PHP server side programming lan-guage.

• Web server Apache 2.2.15 (Unix)

• Database server MySQL 5.1.52

• Server side scripting language - PHP 5.3.3

Page 41: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

2.4. IMPLEMENTATION 35

2.4.2 Gateway

The gateway receives data in XML format from the sensor-enabled bins at the re-cycle center. Multiple sensors send XML data to the gateway at interval. XMLdata from sensors are processed within the gateway and converted into JSON (seeAppendix A.1.3) format (communication data format standard for SSC server).Network communication is enabled, mainly by using Apache HTTP component 1.5provided for Java.

The gateway uses MySQLite (see Appendix A.1.6) for its internal database. Thisprovides a lightweight file database system, which is used when there is a networkfailure while sending data to the server. Data are not permanently stored in thedatabase; data are stored just for the period when there is network failure. Oncethe gateway regains network connection with the server, stored data are sent overto the server in bulk since the server REST API supports submission of multiplesensed data at once. The gateway internal database has a table with the followingfields: TIMESTAMP, SENSOR ID, POS LONGITUDE, POSITION LATITUDE,DATA VALUE.

Figure 2.12: Gateway architecture

Gateway implementation

The gateway provides communication between the sensors and the SSC server. Itis implemented using Java language (see Appendix A.1.5). The gateway providesthe following functions.

Page 42: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

36 CHAPTER 2. METHODOLOGY

• Connection via multiple network interfaces

• Data Prioritization

• Storage of sensor data (when there is network failure)

• Handover interface (switching between interface during operation)

• Minimize bandwidth usage

2.4.3 Simulation

Interfacing with NetLogo Simulator

The communication between the simulator and the SSC server is achieved via Net-Logo (see Appendix A.1.10) plug-in implemented in Java language. Since we aim toachieve a RESTful communication in the whole system, we defined a REST inter-face through which the plug-in can retrieve all available records of target system’sproperties on the server.

The communication between NetLogo and other components in the system ishandled by the implemented plugin, which contains different procedures that handledifferent communications. Some of the primitives are shown in Listing 2.1 to 2.3

Listing 2.1: Submitting data to the server

rest_extension:restPOST url param

restPOST:

call to function within plugin

Parameters:

url - "http :// SSC_url/api/submit/NetLogo"

Param - "List of data to send to server"

Listing 2.2: Retrieving recycle-bin data feeds from the server

rest_extension:restGET "url" "param1 ,param2"

restGET:

call to function within plugin

Parameters:

url - "url address",

Param - "sensor -id,depth -of-record"

Returns:

2 dimensional LogoList [sensor -id, gtw -id, data -value , timestamp ][]

Page 43: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

2.4. IMPLEMENTATION 37

Listing 2.3: Retrieving sensor properties from server

rest_extension:GetSensorProperties url

GetSensorProperties:

call to function within plugin

Parameters:

url - "http :// SSC_url/api/request/sensor_properties"

Returns:

2 dimensional LogoList [sensor_id , name , type , lat , long ][]

(records of sensor properties)

The plug-in basically makes http connection using org.apache HttpClient class.It uses http GET method in rest extension:restGET and rest extension:GetSensorPropertiesprimitives. It uses http POST in rest extension:restPOST primitive.

GIS Extension

There is a need to represent real locations of stations in NetLogo, hence, we spatiallyrepresent them with the help of GIS information. GIS describes any informationsystem that integrates, stores, edits, analyses, shares and displays geographic in-formation. In more generic sense, GIS applications are tools that allow users tocreate interactive queries, analyze spatial information, edit data, maps and presentthe results of all these operations. We make use of shape files where data stored ina vector description of points, lines and polygons, each of which can be associatedwith a table of attributes. The following are examples of attributes:

• The population of an area.

• Connecting nodes or points to a destination.

• The distance between two points (i.e) source and destination.

• If a path is a road or bridge. Type of road, one-way or two-way etc.

Essentially, GIS is a useful medium for representing model input and output ofa geospatial nature. We explore the opportunity of linking a GIS with a simulationmodeling system purposely built, and suited to support the requirements of ABM.

The representation of longitude and latitude of every recycle station in NetLogoworld is based on a linear transformation. The easiest way to define transformationbetween GIS space and NetLogo space is to take the union of the envelopes orbounding rectangles of all datasets in GIS space and map that directly to the boundsof the NetLogo world.

The GIS dataset is loaded using the gis:load-dataset primitive, this primitivereports a vector or raster dataset depending on the type of file passed to the prim-itive.

Page 44: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

38 CHAPTER 2. METHODOLOGY

Figure 2.13: Geographic representation of stations.

Advantages of GIS include, visualization of geographic data, queries of Geo-graphic data, processes (agents) can be informed by data and it helps models toexist in realistic environments. One of the challenges encounter include ensuringthat features of GIS map within NetLogo align with the same features of anothermap.

NetLogo Extension: NetLogo Extension API allows definition of NetLogocommands (outside NetLogo environment) using JAVA. Mainly used for CPU in-tensive computations (back propagation), defining complex operations (Matrix mul-tiplication, route optimization) or using any external libraries to support cloud ser-vices.

2.4.4 Database

The backend database is driven by MySQL (see Appendix A.1.4). MySQL is apowerful open source database with high performance and reliability. We choseMySQL because of easy integration with application built on LAMP stack (Linux,Apache, MySQL, PHP). The database design includes a number of tables such asgateway feeds, sensors, gateway and location distances.

Database Schema

Waste bin sensors table stores information about sensors used in the project.Gateway feeds table stores data sent from all gateways, this is the main and largestpart of the database.

Page 45: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

2.4. IMPLEMENTATION 39

Location distances, the distance between two different locations stored in this tableare used in computing the optimal routing.Recycle stations table stores record of recycle stations. A recycle station may haveone or more recycle-bins; hence there is one-to-many relationship between recyclestations and bins.

Figure 2.14: Database Schema

2.4.5 Management System

The management system was implemented as a traditional web application us-ing front-end web technologies. Development language and libraries used includeJavaScript (see Appendix A.1.7), JQuery, Google Maps and Wijmo. The manage-ment system communicates with the SSC server with the help of JQuery’s Ajaxrequests. Graphs visualizations are created using Wijmo library. For geo-locationvisualizations, we utilized Google Map API.

2.4.6 Guidance System

The guidance application is an Android based (see Appendix A.1.8) mobile app,which was implemented using a web-based approach. There are numbers of frame-works that provides HTML5 web-based implementation of mobile apps, some pop-ular ones include Titanium, PhoneGap and Sencha. We utilized PhoneGap (seeAppendix A.1.9) framework to create an HTML5 application. In addition to Phone-Gap framework, we also used JQuery Mobile library to provide a mobile friendlyuser interface and also provides Ajax communication with SSC server. PhoneGapframework provides access to native device APIs, and hence makes it easy to retrieveplatform dependent data such as geo-location.

2.4.7 Geographical Search

We apply the use of geo-search function to determine the recycle stations, which areclosest to the mobile app users. For each request made from the mobile application,

Page 46: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

40 CHAPTER 2. METHODOLOGY

the geo-search function which resides on the server side finds the recycle stationsthat matches the criteria and sorts the result in order of the distance from the user.

Geo-search is widely incorporated into many services today and it is importantto have an efficient process of achieving this. There are various ways of making ageo-search functions, some are most effective for a particular region and cannot beused in search for a large area. In our geographical search, we utilized an approach(see Appendix B), which is very effective for geo-search in most cases especially incases that deals with large number of records of location.

Known parameters: As shown in the database schema, we have the location ofeach station.

• User Location (longitude and latitude retrieved from mobile application

• Location of recycle stations (longitudes and latitudes stored in database)

Expected result: First n record of recycle stations closest to the user locationsorted by distance

2.4.8 Chapter Summary

This chapter discussed the methodology approach used in this thesis. The firstsection gave a detailed description of how the thesis research design was achieved,the pre-study, target city service, development framework and proof of concept.The second section described the system design and architecture as well as eachcomponent of the system was discussed in this section. Lastly, the technologiesapplied and used during the implementation of this project were listed rangingfrom web technologies to mobile technology as well as the supporting simulationtools used. The next chapter will discuss the results of the thesis.

Page 47: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

Chapter 3

Result

As stated in the introduction chapter, the main goal of our thesis is the design andimplementation of smart city development framework, this includes integration ofdeveloped real system with simulation to validate the simulation model and subse-quently use the simulation to try out modifications in target systems before tryingit out in the real systems.

3.1 Web Server: Amount of Data and Processing

Time

The communications between the system’s components are done mainly over httpprotocol. The amount of data retrieval units installed determines the amount ofdata sent throughout the entire system. Another factor that determines the amountof data is the type of target service. Depending on the type of service, the systemmay require update from data retrieval system at varying intervals. The developedframework supports having variable update interval in respect to the applied ser-vice.Since communication is done mainly via http protocol, and specifically, REST ser-vices which boils down to web GET/POST HTTP requests. The request’s process-ing time on the server side varies between 50ms to 500ms. Also, as with every webserver, processing time varies with load.

3.2 NetLogo: Performance and Processing

NetLogo is a popular free and open source agent-based simulation system. It enablesrapid simulation of both decentralized algorithms and geographic environments. As

41

Page 48: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

42 CHAPTER 3. RESULT

there is a dynamic, agent-based approach to waste management simulation, anagent’s behavior can typically be characterized as a series of queries and updates tothe management system.

The simulation component is specially designed with a collection of interactingagents each of which may have its own behavior in the GIS environment. A smalllibrary of the new version of NetLogo’s keywords and functions is available to helpwith implementing decentralized algorithms. This library “become” (change state),“broadcast” (message to all neighbors),“send” (message to specific neighbor), androutines for network initialization, message receipt, and scalability testing. NetLogoalso includes the BehaviorSpace tool for automating the running of experiments onprotocols. Typical scalability test investigates the number of messages generatedby the algorithm as the network size and data load increases

The experiments through NetLogo should also investigate correctness, robust-ness to sensor errors and faults.The faults are usually described in two types:

1) Stop faults (node or link stops functioning) and

2) Byzantine faults (message corruption or state changes).

While we automate the running of experiments on protocols, typical scalabilitytests investigate the number of messages that turns out to be error free.

3.3 Application of Framework to target service

Here are steps taken in applying our designed framework to the waste managementservice:

1. Identifying datasets which are needed in carrying out the targetservice: In case of our target service, the primary data which controls howthe service is carried out is the amount of waste in waste bins at a specifictime.

2. Adapting framework’s Data Retrieval Systems to the identified datasetfrom the first step: This step requires installing necessary sensors whichhelps in monitoring waste level in waste bins.

3. Service information setup: Information such as geo-location of waste sta-tions, names of stations, types of waste and other related information areinstalled on the central server.

Page 49: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

3.4. PROOF OF CONCEPT AND RESEARCH APPLICATION 43

4. Setting up simulation environment: Since we aim for a dynamic frame-work, most part of the simulation setup is done by loading data from thecentral server i.e. (service information setup) via REST.

5. Date update to central server: Data is being sent to central server atinterval ranging from 30min - 60mins. Waste stations with more visits havesmaller update interval while those with lesser visiting rate have higher updateinterval.

6. System operations: Once we have data being updated to the central server,the next and last phase is the system’s operational functions.

3.4 Proof of Concept and Research Application

For the proof of concept, we consider waste recycling system in Skelleftea city. Oursystem retrieves data from recycle bin equipped with sensors placed at differentlocations of the city to determine the status of the bin in respect to amount of wasteit contains. The real time data is stored and made available through accessibledefined interface for the municipality and private companies. The information isused to provide value added service, which intends to benefit the citizens and themunicipality as well as waste management companies. The proof of concept is toshow how the proposed framework can be useful and helpful in development anddeployment of various types of Smart city services.

We propose a better option to replace routine based waste collection. Insteadof using a routine based schedule, our system monitors the status of recycle binsat recycle stations and based on the system’s settings, alert the management whenwaste collection process is due. This ensures that only recycle stations that are trulydue for collection are visited and also eliminates the need to visit stations with verylittle amount of waste. With the complement of a simulation system, the systemcan be extended to make prediction-based results informing the management aboutthe next waste collection process. In addition, the system offers an optimized travelroute for trucks and number of trucks that should be dispatched during waste col-lection process.The second aspect of this research provides mobile application for citizens to mon-itor the status of recycle stations. Detail information about the status of recyclestation and waste types is very important in some places e.g. in Sweden where thereis strict recycle rules.The third aspect of this research is integration with simulation engine to augmentthe other aspect of the system. In effect to having a more generic solution, the sim-ulation (scenario) is modified from a static simulation (fixed location points/specificto one place) setup to a dynamic setup (any locations points or map) supported by

Page 50: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

44 CHAPTER 3. RESULT

a cloud server. The setup should allow loading of sensor properties such as loca-tion, type of sensor (type of waste bin) etc. from the server, and this should reflectchanges when the information of the sensor properties on the server changes too.

We present a system operation flow with screen-shot tags in Figure 3.1. Thisdiagram shows how the screen shot relates to the developed system.

Figure 3.1: System Operation flow with screen-shot tags

Page 51: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

3.5. MANAGEMENT SYSTEM WEB APPLICATION 45

3.5 Management System Web Application

Management front-end Web Application

The main interface program of the implemented system is made as a web-basedapplication, which runs within a typical web browser. This part of our system givesvisual representation of the states of the recycle bins at various recycle stations tothe users of the system (application administrators in waste management companyor municipality)

The following figures from Figure 3.2 to Figure 3.10 show various interfaces ofthe system for different features.

Figure 3.2: Management system: Waste level monitor view

Figure 3.2 is the landing interface, which shows the list of recycle-bins in the leftpanel and a map view of Skelleftea with indicators for locations of recycle bins. Theindicators also indicate the status of the bins i.e. current level of waste (garbage).The information panel at the lower pane shows corresponding information for se-lected bin. Displayed information includes name of location, sensor id and current

Page 52: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

46 CHAPTER 3. RESULT

waste level, and geo-position.

Figure 3.3: Management system application: Recycle station view

Figure 3.3 shows the interface for the station view option. This option shows sta-tions instead of each recycle bins. Left pane shows lists of waste stations, selectinga station shows the bins in the station at the information panel. Other informationdisplayed includes type of waste allowed.

Figure 3.4 shows interface for the graph mode of the web application. The graphfeature allows users to view the sensed data over time. It allows manual selectionof time range or pre-defined such as ”1 week ago”, ”2 months ago” etc.

Figure 3.5 shows interface for the sensor management tools. This view providestools for adding new sensor to the system, or editing as well as deleting sensors.Some of the important fields for a new sensor entry are sensor-id, waste type, stationname and geo-position.

Page 53: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

3.5. MANAGEMENT SYSTEM WEB APPLICATION 47

Figure 3.4: Management system application: Graph display

Figure 3.5: Management system application: Sensors management view

Page 54: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

48 CHAPTER 3. RESULT

Figure 3.6: Management system application: Waste collection process

Figure 3.6 shows interface for the waste collection feature of our designed sys-tem. When the waste collection process is triggered, clicking on the notification barautomatically brings up this view. The middle panel shows list of recycle bins thatqualifies for collection. The bins are listed in order of waste level. The left panelshows button to calculate an optimal route for the collection process. The routegiven as suggestion is shown on the map in the right pane of the application view.Since the route calculation is carried out using distance matrix, we provide buttonsto also show the input matrix, which is the matrix of location distance of stationsfrom one another. The output matrix is the matrix that represents the optimalroute.

Figure 3.7 shows log of simulation results from the simulation module. Thesystem keeps record of all simulations results to allow review of these data overtime. Each simulation session has records of number of simulation and environmentsettings used for the simulation session. Selecting a simulation record on the leftpane shows details of environment settings for that simulation session. The graphon the lower panel shows average simulation result over time.

Figure 3.8 shows the settings view of the system. The important settings vari-

Page 55: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

3.5. MANAGEMENT SYSTEM WEB APPLICATION 49

Figure 3.7: Management system application: Simulation results

Figure 3.8: Management system application: System settings

Page 56: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

50 CHAPTER 3. RESULT

ables include percentage level of waste that should trigger the system, minimumnumber of centers to consider during waste collection and minimum value of wastelevel that should be considered during waste collection process.

Figure 3.9: Management System: Alertnotification display

Figure 3.10: Lists of recycle centers in or-der of waste quantity

3.5.1 Route Optimization

Currently the route optimization is achieved by Prims algorithm, which finds theminimum spanning tree for connected weighted graph. We defined a set of nodesand defined the cost between two points (distance). The “from location” and“to location” related to the location of waste bins (stations), while the distanceis the cost between them (the two points)

From the trigger system, we get lists of recycle centers eligible for visit duringthe next waste collection. This list alongside the distance table (see Figure 3.11) isused to generate a distance matrix, which is an input for the minimum spanningtree algorithm, and the output is an MST covering all eligible recycle-stations.

Page 57: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

3.6. MOBILE APPLICATION 51

Figure 3.11: Distance tableFigure 3.12: Format of generated inputmatrix

3.6 Mobile Application

3.6.1 Guidance System Mobile Application

The guidance system (mobile application) is one of the main aspects of the project.Since smart phones are commonly used, a mobile application offers information tousers at the most efficient and most convenient way. To solve one of the problemshighlighted in the introduction chapter, we developed a mobile application, whichconnects with the SSC central server to help city inhabitants find nearest available,free and usable recycle stations. It also gives option to check status of a specificrecycle station or recycle bin.

3.6.2 Mobile Client

The mobile application is implemented in Android Operating Systems using AndroidSDK Tools. The application access the following:

• User Location: Coarse (network-based) location and fine (GPS) location. Thisis used to determine the location of users when requesting for nearby recyclestations

• Device Network Communication: Connection access for full Internet access isrequired. Request are made via internet hence the application is dependenton Internet connection.

• Storage: Read and write data to device memory. User settings can be storedfor future use.

Page 58: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

52 CHAPTER 3. RESULT

3.6.3 Mobile Application Features

The mobile application enables users to have an up-to-date information about re-cycle stations when they need to use one. The main features includes:

• Finding nearest free(available for use) recycle stations: Helps users to easilylocate available recycle bins and stations.

• Listing out specific/all recycle stations in Skelleftea: Sometimes users mightnot be willing to use another recycle station other than some specific ones.This feature provides real time information about the status of the bins in aparticular chosen station. Users can make plan on when to use the recyclestation based on the information about waste level.

• Map view: A map view which indicates the recycle bin on map

• History Pattern: User can view the trend at a particular station over time.

Finding Nearest Recycle station

Figure 3.14 and Figure 3.15 below shows screen shot options for requesting nearestbin

Page 59: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

3.6. MOBILE APPLICATION 53

Figure 3.13: Menu view of Smart Recycle Bins

Page 60: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

54 CHAPTER 3. RESULT

Figure 3.14: Waste type option: Users se-lects the type of waste he/she wishes torecycle.

Figure 3.15: Waste bin percentage free:Users can increase this option if he/shewants to trash bulk waste.

SSC server responds to search request by returning the nearest available recyclestations. Figure 3.16 and Figure 3.17 shows the screen shots

Page 61: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

3.6. MOBILE APPLICATION 55

Figure 3.16: Nearest recycle stations: Listof recycle stations includes informationabout the waste types allowed in the recy-cle station and current average waste level

Figure 3.17: Recycle Station view: dis-plays name of station, geo-location whichlinks to a map view and status of eachrecycle bins

Listing Recycle Stations in Skelleftea

Figure 3.18 and 3.19: List of recycle stations in Skelleftea. Users can select a specificstation to view the status.

Page 62: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

56 CHAPTER 3. RESULT

Figure 3.18: Recycle stations: List of re-cycle stations at Skelleftea. Users can se-lect a recycle station to view the status

Figure 3.19: App connecting to SSCserver to retrieve current status

Figure 3.20 shows detail view of recycle bin status using graphical gauge foreffective visualization.

Page 63: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

3.7. SIMULATION 57

Figure 3.20: Recycle station view: displays status of recycle bins at selected station

3.7 Simulation

3.7.1 Simulation Component

The Simulation interface provides operation controls in the NetLogo. A set-upbutton operation loads the simulation environment. During the set-up, loading theenvironment also loads the following properties.

• It imports extensions for REST services and GIS.

• It does transformation of GIS space into NetLogo Space.

• It creates a network of links and nodes with properties assigned based on therequirement.

Page 64: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

58 CHAPTER 3. RESULT

• The nodes here are represented as waste stations which are interconnected throughsegments and can be traversed bi-directionally.

• The segments here are the paths and forms a road network with real distancesbetween them.

• The city map is placed based using the .shp file created using QGIS.

• The data on the map is through points, lines vector dataset taken from openstreet maps(OSM).

• The positions of the waste stations is placed as in their real location based ontheir longitude and latitude co-ordinates and the co-ordinates are transformedinto NetLogo coordinates, so that it can be presented in the NetLogo Interface.

• Each waste bin at a station loads its own properties like a unique id, position(X,Y) using longitude and latitude parameters, a name, level of waste anddistance between other station.

• It places vehicles (truck in this case), which start at one of the waste-stationknown as start-point.

Figure 3.21: These are few of the button-enabled operations that an operator usesto begin certain operations.

Figure 3.22: These are few of the button-enabled operations that an operator usesto add or modify changes on waste-bins.

The result for finding the best route between two stations is done using the A*algorithm, In this process, For a given graph G= (V,E) with non negative weightfunction, a source , a target and a called potential function h:V –>R +,A* search computes the shortest weight path from s to t. A* is a generalization ofDijkstra’s algorithm and is widely accepted as a standard routing algorithm, It usesa potential function in addition to the distance function to select the node whichshould be visited next. It repeatedly visits nodes with minimum f(n) and terminateswhen destination has been reached.

Page 65: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

3.7. SIMULATION 59

Figure 3.23: These are few of the button-enabled operations that an operator useswhile making a one-time decision whichdoes short computation in less time.

Figure 3.24: These are few of the button-enabled operations that an operator useswhen he wants to make a decision over aperiod of time

f(n) = g(n) + h(n) (3.1)

Where g(n) is the actual weight from source till node n and h(n) is the estimatedweight from node n to the destination nodeSummary of the Algorithm: For A* to search for optimal path, the heuristic func-tion h has to be feasible which means that the estimated weight from any node nto destination should not be more than the least possible weight path.

Totalweight(u,v)− h(u) + h(v)> = 0 for all nodes u,v in V. (3.2)

This implies that the resulting new edge ”weights”

Totalweight(u,v) = totalweight(u,v)− h(u) + h(v) (3.3)

are still positive , which is necessary in Dijkstra’s algorithm as well as A* search towork correctly.

In this result (Fig 3.26 operation of simulation component, we find the beststart-point to start the truck or for the truck to wait before it is sent for collectionof waste (Route planning phase). The result for selecting a set of stations is shownin the interface side after the inputs is been simulated; this instance with the resultis being stored with all the inputs for follow up and validation.The procedure behind the start-point selection has two properties; distance betweenthe points and degree of separation. The operator selects a set of stations to de-cide the initial station for starting the waste-collection (start-point). The selectedstations are done from the GUI using the mouse-select functionality. The selected

Page 66: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

60 CHAPTER 3. RESULT

Figure 3.25: A one-time result being displayed as the best route between two stations

Figure 3.26: A one-time result being displayed as the best start-point for wastecollection

Page 67: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

3.7. SIMULATION 61

stations are basically selected based on statistics from the management, they canbe for stations that are frequently visited or at key locations in the city.

Using the Show-best-point button in the interface, an algorithm is processedwith the set of stations as input values and their real time distance between thesestations. The result runs iteratively for all the selected stations each time for thesame inputs but a different station as start-point and gives the best start-pointbased on the simulated procedure.

Working Summary: The algorithm used for analyzing the simulation with severalinput settings is Dijkstra’s algorithm. We focus on two things here, The shortestdistance to be visited from a selected point as start-point to all other points usingthe route calculated by the MST at the management side. The degree of separationbetween the stations is found by using the Dijkstra’s algorithm.In graph theory, the shortest path problem is the problem of finding the shortestpath between two nodes in a graph such that the sum of weights of its consistentedges is minimized. An example is finding the shortest path from one location toanother location on a road map. In our case the nodes represent locations and theedges represent the segments of road and are weighted by the length of the roadsegment. There are several variations according to the given graph is undirected,directed or mixed. For undirected graphs, the shortest path problem can be formallydefined as follows:

Given a weighted graph (a set of nodes V, a set of Edges E and real-valuedweight function f: E –>R) from v to a v’ of V so that sigma f(E) is minimal amongall paths connecting v to v’.

In the NetLogo, to find the minimum distance path between two points, eachturn in road is a node and the road segments are edges. Let the waste station atwhich we start be a waiting point or start point, Let the distance of node Y be thedistance from the initial bus stop to Y.

Dijkstra’s algorithm (see Appendix D.1) will assign some initial distance valuesand will try to improve them step-by-step.

Dijkstra’s algorithm is a greedy algorithm, it visits the nodes radically in alldirection, once visited it does not visit the same node twice which is useful in ourcase.

This is the result obtained by running the simulation over a period of time, thevalues are obtained, while we run the procedure of waste collection and filling bythe operator and records the time taken by each route from different start-points.The operator selects a set of stations like in the previous case, which can be donefrom the GUI using the select-bin button (mouse-select) functionality. The selectedstations are basically selected based on statistics from the management; they canbe for stations that are frequently visited or at key locations in the city. The route

Page 68: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

62 CHAPTER 3. RESULT

Figure 3.27: A result displays the least route time by the truck from different start-point’s to go around for route.

time result is the average of three values for each station e.g.Travel time for

start− pointx = (travelTime− 1 + travelTime− 2 + travelTime− 3)/3.(3.4)

These results are saved at the management side for further analysis and appli-cation of the value in real environment.

Figure 3.28: A table that shows time taken during simulation for three recyclestations: With maximum threshold being constant, a case before adding a newstation

We mimic the process of waste filling and collection as in the real environmentand then measure few of the performance metrics to know analyze or predict thetime taken to fill and empty the waste bins. The inputs to the simulation here are alist of selected stations based on statistics. Decision-making selections like algorithmfor waste-distribution to the bin, time of day which can be weekend, weekday orgeneral holiday is also considered.

Page 69: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

3.7. SIMULATION 63

Figure 3.29: A table that shows time taken during simulation for three recyclestations: With maximum threshold being constant, the wait time of recycle stationgets reduced after adding a new station

This result demonstrates an addition of a waste bin in a populated region andthereby decreasing the wait-time and frequency of visits to a particular station.Addition of extra waste-bin in the simulation is done by, using the add-bin operation.

Figure 3.30: Recycle stations: The forever button operation in NetLogo enables toselect/edit/add/remove recycle-stations with a proper input validation.

Determining a stable threshold to keep against volume of bins.

With the help of “Edit bin” property, a waste station property called “population-level” is increased to 3, this assumes the station to be in a highly populated area.

Page 70: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

64 CHAPTER 3. RESULT

Figure 3.31: Recycle stations: A result displays the frequency of visits made bythe truck to a station which is in a populated area, a case without adding a newwaste-bin.

Figure 3.32: Recycle stations: A result shows a slight decrease in the frequency ofvisits made by the truck, a case after adding a new waste-bin at the same station.

Page 71: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

3.7. SIMULATION 65

The waste-bin “E” reduces the workload of its neighboring waste-bin “F” andthereby reducing the time taken to fill the waste. Here the frequency reduced by50 % which can be used as an optimal result to the management. A waste binattribute called wait-time is reduced at that station, It is defined as the time takenafter the waste-bin reaches its maximum threshold-level. The result in the figureshows a slight fall in the frequency of visits to that particular station as shown inthe above diagram.

Reducing wait-time for over-filled bins, by varying threshold levels.

As keeping a right maximum-threshold-level to a waste-bin is a key challenge. Wesee that the waste-bins in real time are used differently based on their geographicalconditions. These waste-bins may or may not have a constant threshold level inreal time. Few of the waste-bins may have a low threshold value and whereas fewmay higher. To decide this or analyze the right threshold level to be kept for awaste-bin, the operator can use the simulation component to decide the maximum-threshold value to be kept at the waste-stations. For this he sets few decision-makingselections for a period of time, which is stored at the management side for analysisand decision-making through graph visualizations.

Figure 3.33: Recycle stations: A graph level that displays a constant threshold inthe three waste-bins, to be used as Case-1.

In this procedure, We keep threshold levels of the waste-bins 1, 2 and 3 constantand simulate them over a period of time with a set of decision making selections atthe interface, However the threshold levels of the waste-bins 1, 2 and 3 in the nextcase varies.

We generate the results as shown below. The process gives us the performance-metrics like wait-time, level-of-the-bin after it was emptied and fill-time which helpsus to understand the waste collection in time and space. This supports the operator

Page 72: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

66 CHAPTER 3. RESULT

Figure 3.34: Recycle stations: A graph level displays a change in threshold level inthe waste-bin 2, to be used as Case-2.

to set a right threshold level to the waste-bin in any demanding location. Whilethe management wants to know the alternate options or modify the operations ofexisting system. The final result comparing figure 3.33 and figure 3.34 indicates agood marginal reduction in the wait-time at the station-B compared to the previouskept maximum-threshold values.

Page 73: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

3.7. SIMULATION 67

Figure 3.35: Recycle stations: A result displays the comparison of results fromCase-1 and Case-2 at the selected stations.

Page 74: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

68 CHAPTER 3. RESULT

Page 75: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

Chapter 4

Conclusion, Discussion and FutureWork

In this chapter, we give our concluding thoughts on our thesis work. In the firstand second sections, we give brief discussion about the approach employed in thiswork and in the last section; we conclude this chapter by stating the future work.

4.1 Conclusion

This research work is an effort towards smarter cities. As discussed in the intro-duction chapter of this work, making cities smarter is one of the important researchareas today. This work contributes towards smart cities technology by providinga development framework, which allows integration of real systems with a simu-lation environment. This mainly helps to study the likely impact and results ofmodifications in systems before being carried out. Since the simulation aspect ofthe proposed system aims to model a replica of the real system in the simulationenvironment, hence, modifications can be tested in the simulation environment tostudy the effects before applying such modifications to the actual systems.A part of this work focused on the application of the proposed system as proof ofconcept. Using Skelleftea city as target city, we implemented a system to aid wastecollection process by using soft real time data from recycle-bins. In our proof ofconcept, the simulation provides some decision support. In addition, a value addedservice for city inhabitant was created also utilizing waste level data from recycle-bins. An additional service allows inhabitants to check for available waste bins orstations using smart phones when needed.For the design, development and implementation of this project, different technolo-gies were used ranging from web technologies to mobile technologies.

The following items highlights main contributions of this project:

69

Page 76: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

70 CHAPTER 4. CONCLUSION, DISCUSSION AND FUTURE WORK

• We developed a framework, which can be used for different smart city ser-vices. This framework is achieved by combining real architecture systemswith simulation environments.

• We implemented a waste management service as proof of concept. The imple-mented service targets waste management companies as primary users, whilecity inhabitants also benefits from implemented service via end-user mobileapplication.

4.2 Discussion

Our proof of concept targets Skelleftea, Sweden. Skelleftea has relatively smallpopulation compared to bigger cities; we employed a one-node server for the coreSSC server. This system set-up is sufficiently effective for the nature of our proof ofconcept, however, in a project targeting bigger cities with services or applicationsrequiring more complex systems, it is ideal to consider a more robust system ofservers (multiple nodes) which can effectively support huge requests, provides faulttolerance, replication and steady availability.

In recent times, one of the major areas of technology that tends to generate bigamount of data is smart city. Data acquired from sensors will eventually lead tohuge amount of data over a period of time. We believe that effort should be madeto adequately manage data generated and it is also important to employ propertechnology for dealing with such huge quantity of data. Furthermore, retrievinginformation from acquired data is of high value. Employing methods such as datamining would help increase amount of useful information that can be derived fromsensor data and hence improve the service value.

About the simulation aspect of this thesis, the simulation modeling was car-ried out using statistical distribution methods, while this gives a fairly good modelrepresentation of the target system, to achieve a model that best reflects a targetsystem, it is ideal to consider historical and statistical data of target system overtime. Considering historical and statistical data can also ensure having more accu-rate simulation models and can also improve the system in area of forecasting andfuture predictions.

The simulation tool used in testing the framework, NetLogo, is designed forresearch and educational purposes, to make complex simulation model capable ofsmooth scaling with larger system, NetLogo might not be most suitable for scalinginto larger systems since it could get really slow and performs averagely with hugedataset. Scouring for simulation requirements and simulation component role wasa challenging part of this research; hence the simulation component is made to usevery basic operations. However this can be extended and enhanced to give better

Page 77: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

4.3. FUTURE WORK 71

solutions of the overall framework.

4.3 Future Work

As part of continuation for this project, lots of future work is ahead for the full im-plementation and full deployment of this project in cities. Future recommendationsand work could be focusing on the following:

• Since we work with assumption of real world (target system), a viable futurework would be the integration of system with actual sensors in cities.

• Application of development framework in other city service. This would alsohelp to determine the aspect of the framework that needs to be abstractedfrom city services. Abstraction of framework functions would make it easierto apply framework to different city services without requiring much changes.

• Extension of the simulation model to provide other decision support operationswith the use of real time data.

• Integration of data into the cloud system and make use of effective technologiesto handle big datasets.

• Employing data mining methods to derive more information from the dataacquired from sensors.

Page 78: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

72 CHAPTER 4. CONCLUSION, DISCUSSION AND FUTURE WORK

Page 79: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

Appendix A

System Design Technologies andMotivation

A.1 Design Technologies and Motivation

For the design, development and implementation of this project, different technolo-gies were used, ranging from web technologies to mobile technologies.

• Web Server: RESTful, PHP, JSON

• Database Server: MySQL

• Gateway System: Java, SQLite

• Browser Client: JavaScript, HTML5, CSS 3

• Mobile Client: Android, PhoneGap, JQuery Mobile

• Simulation Engine: Netlogo, Java

A.1.1 REST

REpresentational State Transfer (REST) is a style of software architecture for dis-tributed systems such as the World Wide Web [19]. REST relies on stateless client-server cacheable communication protocol.

Advantages of REST

• Platform-independent (it doesn’t matter if the server is Unix, the client is aMac, or anything else)

73

Page 80: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

74 APPENDIX A. SYSTEM DESIGN TECHNOLOGIES AND MOTIVATION

• Language-independent (C# can talk to Java, etc.), Standards-based (runs ontop of HTTP).

• It can be used in the presence of firewalls, since it runs on standard HTTP.(Some firewalls block HTTP PUT and DELETE but not POST and GET)

• Flexibility and scalability.

REST architecture style provides a suitable means of achieving distributed sys-tems such as the target of this project.

A.1.2 PHP

PHP is used as the programming language for the core REST system which re-sides on the web server. It is used as a scripting language for functions such asdatabase operations and HTTP request/response operations. PHP is a general-purpose server-side scripting language originally designed for web development toproduce dynamic web pages. It is one of the first developed server-side scriptinglanguages to be embedded into an HTML source document. [20]

Advantages

• PHP can be deployed on most web servers

• PHP is free of cost since it is open source

• PHP development and execution is fast

A.1.3 JSON

JSON or JavaScript Object Notation is a readable data interchange format whichis text-based open standard designed to be readable to human.

Advantages

• JSON is easy to generate and easy to parse

• JSON is language independent, with available parsers for most languages

• It is directly and readily supported by JavaScript.

The JSON format is often used in transmitting serialized structured data vianetwork connection(e.g web server and web application). JSON is an alternativeoption to XML. JSON is considered to be most suitable for JavaScript applicationssince it is estimated to parse faster than XML.

Page 81: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

A.1. DESIGN TECHNOLOGIES AND MOTIVATION 75

A.1.4 MySQL

MySQL is a powerful open source database with high performance and reliabil-ity. Our choice of MySQL is motivated by the reason that it is easy to integrateMySQL with web server application built on LAMP stack (Linux, Apache MySQLPHP/Perl/Python).

Advantages

• MySQL is distributed with Linux systems free of cost

• It is widely used and accepted, hence, there are lots of free tools available.

• Easy integration with LAMP stack

A.1.5 JAVA

Network gateway used between the WSN and Internet (3G / LTE) was developedusing Java programming language. Java applications are typically compiled tobyte-code (class file) that can run on any Java Virtual Machine (JVM) regard-less of computer architecture. Java is a general-purpose, concurrent, class-based,object-oriented language that is specifically designed to have as few implementationdependencies as possible. It is intended to let application developers ”write once,run anywhere” (WORA), meaning that code that runs on one platform does notneed to be recompiled to run on another [21].

Gateway can operate on both Linux and windows platform. Java programminglanguage has been used in various network enabled applications. Also, according toNetLogo extension API, NetLogo plugin has to be written in Java language. Hence,the communication plugin developed for data communication between the NetLogoenvironment and the SSC server was implemented using Java.

A.1.6 SQLite

Storage system for the network gateway is powered by Sqlite database system.SQLite is a in-process library that implements a self contained, server-less, zero-configuration, transactional SQL database engine. SQLite is an embedded SQLdatabase engine. Unlike most other SQL databases, SQLite does not have a separateserver process, it reads and writes directly to disk files.

A.1.7 JavaScript

JavaScript is used to web pages that runs on typical browsers to add functionality tothe web application. It is used to for background communication with the SSC server

Page 82: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

76 APPENDIX A. SYSTEM DESIGN TECHNOLOGIES AND MOTIVATION

through AJAX (Asynchronous JavaScript and XML). JavaScript is a prototype-based scripting language that is dynamic, weakly typed and has first-class functions.It supports object-oriented, imperative and functional programming styles [22]

A.1.8 Android

Android is a Linux-based operating system for mobile devices such as smartphonesand tablet computers, developed by Google in conjunction with the Open HandsetAlliance. Application running on Android ”apps” are developed writing a cus-tomized version of Java. Android uses the Dalvik virtual machine with just-in-timecompilation to run Dalvik executable, which is usually translated from Java byte-code [23]. We created an Android application using a web-based approach. Wechose a web-based approach to native approach because of advantages such as de-velopment speed and support for multi-platform. There are number of frameworksthat supports multiple mobile platforms, one of such is PhoneGap.

A.1.9 PhoneGap

PhoneGap is an open-source mobile development framework that enables softwareprogrammers to build applications for mobile devices using JavaScript, HTML5and CSS3, instead of lower-level languages such as Java or Objective-C. Applica-tions created using PhoneGap are neither fully web applications (since they arenot web pages rendered in browser, but they are packaged as apps for distribution)nor truly native applications (since they do not use platform’s native UI frame-work) [24]. PhoneGap supports several features in various mobile platforms; suchfeatures include camera, accelerometer, geo-location, network, storage, notification,compass, contacts, file, media, and barcode scanner.

A.1.10 Netlogo

The platform of choice was NetLogo , a modeling environment targeted to the sim-ulation of multi-agent systems that involve a large number of agents. The platformaims to provide ”a cross platform multi-agent programmable modeling environ-ment”.

A number of features make Net logo an excellent platform for teaching, a simple,expressive programming language with a small learning curve, Rapid GUI creationand custom visualizations, an environment consisting of patches (components of agrid) and turtles (agents that ”live” on the grid”, enhanced through the use of userdefined variables and allow the modeling of complex environments and agents withtheir own state respectively. It has expressive power and reduces tweak-test-analyzecycle. The platform directly supports the creation of reactive agents, a feature we

Page 83: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

A.1. DESIGN TECHNOLOGIES AND MOTIVATION 77

have taken advantage of not only for educational purposes but also as a means tosupport our research.

Page 84: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

78 APPENDIX A. SYSTEM DESIGN TECHNOLOGIES AND MOTIVATION

Page 85: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

Appendix B

Haversine Formula

The haversine formula is an equation commonly used in navigation, which givesgreat-circle distance between two different points on a sphere from their longitudesand latitudes. For any two points on a sphere, the haversine of the central anglebetween them is given by

haversine(d/r) = haversine(θ2 − θ1) + cos(θ1)cos(θ2)haversin(ψ2 − ψ1) (B.1)

where

• haversin is the haversine function:

haversine(θ) = sin(θ/2)2 = (1− cos(θ))/2 (B.2)

• d is distance between the two different points on the sphere

• r is earth radius

• θ1, θ2: latitude of point 1 and point 2 respectively

• ψ1, ψ2: longitude of point 1 and point 2 respectively

B.0.11 Haversine Formula in SQL Query

R = earth′sradius− 3956δlat = lat2 − lat1δlong = long2 − long1

a = sin2(δlat/2) + cos(lat1) ∗ cos(lat2) ∗ sin2(δlong/2)c = 2 ∗ atan2(

√a,√

(1− a))d = R ∗ c

79

Page 86: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

80 APPENDIX B. HAVERSINE FORMULA

Listing B.1: Translation to SQL statement

3956 * 2 * ASIN ( SQRT (

POWER(SIN((orig.lat - dest.lat)*pi()/180 / 2), 2) + COS(orig.lat *

pi() /180) *

COS(dest.lat * pi() /180) * POWER(SIN((orig.lon - dest.lon) * pi()

/180 / 2), 2) ) ) AS distance

For Burtrsk VC recycle station with lat = 64.7567 and long = 20.9449 - ’@station’User at location -’@user location’

Listing B.2: Translation to SQL statement

SELECT *, 3956 * 2 * ASIN(SQRT(

POWER(SIN(( @orig_lat - abs(user_location.lat)) * pi()/180 / 2), 2)

+ COS(@orig_lat * pi()/180 ) * COS(abs(user_location.lat) * pi

()/180) * POWER(SIN(( @orig_lon user_location.lon) * pi()

/180 / 2), 2) )) AS distance

FROM hotels dest

HAVING distance < @dist

ORDER BY distance limit 10;

NOTE: Angles are converted to radian

Page 87: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

Appendix C

Simulation Task Flow

C.1 Details of Operation Flow Chat (Figure C.1)

• The Operator Opens the web application and does regular operations.

• QUESTION: when the operator thinks that he wants to find the best start-point to a route.

• He chooses the simulation screen and Does the following tasks:

• BUTTON Operation: Click Setup and Start, It loads the Waste-bins on aMAP and sets the global variables.

• INPUT PARAMETER: Choose the waste bins he wants to simulate by high-lighting the SELECT-BINS Button.

• BUTTON Operation: Clicks on ‘best-start-point’ button and the simulationstarts.

• The operation after the first trial, gives the best start-point to start the truck.

• The operator can Inspect and monitor this process on the simulation Screen.

• The results are shown and provides the operator with option to store resulton the server with a unique time-stamp.

• If these results are satisfactory to the operator, he validates and chooses to goahead with the decision of changing the start point.

• The operator then makes the changes in the real system and continues hiswork.

81

Page 88: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

82 APPENDIX C. SIMULATION TASK FLOW

• If the results are not satisfactory, He suggests re-checking the model for pre-dictable results.

C.2 Details of Operation Flow Chat (Figure C.2)

• The operator Opens the web application and does regular operations.

• QUESTION: The operator decides to ensure that the waste-bins are set withright threshold values.

• He chooses the simulation screen and does the following tasks:

• BUTTON Operation: Click Setup and Start, It loads the Waste-bins on aMAP and sets the global variables.

• INPUT PARAMETER: Choose the waste-bins he wants to simulate by high-lighting the SELECT-BINS Button.

• INPUT PARAMETER (Optional): Keeps a constant threshold value EG:Max-threshold = 50 and Min-threshold= 50 for all the waste-bins.

• BUTTON Operation: Clicks on GO and the simulation starts.

• The operation after the first trial, gives the wait-time at the stations and theno of stations visited along with their route time.

• The operator can Inspect and monitor this process on the simulation Screen.

• Assumptions from the results obtained. If the route was able to pick all thebins with less WAIT-TIME at each location.

• If all the bins selected, was able to be part of the route (route-time) and thedistance covered is negligible

• Since these results are satisfactory to the operator, he validates and choosesto go ahead with the constant threshold levels

• The operator then makes the changes in the real system.

• If the results are not satisfactory he changes the threshold values and simulateagain, suggests re-checking the model for predictable results.

Page 89: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

C.2. DETAILS OF OPERATION FLOW CHAT (FIGURE C.2) 83

Figure C.1: Operation flow chat and illustration : Decision support system

Page 90: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

84 APPENDIX C. SIMULATION TASK FLOW

Figure C.2: Operation flow chat and illustration : Decision support system

Page 91: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

Appendix D

Algorithms

D.1 Dijkstra Algorithm

Listing D.1: Dijkstra Algorithm statement

123 function Dijkstra(Graph , source):

4 for each vertex v in Graph: // Initializations

5 dist[v] := infinity ; // Unknown distance function

from

6 // source to v

7 previous[v] := undefined ; // Previous node in optimal

path from source

8 dist[source] := 0 ; // Distance from source

to source

9 Q := the set of all nodes in Graph ; // All nodes in the

graph are

10 // unoptimized - thus

are in Q

11 while Q is not empty: // The main loop

12 u := vertex in Q with smallest distance in dist[] ; //

Start node in first case

13 remove u from Q ;

14 if dist[u] = infinity:

15 break ; // all remaining vertices

are

16 // inaccessible from

source

1718 for each neighbor v of u: // where v has not yet

been removed from Q.

19 alt := dist[u] + dist_between(u, v) ;

85

Page 92: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

86 APPENDIX D. ALGORITHMS

20 if alt < dist[v]: // Relax (u,v,a)

21 dist[v] := alt ;

22 previous[v] := u ;

23 decrease -key v in Q; // Reorder v in the

Queue

24 return dist;

Page 93: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

Bibliography

[1] ITU. ITU Internet Reports 2005: The Internet of Things, 2005.

[2] M. Al-Hader, A. Rodzi, A. R. Sharif, and N. Ahmad. Smart city componentsarchiticture. In Computational Intelligence, Modelling and Simulation, 2009.CSSim ’09. International Conference on, pages 93–97, 2009.

[3] Gregory Yovanof and George Hazapis. An architectural framework and en-abling wireless technologies for digital cities & intelligent urban environments.Wireless Personal Communications, 49(3):445–463, 2009.

[4] Future Content Networks Group. Why do we need a content-centric internet?2009.

[5] M. Naphade, G. Banavar, C. Harrison, J. Paraszczak, and R. Morris. Smartercities and their innovation challenges. Computer, 44(6):32 –39, june 2011.

[6] Geng Wu, S. Talwar, K. Johnsson, N. Himayat, and K.D. Johnson. M2m: Frommobile to embedded internet. Communications Magazine, IEEE, 49(4):36 –43,april 2011.

[7] C. Harrison, B. Eckman, R. Hamilton, P. Hartswick, J. Kalagnanam,J. Paraszczak, and P. Williams. Foundations for smarter cities, 2010.

[8] G. Kortuem, F. Kawsar, D. Fitton, and V. Sundramoorthy. Smart objects asbuilding blocks for the internet of things. Internet Computing, IEEE, 14(1):44–51, jan.-feb. 2010.

[9] A. Attwood, M. Merabti, P. Fergus, and O. Abuelmaatti. Sccir: Smart citiescritical infrastructure response framework. In Developments in E-systems En-gineering (DeSE), 2011, pages 460–464, 2011.

[10] Leonidas Anthopoulos and Athena Vakali. Urban Planning and Smart Cities:Interrelations and Reciprocities, volume 7281 of The Future Internet, pages178–189. Springer Berlin / Heidelberg, 2012.

87

Page 94: MASTER'S THESIS1022180/FULLTEXT02.pdf · A Development Framework for Smart City Services Samuel Idowu samup4web@gmail.com Nadeem Bari nadmoh-0@student.ltu.se M.Sc Mobile Systems Department

88 BIBLIOGRAPHY

[11] F. Andreini, F. Crisciani, C. Cicconetti, and R. Mambrini. A scalable archi-tecture for geo-localized service access in smart cities. In Future Network andMobile Summit (FutureNetw), 2011, pages 1–8, 2011.

[12] IETF. RFC 4944 Transmission of IPv6 Packets over IEEE 802.15.4 Networks.2007.

[13] IETF. draft-ietf-core-coap-04 Constrained Application Protocol (CoAP). 2010.

[14] P.A. Wager and L.M. Hilty. A simulation system for waste management fromsystem dynamics modelling to decision support.

[15] Swiss Federal Laboratories for Materials Testing and Research (EMPA). Sim-ulation of traffic flows in a network. IESS.org, 6(6):174–179, June 1969.

[16] Danilo C Terante. A simulation on the municipal solid waste management withthe application of system focused technique in Sogod, Southern Leyte. The-sis/dissertations (phd), University of the Philippines, August 2005.

[17] IOANNIS NIKOLAOS V. KARADIMAS, GEORGIOS KOUZAS, editor. Ur-ban Solid Waste Collection And Routing: The Ant Colony Strategic Approach,number 4, (N.T.U.A.) Zographou Campus, 15780, Athens, Greece. NationalTechnical University of Athens, Multimedia Technology Laboratory School ofElectrical and Computer Engineering National Technical University of Athens.

[18] C. Harrison, B. Eckman, R. Hamilton, P. Hartswick, J. Kalagnanam,J. Paraszczak, and P. Williams. Foundations for smarter cities. IBM Jour-nal of Research and Development, 54(4):1 –16, july-aug. 2010.

[19] Wikipedia. Representational state transfer. 2012. [Online; accessed 13-September-2012].

[20] Wikipedia. Php. 2012. [Online; accessed 13-September-2012].

[21] Wikipedia. Java (programming language). 2012. [Online; accessed 13-September-2012].

[22] Wikipedia. Javascript. 2012. [Online; accessed 13-September-2012].

[23] Wikipedia. Android (operating system). 2012. [Online; accessed 12-September-2012].

[24] Wikipedia. Phonegap. 2012. [Online; accessed 12-September-2012].