Self-aware Pervasive Service Ecosystems Self-Organising Mechanisms and Design Patterns for Engineering Self-Organising Applications ---A Smart Environment Application Giovanna Di Marzo Serugendo Jose-Luis Fernandez-Marquez University of Geneva
[email protected] [email protected]
Lyon November 2013
1
Giovanna Di Marzo Serugendo
Outline Inspiration / Motivation Self-organising Mechanisms and Design Patterns Engineering / SAPERE project Case study: Crowd Steering
Lyon November 2013
2
Giovanna Di Marzo Serugendo
“Brad” the toaster
http://vimeo.com/41363473 Lyon November 2013
3
Giovanna Di Marzo Serugendo
Smart Home
http://www.youtube.com/watch?v=9DJr8QwgLEA Lyon November 2013
4
Giovanna Di Marzo Serugendo
Smart Cities
http://www.youtube.com/watch?v=AvbQX8PPHzE Lyon November 2013
5
Giovanna Di Marzo Serugendo
Smart Cities
Lyon November 2013
6
Giovanna Di Marzo Serugendo
Smart Society
Lyon November 2013
7
Giovanna Di Marzo Serugendo
Ecosystem of Displays (private/public)
Lyon November 2013
8
Giovanna Di Marzo Serugendo
Self-organising services
Crowd Steering Chemotaxis Gradient Spreading
Self-organising mechanisms … provided as services Lyon November 2013
9
Giovanna Di Marzo Serugendo
Characteristics - Smart = ?
Communication Adaptation Autonomy Intelligence
Lyon November 2013
10
Giovanna Di Marzo Serugendo
Motivation Engineering self-organising applications and services in pervasive systems, smart environment such that: – (Re-)use of code, easing the design and implementation of bio-inspired applications. – Set of bio-inspired mechanisms provided as low-level services Creation of spatial structures through dedicated services Used as a basis to build applications or high level services.
– Low-level services are requested on demand by applications or high level services – Low-level services are embedded in a middleware [FMADMSC11, FMADMS+11, FMDMSM+12] Lyon November 2013
11
Giovanna Di Marzo Serugendo
Motivation Engineering of complex systems – Environment – Software Agents / Applications (autonomous entities) – Self-* Mechanisms / Services – Middleware infrastructures
Self-* mechanisms (bio-inspired) – Expressed under the form of design patterns – Composition / inter-relations and boundaries among mechanisms Lyon November 2013
12
Giovanna Di Marzo Serugendo
Summary
Motivation – Smart- Cities / Homes / Displays / Things
Self-organising mechanisms: useful concepts Self-organising services / Spatial structures Engineering
Lyon November 2013
13
Giovanna Di Marzo Serugendo
Outline Inspiration / Motivation Self-organising Mechanisms and Design Patterns – Natural self-organising systems – Low- Medium- High-level Mechanisms Design Patterns Smart Environment Applications
Engineering / SAPERE project Case study: Crowd Steering
Lyon November 2013
14
Giovanna Di Marzo Serugendo
Self-organising systems in nature
Lyon November 2013
15
Giovanna Di Marzo Serugendo
Pheromone
http://www.youtube.com/watch?v=guJYjmo-f08 Lyon November 2013
16
Giovanna Di Marzo Serugendo
Physical Phenomena
German artist – Volkhart Stuerzbecher
Art inspired by self-organising principles – http://www.stuerzbecher.de/website.php – http://www.stuerzbecher.de/img/konvektion_256.wmv Lyon November 2013
17
Giovanna Di Marzo Serugendo
Characteristics – Natural Systems = ?
Collective aspect Large number of components -> redundancy Decentralisded Reactive / Proactive Autonomy Adaptation Indirect communication Environment
Lyon November 2013
18
Giovanna Di Marzo Serugendo
Self-organising mechanisms expressed as design patterns
Lyon November 2013
19
Giovanna Di Marzo Serugendo
Self-Organising Design Patterns
Lyon November 2013
20
Giovanna Di Marzo Serugendo
Design Patterns Design Patterns’ Catalogue – Self-organising mechanisms recurrent and frequently involved in more complex mechanisms – Identification of: Inter-relations between mechanisms Boundaries of each mechanism
– Classification into three levels [FMDMSM+12]
Lyon November 2013
21
Giovanna Di Marzo Serugendo
Self-Organising Design Patterns Description – Abstract Transition Rule – Sequence Diagram, Implementation details, Explanations
Lyon November 2013
22
Giovanna Di Marzo Serugendo
Spreading
http://ergodd.zoo.ox.ac.uk/eurasia/Eurasian%20Street%20Web/Studies/animations/Sim_30_608_393_smoothed.gif Lyon November 2013
23
Giovanna Di Marzo Serugendo
Spreading Problem: – in systems, where agents perform only local interactions, agents’ reasoning suffers from the lack of knowledge about the global system.
Solution: – a copy of the information (received or held by an agent) is sent to neighbours and propagated over the network from one node to another. Information spreads progressively over the system and reduces the lack of knowledge of the agents while keeping the constraint of the local interaction.
Entities – Dynamics – Environment
Usage – Information dissemination Lyon November 2013
24
Giovanna Di Marzo Serugendo
Spreading Implementation
Lyon November 2013
25
Giovanna Di Marzo Serugendo
Smart Parking
http://www.libelium.com/smart_parking/ Lyon November 2013
26
Giovanna Di Marzo Serugendo
Aggregation
Lyon November 2013
27
Giovanna Di Marzo Serugendo
Aggregation Problem: – Excess of information produces overloads. Information must be distributively processed in order to reduce the amount of information and to obtain meaningful information.
Solution – Aggregation consists in locally applying a fusion operator to synthesise macro information (filtering, merging, aggregating, or transforming)
Entities – Dynamics – Environment
Usage – Aggregation of pheromones, fusion of information, context-awareness Lyon November 2013
28
Giovanna Di Marzo Serugendo
Aggregation Implementation Infrastuctural Agent or Host Agent data_req() send_data() Apply Aggregation send_data_aggr() Store Aggregated Data
Lyon November 2013
29
Giovanna Di Marzo Serugendo
Measure Average Pollution / Highest Pollution Point
Lyon November 2013
30
Giovanna Di Marzo Serugendo
Measure density of people
Lyon November 2013
31
Giovanna Di Marzo Serugendo
Evaporation
Lyon November 2013
32
Giovanna Di Marzo Serugendo
Evaporation Problem: – Outdated information cannot be detected and it needs to be removed, or its detection involves a cost that needs to be avoided. Agent decisions rely on the freshness of the information presented in the system, enabling correct responses to dynamic environments.
Solution – Evaporation is a mechanism that periodically reduces the relevance of information. Thus, recent information becomes more relevant than older information.
Entities – Dynamics – Environment
Usage – Digital pheromone, context-awareness (ageing information) Lyon November 2013
33
Giovanna Di Marzo Serugendo
Evaporation Implementation Start
rev?
No
yes
Rel(Inf) > 0 ?
No
Yes
Stop
Lyon November 2013
Apply Evap.
34
Giovanna Di Marzo Serugendo
Ice on Road / Potholes
Remove information when no longer useful Lyon November 2013
35
Giovanna Di Marzo Serugendo
Repulsion
Lyon November 2013
36
Giovanna Di Marzo Serugendo
Repulsion Problem: – Agents’ movements have to be coordinated in a decentralised manner in order to achieve a uniform distribution and to avoid collisions among them
Solution – The Repulsion Pattern creates a repulsion vector that guides agents to move from regions with high concentrations of agents to regions with lower concentrations. Thus, after few iterations agents reach a more uniform distribution in the environment
Entities – Dynamics – Environment
Usage – Shape formation Lyon November 2013
37
Giovanna Di Marzo Serugendo
Repulsion Implementation
Agent
Start
Neighbouring Hosts
Host
SendPositionRequest() SendPositionRequest()
SendPositionReque stToNeighbours()
SendPosition() SendPosition()
Received Positions?
CalculateRepulsion Vector()
No yes
CalculateDesired Position()
Calculate Repulsion()
MoveToHostClosest ToNewPosition() CalculateDesired Position()
MoveToHostClosest ToNewPosition()
Lyon November 2013
38
Giovanna Di Marzo Serugendo
MoveToHostClosest ToNewPosition()
Spatial Memory Service Special Gorilla Exhibition at 3pm
Time: 2.30pm-3pm Accessibility: Public 80% Area: Gorilla Kingdom
London Zoo
39
Spatial Memory Service Repulsion Information moves to node closest to repulsion vector
40
Spatial Memory Service
Lyon November 2013
41
Giovanna Di Marzo Serugendo
Self-Organising Design Patterns
Lyon November 2013
42
Giovanna Di Marzo Serugendo
Gossip
Lyon November 2013
43
Giovanna Di Marzo Serugendo
Gossip Problem: – in large-scale systems, agents need to reach an agreement, shared among all agents, with only local perception and in a decentralised way
Solution – information spreads to neighbours, where it is aggregated with local information. Aggregates are spread further and their value progressively reaches the agreement
Entities – Dynamics – Environment
Usage – Computation of sums, averages Lyon November 2013
44
Giovanna Di Marzo Serugendo
Gossip Implementation: Agent or Infras. Agent
Start
no
Host
Neighbour Hosts send(inf)
input events?
send(inf)
yes yes
Stop
Same value broadcasted before? no
apply aggr. operator send(aggr) send(aggr)
Apply aggregation operator Broadcast aggregated Information
Lyon November 2013
45
Giovanna Di Marzo Serugendo
Reaching an agreement / Voting best artist
Lyon November 2013
46
Giovanna Di Marzo Serugendo
Gradient
Lyon November 2013
47
Giovanna Di Marzo Serugendo
Gradient Problem: – agents belonging to large systems suffer from lack of global knowledge to estimate the consequences of their actions or the actions performed by other agents beyond their communication range
Solution – information spreads from the location it is initially deposited and aggregates when it meets other information. During spreading, additional information about the sender’s distance and direction is provided: either through a distance value (incremented or decremented); or by modifying the information to represent its concentration (lower concentration when information is further away).
Entities – Dynamics – Environment
Usage – Routing in ad-hoc networks Lyon November 2013
48
Giovanna Di Marzo Serugendo
Gradient Implementation: Start
Agent
No
input events?
Stop
Neighbour Hosts
Agent or Infras. Agent
Neighbour Hosts
send(inf,d) send(inf,0) check inf and Aggregate.
Distance is lower than local one?
send(inf, d+1) send(inf, d+1)
yes Aggregated inf. (The one with lower distance stays stored) Broadcast inf. incrementing counter
Lyon November 2013
Host
send(inf,d)
send(inf,0)
yes no
Host
49
Giovanna Di Marzo Serugendo
Find a Friend / Chat
Lyon November 2013
50
Giovanna Di Marzo Serugendo
Gradient
Shortest Path
Information Follows path
Defective Node New Path
Chat / Find a Friend
Lyon November 2013
53
Giovanna Di Marzo Serugendo
Digital Pheromone
Lyon November 2013
54
Giovanna Di Marzo Serugendo
Digital Pheromone Problem: – coordination of agents in large scale environments using indirect communication
Solution – digital pheromone provides a way to coordinate agent’s behaviour using indirect communication in high dynamic environments. Digital pheromones create gradients that spread over the environment, carrying information about their distance and direction. Thus, agents can perceive pheromones from the distance and increase the knowledge about the system. Moreover, as time goes by digital pheromones evaporate, providing adaptation to environmental changes
Usage – Autonomous coordination of swarms (UAV)
Lyon November 2013
55
Giovanna Di Marzo Serugendo
Digital Pheromone Entities – Dynamics – Environment
Lyon November 2013
56
Giovanna Di Marzo Serugendo
Building temporary Trails Finding a lost object
Lyon November 2013
57
Giovanna Di Marzo Serugendo
Self-Organising Design Patterns
Lyon November 2013
58
Giovanna Di Marzo Serugendo
Ant Foraging
Lyon November 2013
59
Giovanna Di Marzo Serugendo
Ant Foraging Problem:
– large scale optimisation problems that can be transformed into the problem of finding the shortest path on a weighted graph. Solution – the Ant Foraging Pattern provides rules to explore the environment in a decentralised manner and to exploit resources Entities – Dynamics – Environment
Usage – Ant Colony Optimisation Lyon November 2013
60
Giovanna Di Marzo Serugendo
Ant Foraging Implementation
Lyon November 2013
61
Giovanna Di Marzo Serugendo
Optimisation / Shortest Path / Traffic Control
Lyon November 2013
62
Giovanna Di Marzo Serugendo
Morphogenesis
Lyon November 2013
63
Giovanna Di Marzo Serugendo
Morphogenesis Problem: – in large-scale decentralised systems, agents decide on their roles or plan their activities based on their spatial position
Solution – specific agents spread morphogenetic gradients. Agents assess their positions in the system by computing their relative distance to the morphogenetic gradients sources
Entities – Dynamics – Environment
Usage – Self-configuring (Meta-morphic) robots, shape formation Lyon November 2013
64
Giovanna Di Marzo Serugendo
Morphogenesis Implementation: Agent
Start
Neighbour Hosts
Host
GradInf() GradInf() Gradients Received?
Estimate relative position
No yes
Change Agent's role
Estimate relative position based on received gradients
Change role according to the relative position
Lyon November 2013
65
Giovanna Di Marzo Serugendo
Changing traffic signals based on traffic conditions
Lyon November 2013
66
Giovanna Di Marzo Serugendo
Specialisation
Lyon November 2013
67
Giovanna Di Marzo Serugendo
Specialisation Problem: – Global optimization of system efficiency by increasing or decreasing the contributions of individual entities or by otherwise changing the rules under which those entities operate.
Solution – Individual entities are assigned a specific role or set of behavioral rules depending on their capabilities and contextual local information.
Entities – Dynamics – Environment – Morphogenesis
Usage – Overlay networks (change roles), load balancing Lyon November 2013
68
Giovanna Di Marzo Serugendo
Smart Environment – Specialisation according to city area
Lyon November 2013
69
Giovanna Di Marzo Serugendo
Chemotaxis
Lyon November 2013
70
Giovanna Di Marzo Serugendo
Chemotaxis Problem: – decentralised motion coordination aiming at detecting sources or boundaries of events
Solution – agents locally sense gradient information and follow the gradient in a specified direction (i.e. follow higher gradient values, lower gradient values, or equipotential lines of gradients).
Entities – Dynamics – Environment
Usage – Routing messages Lyon November 2013
71
Giovanna Di Marzo Serugendo
Chemotaxis Implementation Agent
Host
Start
Neighbour Hosts
GradRequest() GradRequest()
Send concetration request to n neighbouring hosts
Send_grad()
yes
Send_grad() No
Inf. Received?
Choose host with highest concentration
yes
MoveToHost(h)
Move to host with highest gradient
Lyon November 2013
72
Giovanna Di Marzo Serugendo
MoveToHost(h)
Routing / Find a Friend
Lyon November 2013
73
Giovanna Di Marzo Serugendo
Detecting source of diffuse events
Lyon November 2013
74
Giovanna Di Marzo Serugendo
Quorum Sensing
Lyon November 2013
75
Giovanna Di Marzo Serugendo
Quorum Sensing Problem – collective decisions in large-scale decentralised systems, requiring a threshold number of agents or estimation of the density of agents in a system, using only local interactions.
Solution – the Quorum Sensing Pattern allows to take collective decisions through an estimation by individual agents of the agents’ density (assessing the number of other agents they interact with) and by determination of a threshold number of agents necessary to take the decision
Entities – Dynamics – Environment – Gradient, Morphogenesis
Usage – Power saving in wireless sensor networks, swarms decisions Lyon November 2013
76
Giovanna Di Marzo Serugendo
Quorum Sensing Implementation
Agent
Neighbour Hosts
Host
GradInf()
Start
GradInf() Gradients Receved?
if Grad > thres trigger task
No yes
No
Gradient's concentration higher than threshold?
yes
Trigger collaborative task
Lyon November 2013
77
Giovanna Di Marzo Serugendo
Green Wave
Lyon November 2013
78
Giovanna Di Marzo Serugendo
Collective Sort
Lyon November 2013
79
Giovanna Di Marzo Serugendo
Collective Sort
Problem: – A system contains a number of scattered data or entities that need to be brought into relative proximity with other similar data or entities.
Solution – Individual agents move through an environment, encountering data items as they travel. By picking up and dropping these items based on local heuristics, elements with similar properties are progressively gathered into homogeneous groups or clusters.
Lyon November 2013
80
Giovanna Di Marzo Serugendo
Collective Sort Entities – Dynamics – Environment
Usage – Clustering in P2P networks, storage and retrieval of files
Lyon November 2013
81
Giovanna Di Marzo Serugendo
Clustering in P2P Files
Lyon November 2013
82
Giovanna Di Marzo Serugendo
Flocking
Lyon November 2013
83
Giovanna Di Marzo Serugendo
Flocking Problem: – Dynamic motion coordination and pattern formation of swarms
Solution – The Flocking Pattern provides a set of rules for moving groups of agents over the environment while keeping the formation and interconnections between them
Entities – Dynamics – Environment – – – –
Cohesion (group) Separation Alignment (velocity, direction) Group objective (target)
Usage – Movies, advertisement, games, modelling crowds Lyon November 2013
84
Giovanna Di Marzo Serugendo
Platooning
Lyon November 2013
85
Giovanna Di Marzo Serugendo
Swarm Drones / Earthquakes zones monitoring
http://www.mobilemag.com/2012/02/03/skynet-for-real-organized-swarm-ofnano-quadrocopters-video/ Lyon November 2013
86
Giovanna Di Marzo Serugendo
Google Balloons
http://www.theguardian.com/technology/video/2013/jun/15/google-ballooninternet-new-zealand-video Lyon November 2013
87
Giovanna Di Marzo Serugendo
Outline Inspiration / Motivation Self-organising Mechanisms and Design Patterns Engineering / SAPERE project – SAPERE – Execution Model – Separation of concerns
Case study: Crowd Steering Lyon November 2013
88
Giovanna Di Marzo Serugendo
SAPERE
Lyon November 2013
89
Giovanna Di Marzo Serugendo
Framework: SAPERE project Ecosystem of Services • Inspiration from chemical reactions Service deployment Spontaneous interactions among services Spontaneous aggregation of data
• Context-awareness (user, situation recognition) • Self-organisation (building spatial structures, composing services) • Self-management (decentralised control) • Domains
• Ecosystem of displays for user/crowd steering
• Middleware for Android phones / tablets • EU Funded Project - SAPERE: http://www.sapere-project.eu
• Collaboration: U Geneva, U Bologna, U Modena, U Linz, U St-Andrews • 2010-2013
Lyon November 2013
90
Giovanna Di Marzo Serugendo
Case Studies Crowd Steering through Self-Organising Public/Private Displays Single user Multiple user Emergency
Lyon November 2013
91
Giovanna Di Marzo Serugendo
SAPERE motivation Theoretical and practical framework for pervasive ecosystems. Common modelling and a common treatment of services, data, and devices What are we expecting from SAPERE? – Ease the development of distributed application on top of heterogeneous networks (i.e. composed of mobile phones, public displays, laptops, or tablet) – Step forward to engineering self-organising system – Abstraction of the network level – Set of low and high level services used as building block for engineering applications F. Zambonelli et al. [FZAM2011]
Lyon November 2013
92
Giovanna Di Marzo Serugendo
SAPERE Concepts Live Semantic Annotation (LSA) is the virtual representation of a service, data or device (i.e. any SAPERE entity). It ensures a common treatment and manage contextual information. LSA space is a shared tuple space where SAPERE entities interact through eco-laws. Eco-laws are virtual chemical reactions that drive the dynamics of the eco-system. Lyon November 2013
93
Giovanna Di Marzo Serugendo
SAPERE Concepts SAPERE Concepts Ecosystem of services is ruled by “eco-laws” – Drive the dynamics of the system – Act like Chemical Reactions – Trigger when enabled (pattern-matching, rewriting rules)
Information about services, data, devices: “Live Semantic Annotations (LSAs)” – Reflect changes in services, data, devices 20/01/11
94
Self-aware Pervasive Service Ecosystems
SAPERE syntax LSAs: ECO-LAWS: send (< propagation = “gradient”, …>), < … >
Lyon November 2013
95
Giovanna Di Marzo Serugendo
SAPERE - Structure
Lyon November 2013
96
Giovanna Di Marzo Serugendo
SAPERE - Structure Noden - LSA space
Eco-laws (e.g. gradient spreading)
Lyon November 2013
97
Giovanna Di Marzo Serugendo
Network of Nodes - Relates to Users Sensors Displays Web
SAPERE- Structure Application
Service
LSA
Connectivity
LSAs
Sensor
Eco-laws
Lyon November 2013
LSAs
LSA space Node1
98
Application LSA
LSA
LSA
Activated Service
LSA Sensor
Giovanna Di Marzo Serugendo
Service LSA Eco-laws
LSA space Node2 – LSA space
SAPERE Structure Applications Applications
Agents High level Patterns
Services
LSA’s Space
Blackboard CORE services
Basic and Composed Patterns
Eco-laws
Comp. Environment
Lyon November 2013
External Libraries
99
Giovanna Di Marzo Serugendo
SAPERE Structure
Applications Agents
Services Black Board
Eco-laws: – Propagation: Spreads an LSA to one or all neighbouring LSA’s spaces. – Aggregation: Reduces the amount of LSA’s in the LSA space by extracting meaningful information. – Evaporation: Reduces the relevance of an LSA. If relevance is zero the LSA is automatically removed. – Gradient: creates a gradient structure, providing information about the distance and direction of the node source. – Bonding: creates links (references) between LSAs in order to determine the visibility of the LSAs, i.e., an agent can see an LSA if its own LSA is bound to that information. Lyon November 2013
10 0
Giovanna Di Marzo Serugendo
CORE services Primitives
SAPERE Structure Applications Agents
Services
LSA Space: • The LSA Space is a blackboard where all entities in the system are represented by an LSA. • The context is defined and represented as the set of LSAs stored in a given locality (i.e. LSA space)
Lyon November 2013
10 1
Giovanna Di Marzo Serugendo
Black Board CORE services Primitives
SAPERE Structure Applications Agents
External Libraries:
Services Black Board
Service Self-composition Routing implementing Chemotaxis Dynamic Gradients Remote data query and aggregation Reaching a consensus (Gossip) Self-protection (data and services) Self-management Encryption
Lyon November 2013
10 2
Giovanna Di Marzo Serugendo
CORE services Primitives
Applications Agents Services Black Board CORE services Primitives
Execution Model
Lyon November 2013
10 3
Giovanna Di Marzo Serugendo
What is an execution model? An execution model describes how a computer or virtual machine carries out the instructions of a computer program. E.g. Von Neumann execution model Architecture Execution model Programming Language
Lyon November 2013
104
Giovanna Di Marzo Serugendo
Von Neumann Architecture
Why self-organising systems need new execution models? Self-organising systems are intrinsically distributed and decentralized. Distributed programming needs to be easy to program while keeping performance. Applications should be able to interact and share information among them. The execution model provides an abstraction of the network level. Simulating is different from engineering self-organising systems.
Info? An execution model for selforganising systems describes how instructions are carried out among a set of distributed computers. Fraglets, Rules Based Networks BIO-CORE Lyon November 2013
105
Node A
send(info)
Giovanna Di Marzo Serugendo
Node B
Execution model inspiration Two main sources of inspiration for developing new execution models: – Gamma Chemical Reaction Model. – Biological self-organising systems.
1
13 2 7 5 10 11 15 13 8 4 8 6 1 3 12 1 5 17 1 1 6 10 14 8 3 15 6 4 14 8 6 1 11 12
2
Gamma Reaction Model eases code distribution because it can be executed without any order, an also it carries out interaction between different applications through chemical reactions. Bio-inspired self-organising systems allows complex self-organising behaviours to emerge from simple rules. Concepts:
Chemical reactions Shared spaces Rules Communication primitives
Lyon November 2013
106
Giovanna Di Marzo Serugendo
BIO-CORE Inspired by chemical reactions machine and biological self-organising systems It combines a rule-based system with tuple spaces It proposes a layered architecture, allowing reuse of code BIO-CORE implements a set of: • Low level core services • providing basic self-organising mechanisms (e.g. Aggregation, Spreading, Evaporation, Gradients) • requested on demand by applications or high level services
Lyon November 2013
107
Giovanna Di Marzo Serugendo
BIO-CORE
BIO-CORE is an execution model based on: shared space technology, and rules. BIO-CORE implements a set of: • low level core services, providing basic self-organising mechanisms (e.g. Aggregation, Spreading, Evaporation, Gradients) • requested on demand by applications or high level services. [FMDMSM11]
108
BIO-CORE – Bio-logically inspired Software Agents Organisms
Host Agents, memory, sensors, actuators...
Infrastructure Environment
CORE (Basic Bio-Inspired Services, Core's Data Space, Core Interfaces)
Environment
(a) Biological Model
(b) Computational Model J.L. Fernandez-Marquez et al. [FMDMSM11]
Lyon November 2013
109
Giovanna Di Marzo Serugendo
Computational Model
Lyon November 2013
110
Giovanna Di Marzo Serugendo
BIO-CORE - Patterns
Quorum Sensing
Gossip
Chemotaxis
Morphogenesis
Gradients
Aggregation
Lyon November 2013
Spreading
111
Foraging
CORE
Evaporation
Giovanna Di Marzo Serugendo
BIO-CORE - Structure BIO-CORE is composed of: Core Data space: Shared space located in nodes, where data reside. External Interface: Provides a set of primitives to allow applications and high level services to inject, retrieve or remove data. Engine: The engine processes the data located in the Core Data Space and executes rules according to the data properties.
Lyon November 2013
112
Giovanna Di Marzo Serugendo
BIO-CORE – Data properties
tuple :
SASO 2013
113
Jose Luis Fernandez-Marquez
BIO-CORE – Tuples and Rules Tuple: Rules: send (),
Lyon November 2013
114
Giovanna Di Marzo Serugendo
Execution Model and Core Services Spreading Service Evaporation Service
node:Node
node:Node agent: Agent
space:LSA space
neighbouringNodes:Node
agent: Agent
space:LSA space
Inject()
inject()
bcst()
…
AWASS Summer School 13/06/2012
11 5
Giovanna Di Marzo Serugendo
Execution Model and Core Services Composition of Core Services – Design time composition, late binding
node:Node
node:Node agent: Agent
space:LSA space
neighbouringNodes: Node
agent: Agent
space:LSA space
neighbouringNodes: Node
inject()
inject()
bcst()
bcst()
…
…
AWASS Summer School 13/06/2012
116
Giovanna Di Marzo Serugendo
Execution Model and Core Services BIO-CORE – Execution model for Core mechanisms (ready to use) as Core Services
Decoupling Functionality of Self-Aware Applications from Environmental Tasks Spatial structure maintenance (e.g. Gradient spreading, Evaporation, …)
Mechanisms for Spatial Structure made available to applications as Core Services
Reuse of code Same Core Service used by many Self-Aware Applications or Services Encapsulation of specific mechanisms (one at a time)
[FMDMSM11]
Lyon November 2013
117
Giovanna Di Marzo Serugendo
Regional Leader Election The goal of this simulation is: To implement the Regional Leader Election example. To exploit the notion of BIO-CORE and Core Services.
In this simulation we will see: - Progressive building of disjoint groups
This simulation shows that: - How Core Services enacting basic mechanisms are implemented using universal eco-laws. - Core services can be requested on demand by applications or high-level services, by injecting LSAs, thus easing the design and reusing code. - How applications and high-level services can be performed by composing lower level services.
AWASS Summer School 13/06/2012
118
Giovanna Di Marzo Serugendo
Regional Leader Election createNewData(Evapo rate, value= random(0,100)
depositData(data )
getData() If noRole, data(Spread, leaderID) MEMBER
If noRole, value=0 LEADER
depositData(d ata)
createNewData(Spr ead,leaderID)
Lyon November 2013
119
Giovanna Di Marzo Serugendo
Regional Leader Election
Lyon November 2013
120
Giovanna Di Marzo Serugendo
Reaching an agreement
*!" )!" (!" '!" &!" %!" $!" #!" #" (" ##" #(" $#" $(" %#" %(" " &(" '#" '(" (#" ((" )#" )(" *#" *(" +#" +(" #!#" #!(" ###" ##(" #$#" #$("
!"
,-."
Lyon November 2013
121
/0--1"
Giovanna Di Marzo Serugendo
234-"
Reaching an agreement
Lyon November 2013
122
Giovanna Di Marzo Serugendo
BIO-CORE – Conclusions Advantages – Reuse of basic mechanisms for engineering self-organising systems. – Complex rules can be define at the level of the agent behaviour. – General propose. Pervasive system in general.
Disadvantages – Core’s services are fixed. It is not a good execution model for implementing low level behaviours. It is designed to grow vertically delegating on Core’s services. – Lack of adaptation to different environments when keeping a good performance.
Latest work – SAPERE middleware implements BIO-CORE execution model. – Optimization by using different implementation of the services, that are able to adapt to environmental changes and switching depending on contextual information. – Machine learning techniques for improving the adaptation in new environments. Lyon November 2013
123
Giovanna Di Marzo Serugendo
Separation of Concerns
Lyon November 2013
124
Giovanna Di Marzo Serugendo
Separation of Concerns Functionality vs Underlying mechanisms Functionality vs Non-functional aspects Self-management vs Control Delegate self-management to computing environment
Lyon November 2013
125
Giovanna Di Marzo Serugendo
Separation of concerns: Design
Engineering – Separation of concerns – Self-organising mechanisms provided as services
Lyon November 2013
126
Giovanna Di Marzo Serugendo
Separation of concerns: self-management vs control Self-Management A pa da ra pti m ng et er s
Hig h Pa Leve tter l ns
Chemotaxis Token Based
Frequency, Com. Rng
S alg witc or hin ith g m s
Co m Pa pose tter d ns
(Policies / QoS )
Gradients
Self-Management
Static Gradient Dynamic Gradient
Updating Frequency
A pa da ra pti m ng et er s
Spreading
S alg witc or hin ith g m s
Ba Pa sic tter ns
(Policies / QoS )
Pure Spreading
Self-Management Frequency
Probabilistic Spreading
Frequency, probability
Location-based Spreading ….
Frequency, Thresholds
Control
Lyon November 2013
127
Giovanna Di Marzo Serugendo
A pa da ra pti m ng et er s
Summary SAPERE infrastructure (middleware) – Chemical reactions – LSAs (dynamically updated data/meta-data)
Execution model – Bio-core
Separation of concerns
Lyon November 2013
128
Giovanna Di Marzo Serugendo
Outline Inspiration / Motivation Self-organising Mechanisms and Design Patterns Engineering / SAPERE project Case studies and Validation – Crowd Steering / Finding a friend / Best Artist – TheOne-SAPERE simulator – Deployment on tablets
Lyon November 2013
129
Giovanna Di Marzo Serugendo
Applications Agents Services Black Board CORE services Primitives
Music Festival Case Study: Single, Multiple Users Steering Publishing Events Best Artist Award
Lyon November 2013
130
Giovanna Di Marzo Serugendo
Music Festival Features: – Current centralised solutions are not scalable: It’s not possible to make calls, send messages, or have Internet connection. Mobile network overload
– High density of people, most of them bringing mobile phones or PDAs. – Open spaces: It eases the positioning (use of GPS)
Lyon November 2013
131
Giovanna Di Marzo Serugendo
Apps Requirements Crowd steering: – A user wants to find other users – A user wants to find a Point of Interest (PoI) – Emergency evacuation
Organisers want to publish events (without using centralised infrastructure): – – – –
Taxi or bus location Music Festival Agenda Emergency exits, toilets, bars, merchandising A bar owner wants to advert offers during the festival
Voting for Best Artist Lyon November 2013
132
Giovanna Di Marzo Serugendo
General assumptions People carry mobile phone with the SAPERE middleware running. Public displays and PoI also run the SAPERE middleware. GPS information may be available. At the entrance of the music festival, all devices are registered and the music festival SAPERE application is installed. PoI can appear and disappear PoI can be moving.
Lyon November 2013
133
Giovanna Di Marzo Serugendo
Find a Friend / PoI Involved services – Gradient – Chemotaxis
Algorithm. – Agent A injects a Gradient LSA providing the other user ID (i.e. Agent B) and requesting the position information. – Information is propagated and aggregated (to keep the min hop counter at each node). – When information arrives to Agent B’s node, agent B is notified. In case B accepts to share his position, the position is sent back following the gradient (Chemotaxis) to agent A’s node.
Lyon November 2013
134
Giovanna Di Marzo Serugendo
Find a Friend / PoI
Agent A
Agent B
remoteQuery("userB", position, userA) Remote Query and Retrieval Service
Remote Query and Retrieval Service
injectLSA("Gradient", subDescription("userB", position?), Chemo)
injectLSA(chemo?)
LSA Space
LSA Space
LSA_1
Lyon November 2013
Network
135
LSA_1
Giovanna Di Marzo Serugendo
Find a Friend / PoI
0
3 1
2
5 3
3
2 3
Lyon November 2013
4 5
136
Giovanna Di Marzo Serugendo
Find a Friend / PoI
User: John78
Dist = 200m
Lyon November 2013
137
Giovanna Di Marzo Serugendo
Single/Group User Steering
Lyon November 2013
13 8
Giovanna Di Marzo Serugendo
Emergency Evacuation Assumptions – Emergency Exits (EE) are provided with a communication device (e.g. a mobile phone). – The EE devices know about the number of people using the exit by counting the number of connections.
Involved services – Gradient service
Algorithm – EE devices inject a Gradient LSA with information about the density of nodes in the exits. – Gradient information is used by mobile phones and public displays to show the closed exit. – At each node gradients are aggregated taking into account the density of nodes at each exits, thus, balancing the number of people steered to the exits.
Lyon November 2013
139
Giovanna Di Marzo Serugendo
Emergency Evacuation
Lyon November 2013
14 0
Giovanna Di Marzo Serugendo
Publish Events Involved services – Propagation
Algorithm – An organiser injects a Spread LSA containing the new information. – Information is propagated among the nodes. – At each node local information is updated.
Lyon November 2013
141
Giovanna Di Marzo Serugendo
Best artist award / Voting The organisers want people to vote about the best artist in the festival. Involved Services: – Gossip Service (Propagation and aggregation)
Similar to Reaching an Agreement
Lyon November 2013
142
Giovanna Di Marzo Serugendo
Best artist award / Voting
Best Artist? Best Artist? 0 3 Best Artist? Best Artist? 1 2 Best Artist? 3 Best Artist? Best Artist? Best Artist? 3 2 4 Best Artist? 3
Lyon November 2013
143
Best Artist? 5
Giovanna Di Marzo Serugendo
Best Artist? 5
Validation: Simulation and Implementation in real devices
Lyon November 2013
144
Giovanna Di Marzo Serugendo
Simulation – TheOne-SAPERE The ONE is a simulation environment that is capable of: – Generating node movement using different movement models – Using real Google maps – Importing mobility data from real traces – Creating simulations with different types of nodes (e.g. people, cars, public displays,etc..) – Assigning more than one communication interface per each device (e.g. Bluetooth, wi-fi, etc..) – Networking metrics – Reporting quality of the network (e.g. Message delivered, dropped, etc..)
Lyon November 2013
145
Giovanna Di Marzo Serugendo
TheOne-Sapere SAPERE middleware on top of The One simulation, helps us to: – Validate the current actual version of the middleware in large scale system. – Get easily performance metrics (e.g. analysing the number of LSAs in the system, and the bandwidth consumption). – Validate external libraries before their real implementation in the SAPERE middleware. – Evaluate the feasibility of the SAPERE middleware running on a large scale distributed environment composed of many types of devices. (i.e. to simulate real case scenario, in a very accurate way)
Lyon November 2013
146
Giovanna Di Marzo Serugendo
Simulation – The OneSAPERE
Lyon November 2013
147
Giovanna Di Marzo Serugendo
Implementation using tablets
http://cui.unige.ch/~deangeli/SasoDemo2013.mp4 Lyon November 2013
148
Giovanna Di Marzo Serugendo
Chat using SAPERE
http://cui.unige.ch/~deangeli/videoChat.mp4 Lyon November 2013
14 9
Giovanna Di Marzo Serugendo
Conclusions and future work Hardware limitations – Problem with multiple connections – Collisions, network overload – Power consumption
Continuous adaptability – Contextual information
Self-Optimisation Controlling emergent behaviours Downloads: www.sapere-project.eu/downloads
Lyon November 2013
15 0
Giovanna Di Marzo Serugendo
Bio-Inspired self-organising systems -- Discussion What do biological self-organising systems provide to computer science? What are the open issues? What are we expecting from bio-inspired self-organising system at short and long term?
Lyon November 2013
151
Giovanna Di Marzo Serugendo
Bibliography [FMDMSM+12] Jose Luis Fernandez-Marquez, Giovanna Di Marzo Serugendo, Sara Montagna, Mirko Viroli, and Josep Lluis Arcos. Description and composition of bio-inspired design patterns: a complete overview. Natural Computing Journal, 2012. [FMDMSM11] Jose Luis Fernandez-Marquez, Giovanna Di Marzo Serurendo, and Sara Montagna. Biocore: Bio-inspired self-organising mechanisms core. In 6th International ICST Conference on BioInspired Models of Network, Information, and Computing Systems (Bionetics), December 2011. [MVR+11] Sara Montagna, Mirko Viroli, Matteo Risoldi, Danilo Pianini, and Giovanna Di Marzo Serugendo. Self-organising pervasive ecosystems: A crowd evacuation example. In Proceedings of the 3rd International Workshop on Software Engineering for Resilient Systems, volume 6968 of Lecture Notes in Computer Science, pages 115-129. Springer-Verlag, 2011. [TRGDM11] Akla-Esso Tchao, Matteo Risoldi, and Giovanna Giovanna Di Marzo. Modelling self-* systems using chemically inspired composable patterns. In IEEE Self-Adaptive and Self-Organising Systems Conference (SASO'2011), pages 109-118, 2011. [FMADMS+11] Jose Luis Fernandez-Marquez, Josep Lluis Arcos, Giovanna Di Marzo Serugendo, Mirko Viroli, and Montagna Sara. Description and composition of bio-inspired design patterns: The gradient case. In Workshop on Bio-Inspired and Self-* Algorithms for Distributed Systems (BADS'2011), pages 25-32. ACM, 2011. [FMADMSC11] Jose Luis Fernandez-Marquez, Josep Lluis Arcos, Giovanna Di Marzo Serugendo, and Matteo Casadei. Description and composition of bio-inspired design patterns: the gossip case. In Proc. of the Int.Conf. on Engineering of Autonomic and Autonomous Systems (EASE'2011), pages 87-96. IEEE Computer Society, 2011.
Lyon November 2013
152
Giovanna Di Marzo Serugendo
Bibliography [CTSC+2003] Christian Tschudin: "Fraglets - a Metabolistic Execution Model for Communication Protocols", Proc. 2nd Annual Symposium on Autonomous Intelligent Networks and Systems (AINS), Menlo Park, USA, Jul 2003. [LYAMA1+2005] Lidia Yamamoto, Christian Tschudin: "Experiments on the Automatic Evolution of Protocols using Genetic Programming", to appear in Proc. 2nd IFIP Workshop on Autonomic Communication (WAC 2005), Athens, Greece, October 2005. Extended version in Univ. Basel Tech. Report CS-2005-002, April 2005. [LYAMA2+2005] Lidia Yamamoto, Christian Tschudin: "Genetic Evolution of Protocol Implementations and Configurations", Proc. IFIP/IEEE International Workshop on Self-Managed Systems & Services (SelfMan'05), May 2005, Nice, France. [FDR+2009] F. Dressler, I. Dietrich, R. German, and B. Kr¨uger, “A rule-based system for programming self-organized sensor and actor networks,” Comput. Netw., vol. 53, pp. 1737–1750, 2009. [FZAM2011] F. Zambonelli, G. Castelli, L. Ferrari, M. Mamei, A. Rosi, G. Di Marzo, M. Risoldi, A.-E. Tchao, S. Dobson, G. Stevenson, J. Ye, E. Nardini, A. Omicini, S. Montagna, M. Viroli, A. Ferscha, S. Maschek, B. Wally, "Self-aware Pervasive Service Ecosystems", The European Future Technologies Conference and Exhibition 2011, Procedia Computer Science, 7: 197-199, 2011.
Lyon November 2013
153
Giovanna Di Marzo Serugendo
Thank you! Giovanna Di Marzo Serugendo Jose-Luis Fernandez-Marquez University of Geneva
[email protected] [email protected]
Lyon November 2013
154
Giovanna Di Marzo Serugendo