Self-organising pervasive ecosystems of devices are set to become a major vehicle for delivering infrastructure and end-user services. The inherent complexity of such systems poses new challenges to those who want to dominate it by applying the principles of engineering.
The recent growth in number and distribution of devices with decent computational and communicational abilities, that suddenly accelerated with the massive diffusion of smartphones and tablets, is delivering a world with a much higher density of devices in space. Also, communication technologies seem to be focussing on short-range device-to-device (P2P) interactions, with technologies such as Bluetooth and Near-Field Communication gaining greater adoption.
Locality and situatedness become key to providing the best possible experience to users, and the classic model of a centralised, enormously powerful server gathering and processing data becomes less and less efficient with device density. Accomplishing complex global tasks without a centralised controller responsible of aggregating data, however, is a challenging task. In particular, there is a local-to-global issue that makes the application of engineering principles challenging at least: designing device-local programs that, through interaction, guarantee a certain global service level. In this thesis, we first analyse the state of the art in coordination systems, then motivate the work by describing the main issues of pre-existing tools and practices and identifying the improvements that would benefit the design of such complex software ecosystems.
The contribution can be divided in three main branches. First, we introduce a novel simulation toolchain for pervasive ecosystems, designed for allowing good expressiveness still retaining high performance. Second, we leverage existing coordination models and patterns in order to create new spatial structures. Third, we introduce a novel language, based on the existing ``Field Calculus'' and integrated with the aforementioned toolchain, designed to be usable for practical aggregate programming.
1. Engineering Complex Computational Ecosystems
Danilo Pianini
Supervisor: prof. Mirko Viroli
Tutor: prof. Antonio Natali
danilo.pianini@unibo.it
Alma Mater Studiorum—Universit`a di Bologna
Final Exam of the ET-IT Program XXVII Cycle
Dipartimento di Ingegneria dell’Energia Elettrica e dell’Informazione
“Guglielmo Marconi”
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 1 / 71
2. Outline Accepting the limitations of birthform betrays lack of imagination
1 Set the stage
Towards a pervasive world
Engineering a pervasive world
2 Alchemist: an integrated toolchain for complex ecosystems
Computational model
Engine, architecture, tools
3 Aggregate programming
Paradigm shift: programming space/time
Protelis: practical aggregate programming
4 Future technology applied today
5 Conclusion and future work
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 2 / 71
3. Set the stage
Outline
1 Set the stage
Towards a pervasive world
Engineering a pervasive world
2 Alchemist: an integrated toolchain for complex ecosystems
Computational model
Engine, architecture, tools
3 Aggregate programming
Paradigm shift: programming space/time
Protelis: practical aggregate programming
4 Future technology applied today
5 Conclusion and future work
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 3 / 71
4. Set the stage Towards a pervasive world
Pervasive Devices
Image courtesy of Alois Ferscha (Pervasive Computing Group, Johannes Kepler Universit¨at Linz)
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 4 / 71
5. Set the stage Towards a pervasive world
Progress look pretty normal when you look back...
Image from Tim Urban’s “Wait but why” blog (http://waitbutwhy.com/)
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 5 / 71
6. Set the stage Towards a pervasive world
...but fasten your belt anyway, please
Image from Tim Urban’s “Wait but why” blog (http://waitbutwhy.com/)
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 6 / 71
7. Set the stage Engineering a pervasive world
The hard part
Challenges
Interaction can be P2P, centralised, or likely mixed
Devices may or may not be mobile
Desired behaviour may change greatly in response to changes in the
local environment
Evolution of deployed systems is generally unpredictable
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 7 / 71
8. Set the stage Engineering a pervasive world
Issues for engineers
Lack of design patterns
The closest thing are nature inspired patterns, that make the aggregate of
devices expose some emergent behaviour in a robust, adaptive and
distributed fashion [ZV11]. Nature is cool, but not always optimal.
Languages
Few languages explicitly target the aggregate of devices rather than the
single one.
Verification
Unpredictability widen the spectrum of possible evolutions, which make
unit testing and model checking not feasible: simulation is often the only
way to go
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 8 / 71
9. Set the stage Engineering a pervasive world
Contribution of this PhD
A toolchain for software ecosystems [PMV13]
Meta-meta-model supporting very different approaches
Built-in, SSA inspired, novel simulation engine
Probabilistic and distributed model checking [PSV14]
A language for aggregate programming [PVB15]
Based on field calculus: formal and lightweight operational semantics
The same code runs in simulator and real world devices
Interoperability with Java (no need to reinvent the wheel)
Self-organisation patterns and possible today’s applications
Crowd steering [VPMS12, MVR+11, PVZF14, APNF13]
Resource discovery [SYD+13]
Anticipative adaptation [MPV12]
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 9 / 71
10. Alchemist: an integrated toolchain for complex ecosystems
Outline
1 Set the stage
Towards a pervasive world
Engineering a pervasive world
2 Alchemist: an integrated toolchain for complex ecosystems
Computational model
Engine, architecture, tools
3 Aggregate programming
Paradigm shift: programming space/time
Protelis: practical aggregate programming
4 Future technology applied today
5 Conclusion and future work
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 10 / 71
11. Alchemist: an integrated toolchain for complex ecosystems
What is it
Idea
A simulator was needed for the European project SAPERE [ZCF+11]
SAPERE adopts a chemical-like metaphor [ZOA+14]
Stochastic chemical simulators (SSA) are extremely efficient
[GB00, STP08]
Rather than relying on existing ABMs, very expressive but not as
scalable as we desired, let’s extend SSAs to be able to express what
we want [PMV11]
The simulator evolved beyond its original purposes to the point where it
stands now.
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 11 / 71
12. Alchemist: an integrated toolchain for complex ecosystems Computational model
Generalised chemistry
Pure chemistry vs. pervasive computing
Single, static compartment versus multiple, possibly mobile, and
interconnected nodes whose connection may depend on environmental
and technological factors
Molecules are described by concentration (an integer), devices may
carry any kind of data item
Reactions “scheduling” in nature follows a Poisson distribution whose
rate equation depends on reagents’ concentration [Gil77]. Events in a
pervasive computing scenario may be influenced by any of the
environment components and follow any probability distribution
(triggers, timers, and people walking are not Markovian)
Devices live in an environment
Yes, it is a nicely big leap
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 12 / 71
13. Alchemist: an integrated toolchain for complex ecosystems Computational model
Close the gap: environment
ReactionA proactive behaviour
Linking Rule
A function of the environment
that decides wether or not
two nodes are connected
Moleculetoken representing a
chunk of data
(think of it as a pointer)
ConcentrationActual data associated
with a "molecule"
Environment
Riemannian manifold
where nodes live
NodeA container of reactions
and molecules situated
in the environment
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 13 / 71
14. Alchemist: an integrated toolchain for complex ecosystems Computational model
Close the gap: reactions
Number of
neighbors<3
Node
contains
something
Any other
condition
about this
environment
Rate equation: how conditions
influence the execution speed
Conditions Probability distribution Actions
Any other
action
on this
environment
Move a node
towards...
Change
concentration
of something
Reaction
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 14 / 71
15. Alchemist: an integrated toolchain for complex ecosystems Computational model
((Meta) Meta) Models
Meta levels explained
The simulated instance of the system, or scenario, is the model
The specific concentration type (e.g. integer, tuple, or even Java
Object) along with specific actions and conditions that act upon such
data type represents the meta-model (in the Alchemist jargon,
“incarnation”).
The components of the Alchemist abstract computational model are
the meta-meta model, which is common to all incarnations (and, in
turn, to all scenarios).
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 15 / 71
16. Alchemist: an integrated toolchain for complex ecosystems Engine, architecture, tools
Architecture
Dynamic Dependency Graph
Dynamic Reaction Manager
Discrete Event Engine
Core
Environment
(model)
Reporting
Graphical Output
Logging System
Interactive UI
XML Bytecode
Environment Builder
Language
Chain
DSL to XML Compiler
Domain Specific Language
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 16 / 71
17. Alchemist: an integrated toolchain for complex ecosystems Engine, architecture, tools
Engine
Full fledged Discrete Event Simulator derived from Gibson/Bruck
SSA, extended with novel structures
Supports dependency graph among reactions (this really boosts
performance)
Supports execution “contexts”, pruning the dependency graph,
strongly boosting the boost
0
50
100
150
200
250
300
350
400
450
500
50 100 150 200 250 300 350 400 450 500
Executiontime[s]
Number of agents
Performance comparison with Repast
Repast AlchemistDanilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 17 / 71
18. Alchemist: an integrated toolchain for complex ecosystems Engine, architecture, tools
Handle with care
When is Alchemist worth it?
An incarnation exposing the desired level of abstraction is already
available: faster and closer to the model than a generic ABM
There is a long-term investment on Alchemist, and a new incarnation
is developed: performance pay back the investment
Incarnations available
Pure chemistry – Little more than an incubation test, deprecated
SAPERE – Mature incarnation, simulates a network of programmable
tuple spaces. Programs are chemical-like tuple re-writing rules
Protelis – Supports the execution of Protelis programs on networks
of simulated devices. Usable, but under heavy development.
Biochemistry – Sketched, will replace chemistry, exposing much
better support for biological oriented applications (back to the fold)
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 18 / 71
19. Aggregate programming
Outline
1 Set the stage
Towards a pervasive world
Engineering a pervasive world
2 Alchemist: an integrated toolchain for complex ecosystems
Computational model
Engine, architecture, tools
3 Aggregate programming
Paradigm shift: programming space/time
Protelis: practical aggregate programming
4 Future technology applied today
5 Conclusion and future work
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 19 / 71
20. Aggregate programming Paradigm shift: programming space/time
Classic approach
Local to global
Complex global behaviour
Simple local behaviour
The whole is more than the sum of the parts
Interaction is key
Nature inspiration
Several systems use nature as inspiration:
physical particles [MZ09]
chemical reactions [ZCF+11]
ants, termites and other social insects [TM03]
Very brief list! There are many more.
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 20 / 71
21. Aggregate programming Paradigm shift: programming space/time
Nice properties and hard challenges
The beauty
High resilience and fault tolerance
Self adaptation
Openness
Self healing
The beast
Local to global is hard to engineer
The desired functionality happens at the aggregate level
It is very difficult to design the local behaviour in such a way that the
interaction of many of them produces the desired global behaviour
Many attempts, but no good engineering processes to safely design
such systems
Often, development becomes a try-and-simulate loop
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 21 / 71
22. Aggregate programming Paradigm shift: programming space/time
Collective to local
Desiderata
We want to achieve a collective behaviour
We want to move our focus and abstractions towards the the whole
network, rather than focussing on the single devices that compose it
and their interaction
We want to support space-time abstractions
Possible solution
Create a language that allows to express collective properties
Create a runtime that can run such programs
Possibly, also create a tool to test programs prior to deployment
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 22 / 71
23. Aggregate programming Paradigm shift: programming space/time
Real languages
Aggregate programming languages
Several attempts to bring existing languages to the aggregate
perspective, we tried with Linda [VPB12]
MIT Proto [BB06] is the most known and successful
Developed at MIT and maintained at BBN Technologies
Functional language, LISP-like syntax (I know you hate it too)
All devices run the same program
Computation happens in rounds:
Every device sleeps for some time
Processes the messages received from the neighbours
Executes its program
Sends all the neighbours its result
Complex operational semantics
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 23 / 71
24. Aggregate programming Paradigm shift: programming space/time
Field Calculus
A “distillate” of Proto
Provides a lightweight operational semantics [VDB13]
((((LISP-like syntax))))
Still a functional language
Simple enough to formally prove properties, powerful enough to be
universal (proved!)
Theoretical object, no runtime nor simulation tool provided
Key mechanism: alignment
At the end of each cycle, send to your neighbours your annotated AST
At the beginning of each cycle, each device can inspect what was
happening in its surroundings
If two devices took different branches of a if, they are no longer
aligned until such branch returns
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 24 / 71
25. Aggregate programming Protelis: practical aggregate programming
Protelis
Functional language
Same operational semantics of the field calculus
Java-like syntax with infix operators
Java interoperability: static methods imports and calls, method
invocation with dynamic binding
Higher order functions (functions as arguments, closures,
lambdas)
Dynamic code
Eclipse plugin
Integrated with Alchemist
Stand-alone framework for real devices
Write once, run everywhere — evolved :)
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 25 / 71
26. Aggregate programming Protelis: practical aggregate programming
Alignment with HOF
How to deal with alignment?
Without HOF, all the devices are forced to run the same code: the
only branching point is if.
With HOF, and in particular with support for dynamic code, instead:
1 The same function can be defined in multiple points
2 Different functions may have the same name (dynamic injection)
3 The same function can be invoked in multiple points
4 The same code path may invoke a different function
Alignment
Alignment had been improved to consider HOF support. Two functions
align only if:
They have the same name and body
They were defined in the exact same point in code
They are invoked in the exact same point in code
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 26 / 71
29. Future technology applied today
Outline
1 Set the stage
Towards a pervasive world
Engineering a pervasive world
2 Alchemist: an integrated toolchain for complex ecosystems
Computational model
Engine, architecture, tools
3 Aggregate programming
Paradigm shift: programming space/time
Protelis: practical aggregate programming
4 Future technology applied today
5 Conclusion and future work
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 29 / 71
30. Future technology applied today
Applications for densely populated environments
Crowd steering and evacuation
Provide guidance to prevent dangerous situations, e.g.:
In case of emergency, dynamically balance the crowds to minimize the
evacuation time
Avoid crowded paths when providing directions
Prevent dangerous crowd formation
Alert users joining a dangerous cluster
Other services
Local communication
Context sensitive applications
Local services and advertisement
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 30 / 71
31. Future technology applied today
Crowd-sensitive user steering
Steering against GPS traces taken at Vienna City Marathon 2013
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 31 / 71
32. Future technology applied today
Context sensitive user steering
Generalisation of the former, ran in London
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 32 / 71
39. Conclusion and future work
Outline
1 Set the stage
Towards a pervasive world
Engineering a pervasive world
2 Alchemist: an integrated toolchain for complex ecosystems
Computational model
Engine, architecture, tools
3 Aggregate programming
Paradigm shift: programming space/time
Protelis: practical aggregate programming
4 Future technology applied today
5 Conclusion and future work
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 39 / 71
40. Conclusion and future work Results
Results
A toolchain for software ecosystems
Novel, chemical inspired architecture, developed from scratch
Flexible still retaining high performace
A language for aggregate programming [PVB15]
Based on Field Calculus, lightweight semantics
Support for higher order functions, closures, code injection
Integrated development: write your program, run both in Alchemist
and real devices
Self-organisation patterns and possible today’s applications
Novel self-organisation patterns
Application of existing and novel patterns to crowd steering, WSN
and other high- density scenarios
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 40 / 71
41. Conclusion and future work Future works
Future development
A toolchain for software ecosystems
Stabilise development, strenghten existing features
Include interactivity
Rethink the distributed approximate model checker
Complete biochemistry incarnation
A language for aggregate programming
Are we about to create distributed processes?
Protelis could be a nice language for distributed service scheduling
Enable better modularity
Strong type checking
Self-organisation patterns and possible today’s applications
Create a rich library of reusable building blocks for self-* application
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 41 / 71
42. References
References I
Bernhard Anzengruber, Danilo Pianini, Jussi Nieminen, and Alois Ferscha.
Predicting social density in mass events to prevent crowd disasters.
Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial
Intelligence and Lecture Notes in Bioinformatics), 8238 LNCS:206–215, 2013.
cited By 1; Conference of 5th International Conference on Social Informatics, SocInfo 2013
; Conference Date: 25 November 2013 Through 27 November 2013; Conference
Code:101766.
Jacob Beal and Jonathan Bachrach.
Infrastructure for engineered emergence on sensor/actuator networks.
IEEE Intelligent Systems, 21(2):10–19, 2006.
Michael A. Gibson and Jehoshua Bruck.
Efficient exact stochastic simulation of chemical systems with many species and many
channels.
J. Phys. Chem. A, 104:1876–1889, 2000.
Daniel T. Gillespie.
Exact stochastic simulation of coupled crfreactions.
The Journal of Physical Chemistry, 81(25):2340–2361, December 1977.
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 42 / 71
43. References
References II
Sara Montagna, Danilo Pianini, and Mirko Viroli.
Gradient-based self-organisation patterns of anticipative adaptation.
In Proceedings of 6th IEEE International Conference on Self-Adaptive and Self-Organizing
Systems (SASO 2012), pages 169–174, September 2012.
Sara Montagna, Mirko Viroli, Matteo Risoldi, Danilo Pianini, and Giovanna
Di Marzo Serugendo.
Self-organising pervasive ecosystems: A crowd evacuation example.
Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial
Intelligence and Lecture Notes in Bioinformatics), 6968 LNCS:115–129, 2011.
cited By 4; Conference of 3rd International Workshop on Software Engineering for Resilient
Systems, SERENE 2011 ; Conference Date: 29 September 2011 Through 30 September
2011; Conference Code:86796.
Marco Mamei and Franco Zambonelli.
Programming pervasive and mobile computing applications: The tota approach.
ACM Trans. Softw. Eng. Methodol., 18(4):1–56, 2009.
Danilo Pianini, Sara Montagna, and Mirko Viroli.
A chemical inspired simulation framework for pervasive services ecosystems.
In Proceedings of the Federated Conference on Computer Science and Information
Systems, pages 667–674. IEEE Computer Society Press, 2011.
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 43 / 71
44. References
References III
Danilo Pianini, Sara Montagna, and Mirko Viroli.
Chemical-oriented simulation of computational systems with Alchemist.
Journal of Simulation, 2013.
Danilo Pianini, Stefano Sebastio, and Andrea Vandin.
Distributed statistical analysis of complex systems modeled through a chemical metaphor.
pages 416–423. Institute of Electrical and Electronics Engineers Inc., 2014.
cited By 0; Conference of 2014 International Conference on High Performance Computing
and Simulation, HPCS 2014 ; Conference Date: 21 July 2014 Through 25 July 2014;
Conference Code:107210.
Danilo Pianini, Mirko Viroli, and Jacob Beal.
Protelis: practical aggregate programming.
In SAC, Salamanca, Spain, 2015. Accepted, to appear this year.
Danilo Pianini, Mirko Viroli, Franco Zambonelli, and Alois Ferscha.
Hpc from a self-organisation perspective: The case of crowd steering at the urban scale.
pages 460–467. Institute of Electrical and Electronics Engineers Inc., 2014.
cited By 0; Conference of 2014 International Conference on High Performance Computing
and Simulation, HPCS 2014 ; Conference Date: 21 July 2014 Through 25 July 2014;
Conference Code:107210.
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 44 / 71
45. References
References IV
Alexander Slepoy, Aidan P. Thompson, and Steven J. Plimpton.
A constant-time kinetic monte carlo algorithm for simulation of large biochemical reaction
networks.
The Journal of Chemical Physics, 128(20):205101, 2008.
Graeme Stevenson, Juan Ye, Simon Dobson, Danilo Pianini, Sara Montagna, and Mirko
Viroli.
Combining self-organisation, context-awareness and semantic reasoning: The case of
resource discovery in opportunistic networks.
pages 1369–1376, Coimbra, 2013.
cited By 1; Conference of 28th Annual ACM Symposium on Applied Computing, SAC
2013 ; Conference Date: 18 March 2013 Through 22 March 2013; Conference Code:96995.
Robert Tolksdorf and Ronaldo Menezes.
Using swarm intelligence in linda systems.
In Andrea Omicini, Paolo Petta, and Jeremy Pitt, editors, ESAW, volume 3071 of Lecture
Notes in Computer Science, pages 49–65. Springer, 2003.
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 45 / 71
46. References
References V
Mirko Viroli, Ferruccio Damiani, and Jacob Beal.
A calculus of computational fields.
In Carlos Canal and Massimo Villari, editors, Advances in Service-Oriented and Cloud
Computing, volume 393 of Communications in Computer and Information Science, pages
114–128. Springer Berlin Heidelberg, 2013.
Mirko Viroli, Danilo Pianini, and Jacob Beal.
Linda in space-time: an adaptive coordination model for mobile ad-hoc environments.
In Marjan Sirjani, editor, Coordination Languages and Models, volume 7274 of LNCS,
pages 212–229. Springer-Verlag, June 2012.
Proceedings of the 14th Conference of Coordination Models and Languages (Coordination
2012), Stockholm (Sweden), 14-15 June.
Mirko Viroli, Danilo Pianini, Sara Montagna, and Graeme Stevenson.
Pervasive ecosystems: a coordination model based on semantic chemistry.
In Sascha Ossowski, Paola Lecca, Chih-Cheng Hung, and Jiman Hong, editors, 27th
Annual ACM Symposium on Applied Computing (SAC 2012), Riva del Garda, TN, Italy,
26–30 March 2012. ACM.
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 46 / 71
47. References
References VI
Franco Zambonelli, Gabriella Castelli, Laura Ferrari, Marco Mamei, Alberto Rosi, Giovanna
Di Marzo, Matteo Risoldi, Akla-Esso Tchao, Simon Dobson, Graeme Stevenson, Yuan Ye,
Elena Nardini, Andrea Omicini, Sara Montagna, Mirko Viroli, Alois Ferscha, Sascha
Maschek, and Bernhard Wally.
Self-aware pervasive service ecosystems.
Procedia Computer Science, 7:197–199, December 2011.
Proceedings of the 2nd European Future Technologies Conference and Exhibition 2011
(FET 11).
Franco Zambonelli, Andrea Omicini, Bernhard Anzengruber, Gabriella Castelli,
Francesco L. DeAngelis, Giovanna Di Marzo Serugendo, Simon Dobson, Jose Luis
Fernandez-Marquez, Alois Ferscha, Marco Mamei, Stefano Mariani, Ambra Molesini, Sara
Montagna, Jussi Nieminen, Danilo Pianini, Matteo Risoldi, Alberto Rosi, Graeme
Stevenson, Mirko Viroli, and Juan Ye.
Developing pervasive multi-agent systems with nature-inspired coordination.
Pervasive and Mobile Computing, 2014.
Special Issue on “10 years of Pervasive Computing” in honor of Chatschik Bisdikian.
Franco Zambonelli and Mirko Viroli.
A survey on nature-inspired metaphors for pervasive service ecosystems.
International Journal of Pervasive Computing and Communications, 7(3):186–204, 2011.
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 47 / 71
48. References
Engineering Complex Computational Ecosystems
Danilo Pianini
Supervisor: prof. Mirko Viroli
Tutor: prof. Antonio Natali
danilo.pianini@unibo.it
Alma Mater Studiorum—Universit`a di Bologna
Final Exam of the ET-IT Program XXVII Cycle
Dipartimento di Ingegneria dell’Energia Elettrica e dell’Informazione
“Guglielmo Marconi”
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 48 / 71
49. Alchemist: director’s cut
Model to model
Generic procedure
1 Map your meta model onto Alchemist’s meta-meta model entities
2 Optionally, write a Domain Specific Language (DSL) which generates
an Alchemist-XML compatible file from your domain-specific entities
3 Write whichever model you want to test and simulate
4 Simulate it using Alchemist
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 49 / 71
50. Alchemist: director’s cut
2.0
4 4
3.7
1
7.3
2 1
5.5
1 0
2
8.9
1 0
4.2
0 0
9.1
0 0
10.1
0 0
inf
0 0
A+B→C
B+C→D E+G→A
D+E→E+F F→D+G
Next Reaction efficient structures made dynamic
Dynamic Indexed Priority Queue
Allow to access the next reaction to execute in O(1) time
Worst case update in log2 (N) (average case a lot better)
Extended to ensure balancing with insertion and removal
Dynamic Dependency Graph
Allows to smartly update only a subset of all the reaction
Extended with the concept of input and output context
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 50 / 71
51. Alchemist: director’s cut
Real world maps and GPS traces
Figure: A snapshot of the whole city of Vienna as simulated in Alchemist. This
snapshot is taken while simulating the city at 10am during the annual marathon,
each black point corresponds to a GPS trace.
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 51 / 71
52. Alchemist: director’s cut
Approximate Stochastic Model Checker
Problem
Model checking is not feasible with such complexity, but Monte Carlo
sampling is
How many simulations should you run to in order to get the mean
value of some property, along with its confidence and approximation?
Alchemist + MultiVeStA
Alchemist has been chained with MultiVeStA
A properties can be written in MultiQuaTeX
MultiVeStA runs the number of experiments required using the
chained Alchemist engine
Big plus: MultiVeStA supports distributed execution
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 52 / 71
54. Aggregate programming: director’s cut
We want to do more
Dynamic and mobile code with higher order functions
Functions can be arguments and can be returned
Closures
Anonymous functions
Dynamic code
Sugar and utilities
Java interoperability
C family like syntax
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 54 / 71
57. Aggregate programming: director’s cut
Simpler semantics
Proto Field calculus
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 57 / 71
58. Aggregate programming: director’s cut
Key mechanism: Alignment
Abstract syntax trees in Field Calculus
Representation of the abstract syntactic structure of a program
The computation modifies every node of the tree, associating the
corresponding value to it
At the end of the round, it is sent to every neighbour
During the round, each device can read the data every other node
had at the same point in the code, and use it
If some neighbour has not any data associated with the code path, it
means that it has chosen a different branch
Such node would be not aligned, and not considered for subsequent
computation
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 58 / 71
59. Aggregate programming: director’s cut
Example
1 (if (> x 0) (x + 1) (x - 1))
if
>
x 0
+ -
x x1 1
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 59 / 71
61. Aggregate programming: director’s cut
Conclusion
Aggregate programming
Focus on the whole network
Think in space and time
Much less focus on communication protocols
Paradigm shift: requires training!
Protelis
Solid foundations (field calculus)
Support for higher order functions
Interoperability with Java
Friendly syntax
Simulation framework
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 61 / 71
62. Aggregate programming: director’s cut
Future work
Language side
Sugar, sugar, sugar
Namespacing (done by now, if no disasters happened just before this
dissertation)
Libraries
Tools side
Distributed middleware
Better simulator UI
Better batch executor and logging service
Tons of documentation
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 62 / 71
63. Self-org patterns: director’s cut
Why crowds
We are preparing for a world that does not exist yet.
Why we often focus on crowds
Smallest and most diffused devices in today’s world are normally
accessories or wearables
The higher density of people, the higher density of devices
Challenging issues to tackle, including low reliability of Internet
connection
Crowds of people are real world scenarios available today that closely
resemble our future pervasive world.
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 63 / 71
66. Self-org patterns: director’s cut
Big crowds and cloud don’t play well
Internet
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 66 / 71
67. Self-org patterns: director’s cut
Big crowds and cloud don’t play well
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 67 / 71
68. Self-org patterns: director’s cut
Big crowds and dangers
Photo: Sam Panthanky/AFP/Getty Images
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 68 / 71
69. Self-org patterns: director’s cut
Big crowds and dangers
Crowd disasters
July 24, 2010 – Germany, Duisburg – 21 deaths
January 1, 2013 – Ivory Coast, Abidjan – 60 deaths
February 20, 2003 – USA, Rhode Island – 100 deaths
October 13, 2013 – India, Madhya Pradesh, Datia – 115 deaths
May 9, 2001 – Ghana, Accra – 126 deaths
January 23, 2013 – Brazil, Santa Maria – 242 deaths
January 12, 2006 – Saudi Arabia, Mecca – 345 deaths
November 22, 2010 – Cambodia, Phnom Penh – 347 deaths
August 31, 2005 – Iraq, Baghdad – 1000 deaths
This is a small list of stampedes, there are thousands more.
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 69 / 71
71. Self-org patterns: director’s cut
Crowd sensitive steering benefits: data
0
20
40
60
80
100
0 0.2 0.4 0.6 0.8 1
Numberofpeoplewithin100meters
Normalised vicinity to target
Benefit of crowd-sensitiveness
Classic steering
Crowd sensitive steering
Number of users surrounding the user (within 100 meters from her). With “normalised distance”, we mean that we divided the distance the user still has
to walk to reach the target by the total length of the suggested path.
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 71 / 71