Real-time Human-in-the-loop Simulation with Mobile
Agents, Chat Bots, and Crowd Sensing for Smart
Cities
Stefan Bosse
1
, Uwe Engel
2
1
University of Koblenz-Landau, Fac. Computer Science, Koblenz
2
University of Bremen, Dept. of Social
Science, Bremen
Abstract: Modelling and simulation of social interaction and networks is of high interest in multiple
disciplines and elds of application ranging from fundamental social science to smart city management.
Future smart city infrastructures and management is characterised by adaptive and self-organising con-
trol using real-world sensor data. In this work, humans are considered as sensors. Virtual worlds, i.e.,
simulations and games, are commonly closed and rely on articial social behaviour and synthetic sensor
information generated by the simulator program or using data collected off-line by surveys. In contrast,
real worlds pose higher diversity. Agent-based modelling relies on parameterised models. The selection
of suitable parameter sets is crucial to match real world behaviour. In this work, a framework combining
agent-based simulation with crowd sensing and social data mining using mobile agents is introduced.
The crowd sensing via chat bots creates augmented virtuality and reality by extending simulation worlds
with real world interaction and vice-versa. The simulation world interacts with real world environments,
humans, machines, and other virtual worlds in real-time. Among the mining of physical sensors (e.g.,
temperature, motion, position, light) of mobile devices like smart phones, mobile agents can perform
crowd sensing by participating in question–answer dialogues via a chat blog (provided by smart phone
Apps or integrated in WEB pages and social media). Additionally, mobile agents can act as virtual sen-
sors (offering data exchanged with other agents) and creating a bridge between virtual and real worlds.
The ubiquitous usage of digital social media has relevant impact of social interaction, mobility, and
opinion making, which has to be considered, too. Three different use-cases demonstrate the suitability of
augmented agent-based simulation for social network analysis using parameterised behavioural models
and mobile agent-based crowd sensing. This paper gives a rigorous overview and introduction of chal-
lenges and methodologies to study and control large-scale and complex socio-technical systems using
agent-based methods.
Keywords: Simulation; Agent-based Modelling; Mobile Agents; Crowd Sensing; Smart Trafc Control.
Social Interaction
_______________________________________________________________________________________
1. Introduction
The key concept of this work is the consideration of humans as sensors and the fusion of real and virtu-
al worlds, in particular virtual worlds in social simulation providing a closed-loop simulation. The out-
come of simulations performed in real-time can be feedback to real worlds, e.g., to control crowd
behaviour and ows, thus considering humans ac actors, too. This human-in-the-loop simulation metho-
dology enables a better understanding of crowd behaviour in real worlds and the opportunity to
inuence real worlds by simulation. This concept is highly interdisciplinary and is a merit of social and
computer science if the human sensor data will be coupled with social interaction and networking
models. Social interaction has a high impact on the control of complex environmental and technical sys-
doi: 10.3390/s19204356 Sensors (MDPI)
Stefan Bosse et al. - 1 - 2019
tems, which should be addressed in this work.
The novelty of this work is the seamless fusion of real and virtual worlds by using mobile agents and an
unied agent platform that can be be deployed in strong heterogeneous digital network environments
and in simulation. The real world is sensed by mobile crowd sensing techniques (MCWS) providing in-
put for an agent-based simulator representing the virtual world. Mobile agents are used to bridge both
worlds and to provide loosely coupling required in heterogeneous and mobile environments with ad-hoc
connectivity and operation on a wide range of host platforms with varying software versions.
The approach of an augmented agent-based social simulation is powerful to study large-scale social and
socio-technical interactions. The strength of the framework lies in the potential inclusion of environmen-
tal and real-life interactions and providing feedback to real world environments and humans. The used
agent platform as the core component of both the MCWS and the simulator enables ubiquitous partici-
pation and interaction.
Different use-cases show the strength of the extended simulation framework using self-organising
parameterised behaviour and interaction models with parameter sets derived by crowd sensing. The
crowd sensing is performed by mobile agents that are used to create individual parameterised digital
twins in the simulation from surveys performed by real humans (with respect to the social interaction
model and mobility).
The following introduction gives an overview of agent-based modelling, simulation, and crowd sensing
in the context of social and computer science, and enlightens the key concepts of agent-based human-
in-the-loop simulation.
After the introduction, the role of intelligent systems and the relation to system control is discussed in
Sec. 2, and modelling of socio-technical systems is discussed in Sec. 3.
In Sec. 4 and 5, the proposed simulation architecture and the workow are described. Sec. 6 describes
the agent-based real-world sensing using crowd sensing techniques.
In Sec. 7, a parameterised social interaction model is discussed, and Sec. 8 introduces a crowd mobility
and trafc model.
Finally, in Sec. 9 three use-cases demonstrate the suitability and utilisation of the augmented simulation
approach in different elds of application.
1.1 Preliminary notes on the involved Computational Social Science (CSS) perspective
Even though the present article describes essentially the computer-science basis for a new digital-twin
modelling and simulation approach, the work is aimed at a contribution to the broader framework of
computational social science (CSS). This designation is certainly at risk of being misunderstood as a
branch of social science only. Quite the contrary CSS is an emerging interdisciplinary eld of research
of growing importance at the intersection of computer science, statistics, and social science. On the one
hand, CSS includes a well-known strong formal modelling/simulation branch on articial societies [1].
On the other hand, it includes the trend towards a dynamically increasing eld of automated collection
of digital-trace and text data on the Internet that goes hand in hand with an equally important rise of
widespread applications of machine learning techniques in society [2]. Though both CSS branches offer
undoubtedly valuable scientic insights on their own right, the link between the modelling/simulation
branch, on the one hand, and the social-research and social-media research branch [3] respectively, on
the other hand, remains currently still a quite challenging task.
1.2 Why Agent-based Models?
This work focuses on agent-based modelling (ABM) of social interaction as well as socio-technical sys-
tems. The main advantage of ABM over analytical or machine learning methods is self-organisation us-
ing simple behaviour and interaction models. Typical analytical methods that can be combined with
doi: 10.3390/s19204356 Sensors (MDPI)
Stefan Bosse et al. - 2 - 2019
agent-based modelling are pattern recognition and cluster graph analysis [4], but requiring functional
social models on a global interaction scope not always available. And common social models
oversimplify the real world, a disadvantage that can be avoided by agent-based simulation using only
neighbouring interaction. Agent-based models are especially relevant to simulating social phenomena
that are inherently complex and dynamic [5]. Dealing with complexity is a challenge in social
modelling, and decomposition of complex systems in many simple interacting systems (divide-and-
conquer approach) is well established and reected by agents. The simplest agent model consists of
condition-action rules only, but powerful enough to model trafc and crowd ows.
1.3 Why not Analytical Models?
ABM is in principle the counterpart to analytical modelling and analysis. ABM addreses local interac-
tion between agents posing emergence (the global behaviour), whereas analytical models often cover the
mapping of individual behaviour on global behaviour directly (the hard-to-predict aggregate outcome)
[6]. Analytical models are well established in social science and address both empirical and formal
methods that poses their strength with respect to some of the fundamental analysis challenges in social
science [7]. The main issue of analytical modelling, e.g., spatial analysis, is their limitation to cover a
broad diversity in social models, i.e., addressing minor variances that occur in real world systems [8].
This work demonstrates the introduction of variance of real humans by crowd sensing integrated in
agent-based simulation. It could be shown that small local disturbances have signicant effect on global
structures and interaction that is not covered by current analytical models. But ABM can rely on analyti-
cal micro-scale models, shown, e.g., by the Sakoda segregation model and the social expectation func-
tion (see Sec. 7).
1.4 Explaining simulation-based aggregate effects
This concerns for instance the ways and possible improvements of empirically testing assumptions and
predictions of such simulation models by experiments and survey research, as detailed e.g. in [9] and
[10]. As outlined there, the validation of empirically grounded agent-based models has certainly to con-
sider the targeted degree of realism and the related importance attached particularly to mechanism-based
explanations. This means notably the validation of the mechanisms assumed to produce the expected ag-
gregate effects in the micro-to-macro transition; - and in doing so, the rejection of the popular as-if atti-
tude in model-based explanations [6]. An adoption of this approach implies essentially the view that
validation should not be restricted to empirical tests of the observable model implications alone, simply
because different models can imply the same such implications; validation should also extend to the very
model assumptions from which the observable implications were deduced.
1.5 Why humans in the loop?
Such assumptions are essentially assumptions about the behaviour of individual agents and why they act
as they act. From a sociological point of view, this brings the humans in the loop and the factors under-
lying their behaviour (e.g., their preferences, expectations, values, attitudes, personality traits, habits,
resources). It also introduces the social relations, agents maintain in dyads, networks, and larger groups.
This in fact for an understanding of the - intended and unintended, even paradox - emergent effects
which result from the behaviour of individual agents and their interactions in society. This, moreover, for
intervention and steerage purposes too. Cases in point of relevant effects certainly include shapes of
structural differentiation (segregation vs. intersection)and opinion formation, currently with a strong
scientic attention to opinion polarisation (e.g. [11]; [12]) and extremism due to propaganda in digital
social networks [13].
Among considering humans as sensors feeding the simulation at run-time, the loop considers humans as
actors, too. I.e., the loop provides output data for crowd and ow control, human decision making via
doi: 10.3390/s19204356 Sensors (MDPI)
Stefan Bosse et al. - 3 - 2019
social media, or at least inuencing real world with data from simulation.
1.6 Why simulations in real-time?
Social simulation using mathematical, statistical, and agent-based models is well established to investi-
gate and predict social and socio-technical interaction. Often there is a gap between simplied modelling
and real world observations. The factors underlying human behaviour can change over time. Some tend
to volatility, some to persistence instead, in any case these factors represent genuine sources of variation.
Given that a relevant factor tends to changes in shorter rather than longer periods of time, and given that
such a factor has a share in producing an aggregate effect, models which are capable of both sensing
such changes and simulating the resulting effects in real time, appear most suitable for the testing of
relevant assumptions of simulation models and the possibly wanted derivation of policy recommenda-
tions. Most notably,especially simulations which are capable of dynamically adapting to changing
preconditions at the agent level afford the opportunity to develop realistic scenarios in use-elds where
the level of behavioural change per unit time is rather high than low.
Crowd simulation can be utilised to feedback data from simulation to real world to control crowd ows,
e.g., in cities or domestic services. But this feedback requires the real-time and time-lapse capability of
the simulation, discussed in Sec. 4. The de-facto standard in traditional social simulation is the Netlogo
simulator [14]. Integrating Data Mining in agent-based modelling and simulation was rstly introduced
in [15], but the Data Mining uses real world data collected prior to simulation (delayed coupling of real
and virtual worlds).
1.7 Why sensing?
A real-time human-in-the-loop simulation needs continuously updated empirical information on relevant
model parameter. The sensing and collecting respectively of continuous measurements represents accord-
ingly a rst hub, the integration of related subjective and objective measurements a second one. It then
simply depends on the angle of view which type of measurement is regarded the primary source and
which one the possible enrichment. In the same way as one can enrich survey data with objective sensor
measurements [16], one can enrich sensed physical data with information usually obtained through sur-
vey research. One can even discard the weighting inherent to highlighting one source as primary, and
just talk of empirical (objective, subjective) information obtained by sensing. In this spirit a key concept
of this work is the consideration of humans as sensors and mobile devices such as smartphones are the
instruments for sensing the required empirical information. Data fusion approaches can further enhance
analytical as well simulative methods [4].
1.8 Why crowd sensing?
In order to investigate complex and dynamical societies, appropriate data is required. Unfortunately, ac-
quiring such data is a challenge. The traditional methods of analysis in sociology gather qualitative data
from interviews, observation or from documents and records, and carry out surveys of samples of people
[5].
The crowd comes in for three related reasons. First, the nearly ubiquitous use of mobile devices makes
it simply possible to sense the required information at a large scale, at least in principle. Secondly, a
crowd is necessary: without the information obtained from the set of persons that constitutes a crowd, no
simulation would be possible at all. Thirdly, the focus on crowds goes along with two ongoing paradigm
shifts in social research. The rst concerns the changing survey landscape (trend towards the use of
non-probability samples) and the second one concerns the tendency from survey research towards social
media research. Fourthly, just recently social research encountered the suggestion towards the creation of
mass collaboration for data collecting purposes [17], - a trend in line with similar suggestions towards
citizen sciences.
doi: 10.3390/s19204356 Sensors (MDPI)
Stefan Bosse et al. - 4 - 2019
The analysis of crowd sensing data and crowd behaviour can be performed with different methods: 1.
Analytical Methods [4]; 2. Machine Learning (ML); 3. Simulation. Simulation and ML can be seen as
counterparts to analytical methods or can be used in conjunction.
One major drawback of classical surveys is that they come from measurements made at a one moment
in time [5]. Crowd sensing combined with real-time simulation can extend the data time scale
signicantly.
1.9 The role of Incentive Mechanisms
Crowd sensing can be participatory or opportunistic. Furthermore, crowd sensing can be classied in
platform- or sourcer-centric and user-centric architectures [18]. In all cases incentive mechanisms have a
high impact on crowd user selection and participation, directly affecting the quality of sensed data [19].
Although the usage of mobile phones introduce new opportunities in social data sensing, adapted incen-
tive mechanisms are required. Distributed and self-organising crowd sensing requires commonly the ins-
tallation of software, a high barrier for most users, with impact on participation and data bias (young
users vs. older users). Mobile chat-bot agents, e.g., embedded as (JavaScript) code in a WEB page (but
executed on the user device) as considered in this work can overcome this limitation.
Among participation, the quality of the sensed data contributed by individual users varies signicantly
by crowd sensing [19]. Sensor fusion and localised pre-processing (ltering) is required. Correlating the
quality of information provided by user to the incentive rewarded and as part of the auction model can
improve overall data quality of mobile crowd sensing signicantly.
1.10 Smart city management
Today administration and management of public services and infrastructure relies more and more on
user and ubiquitous data collected by many domestic and private devices including smart phones and
Internet services. People use social digital media extensively and provide private data, enabling proling
and tracing. User data and user decision making has a large impact on public decision making processes,
for example, plan-based trafc ow control. Furthermore, intelligent behaviour, i.e., cognitive,
knowledge-based, adaptive, and self-organising behaviour based on learning, emerges rapidly in today’s
machines and environments. Social science itself exerts inuence on public opinion and decision forma-
tion.
Smart city infrastructures and management is characterised by adaptive and self-organising control algo-
rithms using real-world sensor data. In [20], crowds are considered as collective intelligence that can be
employed in smart cities, although such self-organising and self-adapting intelligence driven by a broad
range of individual goals is inaccurate and can compromise society goals.
Trafc is a classic example for group decision making with (social) neighbouring interaction, but com-
monly trafc control relies on physical sensor processing only [21]. In [21], adaptive and partly self-
organising trafc management was achieved by using a agents with multi levels of decision making and
an hierarchical organisational structure. Car trafc control in smart cities can be achieved by global
trafc sign synchronisation. But pedestrian, bicycle, and domestic trafc usage cannot controlled this
way. A future vision to control domestic trafc ows is the deployment of digital and social media with
chat bots to inuence people decision making regarding goal driven mobility, sketched with the methods
introduced in this paper.
Trafc control can be performed by perception and analysis of vehicle and/or crowd ows. Furthermore,
vehicle-ows can be classied, e.g., introducing weights for individual and public vehicles.
Surveys play another important role for modelling and understanding of interaction patterns. Articial
Intelligence (AI) and chat bots shift classical survey methods towards computational methods introduc-
ing possible implications, i.e., usage of different data, different methods, exposition to different threats to
data quality (concerning sampling, selection effects, measurement effects, data analysis), and different
doi: 10.3390/s19204356 Sensors (MDPI)
Stefan Bosse et al. - 5 - 2019
rules of inference are likely to result in comparably different conclusions, public reports, and hence in
different input to public opinion formation. Among eld studies, simulations can contribute to the
investigation and understanding of such interactions.
1.11 The underlying Computer-Science Perspective: A new augmented simulation paradigm
In real worlds, hardware and software robots can be considered close together in a generalised way by
an association to the agent model. One prominent example for a software robot is a chat or social bot.
Additionally, real and articial humans can be represented by the agent model, too. Multi-agent systems
enable modelling of agent interaction and emergence behaviour. Agent-based modelling and simulation
is a suitable methodology to study interaction and mobility behaviour of large groups of relevant human
actors, hardware, and software robots, using methods with inherent elements of AI (e.g. learning algo-
rithms) or which use data which may be inuenced partly by bots.
Agent-based methods are established for modelling and studying of complex dynamic systems and for
implementing distributed intelligent systems, e.g., in trafc and transportation control (see [22] and
[21]). Therefore, agent-based methods can be described by the following taxonomy [15]:
1. Agent-based Modelling (ABM) - Modelling of complex dynamic systems by using the agent
behaviour and interaction model Physical agents
2. Agent-based Computing (ABC) - Distributed and parallel computing using mobile agents related to
mobile software processes Computational agents
3. Agent-based Simulation (ABS) - Simulation of agents or using agents for simulation
4. Agent-based Modelling and Simulation (ABMS)
5. Agent-based Computation, Modelling, and Simulation (ABX) - Combining physical and computa-
tional agents
doi: 10.3390/s19204356 Sensors (MDPI)
Stefan Bosse et al. - 6 - 2019