SlideShare uma empresa Scribd logo
1 de 71
Baixar para ler offline
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Aggregate programming Protelis: practical aggregate programming
LISP-like to Java-like syntax
1 (def distance -to (source)
2 (rep d infinity (mux source 0 (min-hood (+ (nbr d) (nbr-range))))))
3 distance -to(event)
1 def distanceTo(source) {
2 rep (d <- Infinity) {
3 mux (source) {
4 0
5 } else {
6 minHood(nbr(d) + nbrRange)
7 }
8 }
9 distanceTo(event)
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 27 / 71
Aggregate programming Protelis: practical aggregate programming
Example with HOF
1 def gBB(source, initial , metric, accumulate) {
2 rep(distanceValue <- [Infinity , initial]) {
3 mux(source) {
4 [0, initial]
5 } else {
6 let ndv = nbr(distanceValue);
7 minHood([ndv.get(0) + metric.apply(), accumulate.apply(ndv.get(1))])
8 }
9 }.get(1)
0 }
1
2 def distanceCompetition(d, lead, uid, grain, metric) {
3 mux(d > grain * 1.5) { uid } else {
4 let gsize = grain * 0.5;
5 mux (d >= gsize) { Infinity } else {
6 minHood(mux(nbr(d) + metric.apply() >= gsize) { Infinity } else { nbr(lead) })
7 }
8 }
9 }
0
1 def breakUsingUIDs(uid, grain, metric) {
2 uid == rep(lead <- uid) {
3 distanceCompetition(
4 gBB(uid == lead, 0, metric, (v) -> {v + metric.apply()}), lead, uid, grain, metric)
5 }
6 }
7
8 breakUsingUIDs(grain, metric)
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 28 / 71
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
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
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
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
Future technology applied today
Mobile code
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 33 / 71
Future technology applied today
Upgradable mobile code
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 34 / 71
Future technology applied today
Upgradable mobile code
Crowd steering
service version 2
Crowd steering
service version 1
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 35 / 71
Future technology applied today
Upgradable mobile code
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 36 / 71
Future technology applied today
Overlapping services
Exhibition
tickets
Food
service
Public water
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 37 / 71
Future technology applied today
Overlapping services
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 38 / 71
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Aggregate programming: director’s cut
Example
1 (def distance -to (source)
2 (rep d infinity (mux source 0 (min-hood (+ (nbr d) (nbr-range))))))
3 distance -to(event)
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 53 / 71
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
Aggregate programming: director’s cut
Upgradable mobile code
1 def upgrade (injection) {
2 rep (versioned <- [0, ""no program installed.""]) {
3 max-hood (nbr (
4 if (injection.get(0)) {
5 if(versioned < injection) {
6 injection
7 } else {
8 versioned
9 }
0 } else {
1 versioned
2 }
3 ))
4 }
5 }
6 let prog = upgrade([version , code]);
7 let code = prog.get(1);
8 eval(code);
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 55 / 71
Aggregate programming: director’s cut
Overlapping services
1 def map(f, t){
2 if (t.isEmpty()) {
3 t
4 } else {
5 [f.apply(t.get(0))].mergeAfter(map(f, t.subTupleEnd(1)))
6 }
7 }
8 def distanceTo(source) {
9 rep (d <- Infinity) {
0 mux (source) { 0 } else { min-hood (nbr(d) + nbr-range) }
1 }
2 }
3 def inRange(source, r) { distanceTo(source) < r }
4 /* actual program */
5 let services = [service0 , service1 , service2];
6 map((s) -> {
7 if(inRange(s)) {
8 eval(s)
9 } else {
0 "out of range"
1 }
2 }, services);
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 56 / 71
Aggregate programming: director’s cut
Simpler semantics
Proto Field calculus
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 57 / 71
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
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
Aggregate programming: director’s cut
Example
if•4
>•true
x•3 0•0
+•4 -•
x•3 x•1•1 1•
if•-2
>•true
x•-1 0•0
+• -•-2
x• x•-11• 1•1
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 60 / 71
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
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
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
Self-org patterns: director’s cut
Today’s infrastructure
Internet
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 64 / 71
Self-org patterns: director’s cut
Big crowds
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 65 / 71
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
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
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
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
Self-org patterns: director’s cut
Channel
Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 70 / 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

Mais conteúdo relacionado

Destaque

Powerpoint presentation M.A. Thesis Defence
Powerpoint presentation M.A. Thesis DefencePowerpoint presentation M.A. Thesis Defence
Powerpoint presentation M.A. Thesis Defence
Catie Chase
 
Thesis Powerpoint
Thesis PowerpointThesis Powerpoint
Thesis Powerpoint
neha47
 
Masters Thesis Defense Presentation
Masters Thesis Defense PresentationMasters Thesis Defense Presentation
Masters Thesis Defense Presentation
prajon
 
Prepare your Ph.D. Defense Presentation
Prepare your Ph.D. Defense PresentationPrepare your Ph.D. Defense Presentation
Prepare your Ph.D. Defense Presentation
Christian Glahn
 

Destaque (10)

Democratic process and electronic platforms: concerns of an engineer
Democratic process and electronic platforms: concerns of an engineerDemocratic process and electronic platforms: concerns of an engineer
Democratic process and electronic platforms: concerns of an engineer
 
Protelis: Practical Aggregate Programming - Symposium on Applied Computing (S...
Protelis: Practical Aggregate Programming - Symposium on Applied Computing (S...Protelis: Practical Aggregate Programming - Symposium on Applied Computing (S...
Protelis: Practical Aggregate Programming - Symposium on Applied Computing (S...
 
Ph D Thesis Defense Presentation
Ph D Thesis Defense PresentationPh D Thesis Defense Presentation
Ph D Thesis Defense Presentation
 
Thesis powerpoint
Thesis powerpointThesis powerpoint
Thesis powerpoint
 
Proposal Defense Power Point
Proposal Defense Power PointProposal Defense Power Point
Proposal Defense Power Point
 
Powerpoint presentation M.A. Thesis Defence
Powerpoint presentation M.A. Thesis DefencePowerpoint presentation M.A. Thesis Defence
Powerpoint presentation M.A. Thesis Defence
 
Thesis Defense Presentation
Thesis Defense PresentationThesis Defense Presentation
Thesis Defense Presentation
 
Thesis Powerpoint
Thesis PowerpointThesis Powerpoint
Thesis Powerpoint
 
Masters Thesis Defense Presentation
Masters Thesis Defense PresentationMasters Thesis Defense Presentation
Masters Thesis Defense Presentation
 
Prepare your Ph.D. Defense Presentation
Prepare your Ph.D. Defense PresentationPrepare your Ph.D. Defense Presentation
Prepare your Ph.D. Defense Presentation
 

Semelhante a Engineering Complex Computational Ecosystems (PhD defense)

0.0 sds course introduction vezzoli 13-14
0.0 sds course introduction vezzoli 13-140.0 sds course introduction vezzoli 13-14
0.0 sds course introduction vezzoli 13-14
LeNS_slide
 
Kuchinsky_Cytoscape_BOSC2009
Kuchinsky_Cytoscape_BOSC2009Kuchinsky_Cytoscape_BOSC2009
Kuchinsky_Cytoscape_BOSC2009
bosc
 
Jos van Sas - Testimonial Alcatel-Lucent Bell Labs
Jos van Sas - Testimonial Alcatel-Lucent Bell LabsJos van Sas - Testimonial Alcatel-Lucent Bell Labs
Jos van Sas - Testimonial Alcatel-Lucent Bell Labs
imec.archive
 
7.1 design exercise presentation 12 13 (35)
7.1 design exercise presentation 12 13 (35)7.1 design exercise presentation 12 13 (35)
7.1 design exercise presentation 12 13 (35)
LeNS_slide
 
Proto Spiral.ppt Proto Spiral.ppt Proto Spiral.ppt Proto Spiral.ppt
Proto Spiral.ppt Proto Spiral.ppt Proto Spiral.ppt Proto Spiral.pptProto Spiral.ppt Proto Spiral.ppt Proto Spiral.ppt Proto Spiral.ppt
Proto Spiral.ppt Proto Spiral.ppt Proto Spiral.ppt Proto Spiral.ppt
AnirbanBhar3
 
6.1 method for system design for sustainability vezzoli 14-15 (71)
6.1 method for system design for sustainability vezzoli 14-15 (71)6.1 method for system design for sustainability vezzoli 14-15 (71)
6.1 method for system design for sustainability vezzoli 14-15 (71)
LeNS_slide
 
6.1 method for system design for sustainability vezzoli 14-15 (71)
6.1 method for system design for sustainability vezzoli 14-15 (71)6.1 method for system design for sustainability vezzoli 14-15 (71)
6.1 method for system design for sustainability vezzoli 14-15 (71)
Emanuela Emy
 

Semelhante a Engineering Complex Computational Ecosystems (PhD defense) (20)

From Engineer to Alchemist, There and Back Again: An Alchemist Tale
From Engineer to Alchemist, There and Back Again: An Alchemist TaleFrom Engineer to Alchemist, There and Back Again: An Alchemist Tale
From Engineer to Alchemist, There and Back Again: An Alchemist Tale
 
Engineering computational ecosystems (2nd year PhD seminar)
Engineering computational ecosystems (2nd year PhD seminar)Engineering computational ecosystems (2nd year PhD seminar)
Engineering computational ecosystems (2nd year PhD seminar)
 
Monitoring and Operational Data Analytics from a User Perspective at First Eu...
Monitoring and Operational Data Analytics from a User Perspective at First Eu...Monitoring and Operational Data Analytics from a User Perspective at First Eu...
Monitoring and Operational Data Analytics from a User Perspective at First Eu...
 
0.0 sds course introduction vezzoli 13-14
0.0 sds course introduction vezzoli 13-140.0 sds course introduction vezzoli 13-14
0.0 sds course introduction vezzoli 13-14
 
Kuchinsky_Cytoscape_BOSC2009
Kuchinsky_Cytoscape_BOSC2009Kuchinsky_Cytoscape_BOSC2009
Kuchinsky_Cytoscape_BOSC2009
 
Towards a Foundational API for Resilient Distributed Systems Design
Towards a Foundational API for Resilient Distributed Systems DesignTowards a Foundational API for Resilient Distributed Systems Design
Towards a Foundational API for Resilient Distributed Systems Design
 
Software Sustainability Institute
Software Sustainability InstituteSoftware Sustainability Institute
Software Sustainability Institute
 
NeOn Tool Support for Building Ontologies By Reuse - ICBO 09
NeOn Tool Support for Building Ontologies By Reuse - ICBO 09NeOn Tool Support for Building Ontologies By Reuse - ICBO 09
NeOn Tool Support for Building Ontologies By Reuse - ICBO 09
 
Jos van Sas - Testimonial Alcatel-Lucent Bell Labs
Jos van Sas - Testimonial Alcatel-Lucent Bell LabsJos van Sas - Testimonial Alcatel-Lucent Bell Labs
Jos van Sas - Testimonial Alcatel-Lucent Bell Labs
 
Cv Licheri Eng Mar 11
Cv Licheri Eng Mar 11Cv Licheri Eng Mar 11
Cv Licheri Eng Mar 11
 
7.1 design exercise presentation 12 13 (35)
7.1 design exercise presentation 12 13 (35)7.1 design exercise presentation 12 13 (35)
7.1 design exercise presentation 12 13 (35)
 
Proto Spiral.ppt Proto Spiral.ppt Proto Spiral.ppt Proto Spiral.ppt
Proto Spiral.ppt Proto Spiral.ppt Proto Spiral.ppt Proto Spiral.pptProto Spiral.ppt Proto Spiral.ppt Proto Spiral.ppt Proto Spiral.ppt
Proto Spiral.ppt Proto Spiral.ppt Proto Spiral.ppt Proto Spiral.ppt
 
Practical Aggregate Programming with Protelis @ SASO2017
Practical Aggregate Programming with Protelis @ SASO2017Practical Aggregate Programming with Protelis @ SASO2017
Practical Aggregate Programming with Protelis @ SASO2017
 
Towards Reinforcement Learning-based Aggregate Computing
Towards Reinforcement Learning-based Aggregate ComputingTowards Reinforcement Learning-based Aggregate Computing
Towards Reinforcement Learning-based Aggregate Computing
 
Y13 coeu thermo_sig_2013
Y13 coeu thermo_sig_2013Y13 coeu thermo_sig_2013
Y13 coeu thermo_sig_2013
 
Gridforum Juergen Knobloch Grids For Science 20080402
Gridforum Juergen Knobloch Grids For Science 20080402Gridforum Juergen Knobloch Grids For Science 20080402
Gridforum Juergen Knobloch Grids For Science 20080402
 
Machine Learning for Automated Reasoning: An Overview
Machine Learning for Automated Reasoning: An OverviewMachine Learning for Automated Reasoning: An Overview
Machine Learning for Automated Reasoning: An Overview
 
6.1 method for system design for sustainability vezzoli 14-15 (71)
6.1 method for system design for sustainability vezzoli 14-15 (71)6.1 method for system design for sustainability vezzoli 14-15 (71)
6.1 method for system design for sustainability vezzoli 14-15 (71)
 
6.1 method for system design for sustainability vezzoli 14-15 (71)
6.1 method for system design for sustainability vezzoli 14-15 (71)6.1 method for system design for sustainability vezzoli 14-15 (71)
6.1 method for system design for sustainability vezzoli 14-15 (71)
 
0.0 sds course introduction vezzoli 14-15
0.0 sds course introduction vezzoli 14-150.0 sds course introduction vezzoli 14-15
0.0 sds course introduction vezzoli 14-15
 

Mais de Danilo Pianini

SAPERE WP1 Alchemist status at 02/2013
SAPERE WP1 Alchemist status at 02/2013SAPERE WP1 Alchemist status at 02/2013
SAPERE WP1 Alchemist status at 02/2013
Danilo Pianini
 
Recipes for Sabayon: cook your own Linux distro within two hours
Recipes for Sabayon: cook your own Linux distro within two hoursRecipes for Sabayon: cook your own Linux distro within two hours
Recipes for Sabayon: cook your own Linux distro within two hours
Danilo Pianini
 

Mais de Danilo Pianini (10)

Time fluid field-based Coordination
Time fluid field-based CoordinationTime fluid field-based Coordination
Time fluid field-based Coordination
 
Engineering the Aggregate - Talk at Software Engineering for Intelligent and ...
Engineering the Aggregate - Talk at Software Engineering for Intelligent and ...Engineering the Aggregate - Talk at Software Engineering for Intelligent and ...
Engineering the Aggregate - Talk at Software Engineering for Intelligent and ...
 
Versioning and License selection
Versioning and License selectionVersioning and License selection
Versioning and License selection
 
Continuous Integration
Continuous IntegrationContinuous Integration
Continuous Integration
 
Enforce reproducibility: dependency management and build automation
Enforce reproducibility: dependency management and build automationEnforce reproducibility: dependency management and build automation
Enforce reproducibility: dependency management and build automation
 
Productive parallel teamwork: Decentralized Version Control Systems
Productive parallel teamwork: Decentralized Version Control SystemsProductive parallel teamwork: Decentralized Version Control Systems
Productive parallel teamwork: Decentralized Version Control Systems
 
Computational Fields meet Augmented Reality: Perspectives and Challenges
Computational Fields meet Augmented Reality: Perspectives and ChallengesComputational Fields meet Augmented Reality: Perspectives and Challenges
Computational Fields meet Augmented Reality: Perspectives and Challenges
 
Continuous integration and delivery
Continuous integration and deliveryContinuous integration and delivery
Continuous integration and delivery
 
SAPERE WP1 Alchemist status at 02/2013
SAPERE WP1 Alchemist status at 02/2013SAPERE WP1 Alchemist status at 02/2013
SAPERE WP1 Alchemist status at 02/2013
 
Recipes for Sabayon: cook your own Linux distro within two hours
Recipes for Sabayon: cook your own Linux distro within two hoursRecipes for Sabayon: cook your own Linux distro within two hours
Recipes for Sabayon: cook your own Linux distro within two hours
 

Último

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Último (20)

Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 

Engineering Complex Computational Ecosystems (PhD defense)

  • 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
  • 27. Aggregate programming Protelis: practical aggregate programming LISP-like to Java-like syntax 1 (def distance -to (source) 2 (rep d infinity (mux source 0 (min-hood (+ (nbr d) (nbr-range)))))) 3 distance -to(event) 1 def distanceTo(source) { 2 rep (d <- Infinity) { 3 mux (source) { 4 0 5 } else { 6 minHood(nbr(d) + nbrRange) 7 } 8 } 9 distanceTo(event) Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 27 / 71
  • 28. Aggregate programming Protelis: practical aggregate programming Example with HOF 1 def gBB(source, initial , metric, accumulate) { 2 rep(distanceValue <- [Infinity , initial]) { 3 mux(source) { 4 [0, initial] 5 } else { 6 let ndv = nbr(distanceValue); 7 minHood([ndv.get(0) + metric.apply(), accumulate.apply(ndv.get(1))]) 8 } 9 }.get(1) 0 } 1 2 def distanceCompetition(d, lead, uid, grain, metric) { 3 mux(d > grain * 1.5) { uid } else { 4 let gsize = grain * 0.5; 5 mux (d >= gsize) { Infinity } else { 6 minHood(mux(nbr(d) + metric.apply() >= gsize) { Infinity } else { nbr(lead) }) 7 } 8 } 9 } 0 1 def breakUsingUIDs(uid, grain, metric) { 2 uid == rep(lead <- uid) { 3 distanceCompetition( 4 gBB(uid == lead, 0, metric, (v) -> {v + metric.apply()}), lead, uid, grain, metric) 5 } 6 } 7 8 breakUsingUIDs(grain, metric) Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 28 / 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
  • 33. Future technology applied today Mobile code Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 33 / 71
  • 34. Future technology applied today Upgradable mobile code Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 34 / 71
  • 35. Future technology applied today Upgradable mobile code Crowd steering service version 2 Crowd steering service version 1 Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 35 / 71
  • 36. Future technology applied today Upgradable mobile code Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 36 / 71
  • 37. Future technology applied today Overlapping services Exhibition tickets Food service Public water Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 37 / 71
  • 38. Future technology applied today Overlapping services Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 38 / 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
  • 53. Aggregate programming: director’s cut Example 1 (def distance -to (source) 2 (rep d infinity (mux source 0 (min-hood (+ (nbr d) (nbr-range)))))) 3 distance -to(event) Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 53 / 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
  • 55. Aggregate programming: director’s cut Upgradable mobile code 1 def upgrade (injection) { 2 rep (versioned <- [0, ""no program installed.""]) { 3 max-hood (nbr ( 4 if (injection.get(0)) { 5 if(versioned < injection) { 6 injection 7 } else { 8 versioned 9 } 0 } else { 1 versioned 2 } 3 )) 4 } 5 } 6 let prog = upgrade([version , code]); 7 let code = prog.get(1); 8 eval(code); Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 55 / 71
  • 56. Aggregate programming: director’s cut Overlapping services 1 def map(f, t){ 2 if (t.isEmpty()) { 3 t 4 } else { 5 [f.apply(t.get(0))].mergeAfter(map(f, t.subTupleEnd(1))) 6 } 7 } 8 def distanceTo(source) { 9 rep (d <- Infinity) { 0 mux (source) { 0 } else { min-hood (nbr(d) + nbr-range) } 1 } 2 } 3 def inRange(source, r) { distanceTo(source) < r } 4 /* actual program */ 5 let services = [service0 , service1 , service2]; 6 map((s) -> { 7 if(inRange(s)) { 8 eval(s) 9 } else { 0 "out of range" 1 } 2 }, services); Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 56 / 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
  • 60. Aggregate programming: director’s cut Example if•4 >•true x•3 0•0 +•4 -• x•3 x•1•1 1• if•-2 >•true x•-1 0•0 +• -•-2 x• x•-11• 1•1 Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 60 / 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
  • 64. Self-org patterns: director’s cut Today’s infrastructure Internet Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 64 / 71
  • 65. Self-org patterns: director’s cut Big crowds Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 65 / 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
  • 70. Self-org patterns: director’s cut Channel Danilo Pianini (UniBo) Engineering Computational Ecosystems April 13, 2015 / Bologna 70 / 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