engineering computational ecosystems (2nd year phd seminar)

83
2nd year Ph.D. Seminar Engineering Computational Ecosystems Danilo Pianini – [email protected] Supervisor: prof. Mirko Viroli Alma Mater Studiorum—Universit` a di Bologna June 7, 2013 Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 1 / 78

Upload: danilo-pianini

Post on 06-May-2015

7.671 views

Category:

Technology


1 download

DESCRIPTION

This tutorial will introduce the research field of pervasive computing, with particular focus on spatial computing and pervasive ecosystems. It will show the applicative domain with a focus on pervasive displays, analysing the main challenges such systems present to software engineers. It will also show how relevant is the role of the simulation and properties checking in this area, in which a complete system deployment prior to release is almost impossible.

TRANSCRIPT

Page 1: Engineering computational ecosystems (2nd year PhD seminar)

2nd year Ph.D. Seminar

Engineering Computational Ecosystems

Danilo Pianini – [email protected]

Supervisor: prof. Mirko Viroli

Alma Mater Studiorum—Universita di Bologna

June 7, 2013

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 1 / 78

Page 2: Engineering computational ecosystems (2nd year PhD seminar)

Outline Every living creature on this earth dies alone.

1 Pervasive Computing(Near) Future city scenario(Near) Future devicesPervasive displaysCase studies

2 Pervasive EcosystemsCloud or pervasive?Self-organising spatial data structures

3 Engineering Pervasive EcosystemsAnticipative adaptationThe SAPERE EU ProjectAlchemistSimulations and demos

4 Open issuesProgramming the emergenceReal-world setup

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 2 / 78

Page 3: Engineering computational ecosystems (2nd year PhD seminar)

Pervasive Computing

Outline

1 Pervasive Computing(Near) Future city scenario(Near) Future devicesPervasive displaysCase studies

2 Pervasive EcosystemsCloud or pervasive?Self-organising spatial data structures

3 Engineering Pervasive EcosystemsAnticipative adaptationThe SAPERE EU ProjectAlchemistSimulations and demos

4 Open issuesProgramming the emergenceReal-world setup

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 3 / 78

Page 4: Engineering computational ecosystems (2nd year PhD seminar)

Pervasive Computing (Near) Future city scenario

Outline

1 Pervasive Computing(Near) Future city scenario(Near) Future devicesPervasive displaysCase studies

2 Pervasive EcosystemsCloud or pervasive?Self-organising spatial data structures

3 Engineering Pervasive EcosystemsAnticipative adaptationThe SAPERE EU ProjectAlchemistSimulations and demos

4 Open issuesProgramming the emergenceReal-world setup

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 4 / 78

Page 5: Engineering computational ecosystems (2nd year PhD seminar)

Pervasive Computing (Near) Future city scenario

Shibuya Crossing

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 5 / 78

Page 6: Engineering computational ecosystems (2nd year PhD seminar)

Pervasive Computing (Near) Future city scenario

People

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 6 / 78

Page 7: Engineering computational ecosystems (2nd year PhD seminar)

Pervasive Computing (Near) Future city scenario

(Near) Future city scenario

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 7 / 78

Page 8: Engineering computational ecosystems (2nd year PhD seminar)

Pervasive Computing (Near) Future city scenario

(Near) Future city scenario

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 8 / 78

Page 9: Engineering computational ecosystems (2nd year PhD seminar)

Pervasive Computing (Near) Future devices

Outline

1 Pervasive Computing(Near) Future city scenario(Near) Future devicesPervasive displaysCase studies

2 Pervasive EcosystemsCloud or pervasive?Self-organising spatial data structures

3 Engineering Pervasive EcosystemsAnticipative adaptationThe SAPERE EU ProjectAlchemistSimulations and demos

4 Open issuesProgramming the emergenceReal-world setup

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 9 / 78

Page 10: Engineering computational ecosystems (2nd year PhD seminar)

Pervasive Computing (Near) Future devices

Ready-to-use devices

Images courtesy of Alois Ferscha (Pervasive Computing Group, Johannes Kepler Universitat Linz)

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 10 / 78

Page 11: Engineering computational ecosystems (2nd year PhD seminar)

Pervasive Computing (Near) Future devices

Almost ready devices

Images courtesy of Alois Ferscha (Pervasive Computing Group, Johannes Kepler Universitat Linz)

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 11 / 78

Page 12: Engineering computational ecosystems (2nd year PhD seminar)

Pervasive Computing (Near) Future devices

Almost ready devices

Images courtesy of Alois Ferscha (Pervasive Computing Group, Johannes Kepler Universitat Linz)

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 11 / 78

Page 13: Engineering computational ecosystems (2nd year PhD seminar)

Pervasive Computing (Near) Future devices

Almost ready devices

Images courtesy of Alois Ferscha (Pervasive Computing Group, Johannes Kepler Universitat Linz)

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 11 / 78

Page 14: Engineering computational ecosystems (2nd year PhD seminar)

Pervasive Computing (Near) Future devices

Maybe in few decades...

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 12 / 78

Page 15: Engineering computational ecosystems (2nd year PhD seminar)

Pervasive Computing Pervasive displays

Outline

1 Pervasive Computing(Near) Future city scenario(Near) Future devicesPervasive displaysCase studies

2 Pervasive EcosystemsCloud or pervasive?Self-organising spatial data structures

3 Engineering Pervasive EcosystemsAnticipative adaptationThe SAPERE EU ProjectAlchemistSimulations and demos

4 Open issuesProgramming the emergenceReal-world setup

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 13 / 78

Page 16: Engineering computational ecosystems (2nd year PhD seminar)

Pervasive Computing Pervasive displays

More and more pervasive inside

Image courtesy of Alois Ferscha (Pervasive Computing Group, Johannes Kepler Universitat Linz)

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 14 / 78

Page 17: Engineering computational ecosystems (2nd year PhD seminar)

Pervasive Computing Pervasive displays

More and more pervasive outside

Image courtesy of Alois Ferscha (Pervasive Computing Group, Johannes Kepler Universitat Linz)

. . . . . . .

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 15 / 78

Page 18: Engineering computational ecosystems (2nd year PhD seminar)

Pervasive Computing Case studies

Outline

1 Pervasive Computing(Near) Future city scenario(Near) Future devicesPervasive displaysCase studies

2 Pervasive EcosystemsCloud or pervasive?Self-organising spatial data structures

3 Engineering Pervasive EcosystemsAnticipative adaptationThe SAPERE EU ProjectAlchemistSimulations and demos

4 Open issuesProgramming the emergenceReal-world setup

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 16 / 78

Page 19: Engineering computational ecosystems (2nd year PhD seminar)

Pervasive Computing Case studies

Pervasive displays: multiple view

Image courtesy of Alois Ferscha (Pervasive Computing Group, Johannes Kepler Universitat Linz)

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 17 / 78

Page 20: Engineering computational ecosystems (2nd year PhD seminar)

Pervasive Computing Case studies

Pervasive displays: local sharing

Image courtesy of Alois Ferscha (Pervasive Computing Group, Johannes Kepler Universitat Linz)

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 18 / 78

Page 21: Engineering computational ecosystems (2nd year PhD seminar)

Pervasive Computing Case studies

Pervasive displays: steering

Image courtesy of Alois Ferscha (Pervasive Computing Group, Johannes Kepler Universitat Linz)

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 19 / 78

Page 22: Engineering computational ecosystems (2nd year PhD seminar)

Pervasive Computing Case studies

Pervasive displays: crowd steering

Image courtesy of Alois Ferscha (Pervasive Computing Group, Johannes Kepler Universitat Linz)

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 20 / 78

Page 23: Engineering computational ecosystems (2nd year PhD seminar)

Pervasive Computing Case studies

Some interesting services and features

Display must adapt to people behaviour

Displays show information based on majority of people around

Alerts are shown as a given person passes nearby

Content redirected from smartphone to display

Adjacent displays show a common, bigger content

Displays coordinate to avoid irritating users

Displays coordinate to provide visualisation streams

Public displays sharedly used by friends to interact

Using eye-glasses for immersed interaction

People may change their behaviour because of that

Single User Steering via Public Displays

Crowd Balancing

Evacuation

Adaptive Advertisement

Collective Guidance

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 21 / 78

Page 24: Engineering computational ecosystems (2nd year PhD seminar)

Pervasive Ecosystems

Outline

1 Pervasive Computing(Near) Future city scenario(Near) Future devicesPervasive displaysCase studies

2 Pervasive EcosystemsCloud or pervasive?Self-organising spatial data structures

3 Engineering Pervasive EcosystemsAnticipative adaptationThe SAPERE EU ProjectAlchemistSimulations and demos

4 Open issuesProgramming the emergenceReal-world setup

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 22 / 78

Page 25: Engineering computational ecosystems (2nd year PhD seminar)

Pervasive Ecosystems Cloud or pervasive?

Outline

1 Pervasive Computing(Near) Future city scenario(Near) Future devicesPervasive displaysCase studies

2 Pervasive EcosystemsCloud or pervasive?Self-organising spatial data structures

3 Engineering Pervasive EcosystemsAnticipative adaptationThe SAPERE EU ProjectAlchemistSimulations and demos

4 Open issuesProgramming the emergenceReal-world setup

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 23 / 78

Page 26: Engineering computational ecosystems (2nd year PhD seminar)

Pervasive Ecosystems Cloud or pervasive?

A standard, centralised SOA solution – cloud oriented

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 24 / 78

Page 27: Engineering computational ecosystems (2nd year PhD seminar)

Pervasive Ecosystems Cloud or pervasive?

A standard, centralised SOA solution

A centralised solution

One service (typically in the cloud) for:

Discovery: what components are available in the system?

Context: where are components? (behaviour specialisation)

Orchestration: coordinating components

Data storage: depositing/retrieving data

Adaptation: reacting to contingencies

All components interact through such middleware services

Does it scale well?

Can displays promptly react?

Can we store streams of sensor data in the cloud?

What about privacy?

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 25 / 78

Page 28: Engineering computational ecosystems (2nd year PhD seminar)

Pervasive Ecosystems Cloud or pervasive?

Eco-inspired SOA solution

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 26 / 78

Page 29: Engineering computational ecosystems (2nd year PhD seminar)

Pervasive Ecosystems Cloud or pervasive?

Eco-inspired SOA solution

Fully decentralised middleware services

Locations become very small and form a huge dynamic set

Contextualisation, discovery, and orchestration almost vanish

Middleware service just as a single space distributed on all nodes

In overall we have a network of spaces with service “tags”

Adaptation is achieved by simple rules combining tags

Drawing a bridge with natural ecosystems

We have a set of spatially situated entities interacting according towell-defined set of natural laws enforced by the spatial environment inwhich they situate, and adaptively self-organizing their interactiondynamics according to their shape and structure[Zambonelli and Viroli, 2011]

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 27 / 78

Page 30: Engineering computational ecosystems (2nd year PhD seminar)

Pervasive Ecosystems Cloud or pervasive?

Towards a computational continuum

A pervasive (eco)system:

is composed of myriads of devices (nodes)

contains devices located in space and time

has a notion of “node density”

As such, it is similar to particle systems, and the higher the density, themore this system approximates a spatio-temporal computationalcontinuum.

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 28 / 78

Page 31: Engineering computational ecosystems (2nd year PhD seminar)

Pervasive Ecosystems Self-organising spatial data structures

Outline

1 Pervasive Computing(Near) Future city scenario(Near) Future devicesPervasive displaysCase studies

2 Pervasive EcosystemsCloud or pervasive?Self-organising spatial data structures

3 Engineering Pervasive EcosystemsAnticipative adaptationThe SAPERE EU ProjectAlchemistSimulations and demos

4 Open issuesProgramming the emergenceReal-world setup

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 29 / 78

Page 32: Engineering computational ecosystems (2nd year PhD seminar)

Pervasive Ecosystems Self-organising spatial data structures

Computational fields

A way to engineer self-organising applications in different scenarios

Sensor networks (aggregating/diffusing data)[Beal and Bachrach, 2006]

Swarm and modular robotics (cooperative team work)[Bachrach et al., 2010]

Pervasive computing (crowd steering, coordinated visualisation)[Viroli et al., 2011]

Rough idea

Two simple rules for creating a spatial structure:

1 Diffuse spatial enriched information among neighbours

2 Aggregate the information received by neighbours considering thespatial information

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 30 / 78

Page 33: Engineering computational ecosystems (2nd year PhD seminar)

Pervasive Ecosystems Self-organising spatial data structures

A 3D rendering of a uniform gradient structure

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 31 / 78

Page 34: Engineering computational ecosystems (2nd year PhD seminar)

Pervasive Ecosystems Self-organising spatial data structures

Towards a library of gradient-based computational fields

Gradient (discrete, flat continuous, structured continuous)

Other structures (channel, shrinking crown, sector, partition, shadow, . . . )

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 32 / 78

Page 35: Engineering computational ecosystems (2nd year PhD seminar)

Pervasive Ecosystems Self-organising spatial data structures

Towards a library of gradient-based computational fields

Gradient (discrete, flat continuous, structured continuous)

Other structures (channel, shrinking crown, sector, partition, shadow, . . . )

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 32 / 78

Page 36: Engineering computational ecosystems (2nd year PhD seminar)

Pervasive Ecosystems Self-organising spatial data structures

Towards a library of gradient-based computational fields

Gradient (discrete, flat continuous, structured continuous)

Other structures (channel, shrinking crown, sector, partition, shadow, . . . )

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 32 / 78

Page 37: Engineering computational ecosystems (2nd year PhD seminar)

Pervasive Ecosystems Self-organising spatial data structures

Towards a library of gradient-based computational fields

Gradient (discrete, flat continuous, structured continuous)

Other structures (channel, shrinking crown, sector, partition, shadow, . . . )

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 32 / 78

Page 38: Engineering computational ecosystems (2nd year PhD seminar)

Pervasive Ecosystems Self-organising spatial data structures

Creating optimal (multi-)paths

Enable devices used to steering from a source to a target

Open issue: fields react to current event, but they do not provideanticipative adaptation.

If obstacles are dynamically added and moved

If there is knowledge about WHEN those events will happen

How to improve?

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 33 / 78

Page 39: Engineering computational ecosystems (2nd year PhD seminar)

Engineering Pervasive Ecosystems

Outline

1 Pervasive Computing(Near) Future city scenario(Near) Future devicesPervasive displaysCase studies

2 Pervasive EcosystemsCloud or pervasive?Self-organising spatial data structures

3 Engineering Pervasive EcosystemsAnticipative adaptationThe SAPERE EU ProjectAlchemistSimulations and demos

4 Open issuesProgramming the emergenceReal-world setup

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 34 / 78

Page 40: Engineering computational ecosystems (2nd year PhD seminar)

Engineering Pervasive Ecosystems Anticipative adaptation

Outline

1 Pervasive Computing(Near) Future city scenario(Near) Future devicesPervasive displaysCase studies

2 Pervasive EcosystemsCloud or pervasive?Self-organising spatial data structures

3 Engineering Pervasive EcosystemsAnticipative adaptationThe SAPERE EU ProjectAlchemistSimulations and demos

4 Open issuesProgramming the emergenceReal-world setup

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 35 / 78

Page 41: Engineering computational ecosystems (2nd year PhD seminar)

Engineering Pervasive Ecosystems Anticipative adaptation

When spatial gradient is not enough

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 36 / 78

Page 42: Engineering computational ecosystems (2nd year PhD seminar)

Engineering Pervasive Ecosystems Anticipative adaptation

When spatial gradient is not enough

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 37 / 78

Page 43: Engineering computational ecosystems (2nd year PhD seminar)

Engineering Pervasive Ecosystems Anticipative adaptation

When spatial gradient is not enough

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 38 / 78

Page 44: Engineering computational ecosystems (2nd year PhD seminar)

Engineering Pervasive Ecosystems Anticipative adaptation

When spatial gradient is not enough

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 39 / 78

Page 45: Engineering computational ecosystems (2nd year PhD seminar)

Engineering Pervasive Ecosystems Anticipative adaptation

When spatial gradient is not enough

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 40 / 78

Page 46: Engineering computational ecosystems (2nd year PhD seminar)

Engineering Pervasive Ecosystems Anticipative adaptation

Anticipative gradient [Montagna et al., 2012a]

Anticipative gradient merges three strategies to provide anticipativeadaptation: in case a future event is detected

In case a future event is on the optimal path, also store paths notpassing through it

If you are in an area in which, if you followed the gradient, you wouldhave to wait

Either circumvent (green) or proceed and wait (red)

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 41 / 78

Page 47: Engineering computational ecosystems (2nd year PhD seminar)

Engineering Pervasive Ecosystems The SAPERE EU Project

Outline

1 Pervasive Computing(Near) Future city scenario(Near) Future devicesPervasive displaysCase studies

2 Pervasive EcosystemsCloud or pervasive?Self-organising spatial data structures

3 Engineering Pervasive EcosystemsAnticipative adaptationThe SAPERE EU ProjectAlchemistSimulations and demos

4 Open issuesProgramming the emergenceReal-world setup

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 42 / 78

Page 48: Engineering computational ecosystems (2nd year PhD seminar)

Engineering Pervasive Ecosystems The SAPERE EU Project

The SAPERE Project

http://www.sapere-project.eu

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 43 / 78

Page 49: Engineering computational ecosystems (2nd year PhD seminar)

Engineering Pervasive Ecosystems The SAPERE EU Project

Eco-laws and Live Semantic Annotations

Live Semantic Annotations (LSA)

A unified description for devices, data, services

Is about interface, status, and behaviour of a component

It provides semantic information, and it is dynamic

Eco-Laws

They resemble chemical reactions

They take some reagent LSA, and provide some product LSA

They can diffuse an LSA in the neighborhood

They can aggregate LSAs like in chemical bonding

They form a small & fixed set of natural eco-laws

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 44 / 78

Page 50: Engineering computational ecosystems (2nd year PhD seminar)

Engineering Pervasive Ecosystems The SAPERE EU Project

Pervasive Ecosystems

LSA Space

LSA

LSALSA

LSA

eco-lawEngine

Software services

SAPERE Node

eco-law activation

SAPERENode

SAPERENode

SAPERENode

SAPERENode

SAPERENode

SAPERENode

SAPERENode

SAPERENode

SAPERENode

SAPERENode

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 45 / 78

Page 51: Engineering computational ecosystems (2nd year PhD seminar)

Engineering Pervasive Ecosystems Alchemist

Outline

1 Pervasive Computing(Near) Future city scenario(Near) Future devicesPervasive displaysCase studies

2 Pervasive EcosystemsCloud or pervasive?Self-organising spatial data structures

3 Engineering Pervasive EcosystemsAnticipative adaptationThe SAPERE EU ProjectAlchemistSimulations and demos

4 Open issuesProgramming the emergenceReal-world setup

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 46 / 78

Page 52: Engineering computational ecosystems (2nd year PhD seminar)

Engineering Pervasive Ecosystems Alchemist

Computational ecosystems: functional guarantees

Houston, we’ve got a problem.

Prediction difficulties

Thousands-devices scale system

Autonomous devices

Interaction plays a huge role

Formal proof

Mathematical guarantee

Only tackles simple cases

Model checking

Space state explosion for non-trivial cases

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 47 / 78

Page 53: Engineering computational ecosystems (2nd year PhD seminar)

Engineering Pervasive Ecosystems Alchemist

Computational ecosystems: simulation

Open issue! How to simulate a (bio)chemical inspired computationalecosystem?

Classic ABM modelling

High flexibility

Topology as first-class abstraction

Dynamics explicitly modelled

No native support for CTMC model

Chemical inspired modelling

Natively CTMC

Very fast and reliable algorithms exist in literature

Very limited topology: multicompartment at best

Only classic reactions can change the world status: limited flexibility

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 48 / 78

Page 54: Engineering computational ecosystems (2nd year PhD seminar)

Engineering Pervasive Ecosystems Alchemist

Alchemist simulation approach [Pianini et al., 2013]

Base idea

Start from the existing work with stochastic chemical systemssimulation

Extend it as needed to reach desired flexibility

Goals

Full support for Continuous Time Markov Chains (CTMC)

Support for differently distributed events (e.g. Triggers)

Rich environments, with obstacles, mobile nodes, etc.

More expressive reactions

Fast and flexible SSA engine

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 49 / 78

Page 55: Engineering computational ecosystems (2nd year PhD seminar)

Engineering Pervasive Ecosystems Alchemist

Enriching the environment description

Environment

Node

Reactions

Molecules

Alchemist world

The Environment contains and links together Nodes

Each Node is programmed with a set of Reactions

Nodes contain Molecules

Each Molecule in a node is described with a ConcentrationDanilo Pianini (UniBo) Computational Ecosystems June 7, 2013 50 / 78

Page 56: Engineering computational ecosystems (2nd year PhD seminar)

Engineering Pervasive Ecosystems Alchemist

Extending the concept of reaction

From a set of reactants that combine themselves in a set of products to:

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

In Alchemist, every event is an occurrence of a Reaction

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 51 / 78

Page 57: Engineering computational ecosystems (2nd year PhD seminar)

Engineering Pervasive Ecosystems Alchemist

SSA Algorithms

Several SSA exist, they follow the same base schema [Gillespie, 1977]:

1 Select next reaction using markovian rates

2 Execute it

3 Update the rates which may have changed

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 52 / 78

Page 58: Engineering computational ecosystems (2nd year PhD seminar)

Engineering Pervasive Ecosystems Alchemist

Existing algorithms

Next Reaction [Gibson and Bruck, 2000]

1 Compute a putative execution time for each reaction

2 Store reactions in a binary heap

3 Pick the next reaction

4 Execute it

5 Compute putative times only for potentially involved reactions

6 Goto 3

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 53 / 78

Page 59: Engineering computational ecosystems (2nd year PhD seminar)

Engineering Pervasive Ecosystems Alchemist

Smart data structures ⇒ bleeding edge performances

2.04 4

3.71

7.32 1

5.51 0

2

8.91 0

4.20 0

9.10 0

10.10 0

inf0 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) timeWorst 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 reactionExtended with the concept of input and output context

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 54 / 78

Page 60: Engineering computational ecosystems (2nd year PhD seminar)

Engineering Pervasive Ecosystems Alchemist

Modular structure

Environment

User Interface

Alchemist language

Application-specific Alchemist Bytecode Compiler

Environment description in application-specific language

Incarnation-specific language

Reporting System

Interactive UI

Reaction Manager

Dependency Graph

Core Engine

Simulation Flow Language Parser

Environment Instantiator

XML Bytecode

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 55 / 78

Page 61: Engineering computational ecosystems (2nd year PhD seminar)

Engineering Pervasive Ecosystems Alchemist

Computational ecosystems: Alchemist

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 56 / 78

Page 62: Engineering computational ecosystems (2nd year PhD seminar)

Engineering Pervasive Ecosystems Alchemist

Some Features in short

Kinetic Monte Carlo engine

Parallelised engine

Mobility support

Dynamic connectivity support

Complex data items

Reaction-like programming

Parallel executor

Built-in approximate stochastic model checker

Alchemist2Blender

PVeStA integration

Built from scratch

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 57 / 78

Page 63: Engineering computational ecosystems (2nd year PhD seminar)

Engineering Pervasive Ecosystems Alchemist

Testbed

We realised the same crowd-steering application for both Alchemistand RePast, in order to evaluate the performance gap (if any)

Source code for RePast and standalone Alchemist applicationavailable athttp://www.apice.unibo.it/xwiki/bin/view/Alchemist/JOS

We choose a simplified use case which allows simulation in RePastwithout any change in its engine

This actually cripples out the most important Alchemist optimizationfor complex environment (the dependency graph)

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 58 / 78

Page 64: Engineering computational ecosystems (2nd year PhD seminar)

Engineering Pervasive Ecosystems Alchemist

Results

0

50

100

150

200

250

300

350

400

450

500

50 100 150 200 250 300 350 400 450 500

Exe

cuti

on t

ime [

s]

Number of agents

Performance comparison with Repast

Repast Alchemist

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 59 / 78

Page 65: Engineering computational ecosystems (2nd year PhD seminar)

Engineering Pervasive Ecosystems Simulations and demos

Outline

1 Pervasive Computing(Near) Future city scenario(Near) Future devicesPervasive displaysCase studies

2 Pervasive EcosystemsCloud or pervasive?Self-organising spatial data structures

3 Engineering Pervasive EcosystemsAnticipative adaptationThe SAPERE EU ProjectAlchemistSimulations and demos

4 Open issuesProgramming the emergenceReal-world setup

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 60 / 78

Page 66: Engineering computational ecosystems (2nd year PhD seminar)

Engineering Pervasive Ecosystems Simulations and demos

Crowd evacuation

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 61 / 78

Page 67: Engineering computational ecosystems (2nd year PhD seminar)

Engineering Pervasive Ecosystems Simulations and demos

Crowd steering

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 62 / 78

Page 68: Engineering computational ecosystems (2nd year PhD seminar)

Engineering Pervasive Ecosystems Simulations and demos

Crowd steering with anticipative adaptation

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 63 / 78

Page 69: Engineering computational ecosystems (2nd year PhD seminar)

Engineering Pervasive Ecosystems Simulations and demos

Realistic pedestrians

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 64 / 78

Page 70: Engineering computational ecosystems (2nd year PhD seminar)

Engineering Pervasive Ecosystems Simulations and demos

Morphogenesis

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 65 / 78

Page 71: Engineering computational ecosystems (2nd year PhD seminar)

Engineering Pervasive Ecosystems Simulations and demos

Morphogenesis [Montagna et al., 2012b]

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 66 / 78

Page 72: Engineering computational ecosystems (2nd year PhD seminar)

Open issues

Outline

1 Pervasive Computing(Near) Future city scenario(Near) Future devicesPervasive displaysCase studies

2 Pervasive EcosystemsCloud or pervasive?Self-organising spatial data structures

3 Engineering Pervasive EcosystemsAnticipative adaptationThe SAPERE EU ProjectAlchemistSimulations and demos

4 Open issuesProgramming the emergenceReal-world setup

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 67 / 78

Page 73: Engineering computational ecosystems (2nd year PhD seminar)

Open issues Programming the emergence

Outline

1 Pervasive Computing(Near) Future city scenario(Near) Future devicesPervasive displaysCase studies

2 Pervasive EcosystemsCloud or pervasive?Self-organising spatial data structures

3 Engineering Pervasive EcosystemsAnticipative adaptationThe SAPERE EU ProjectAlchemistSimulations and demos

4 Open issuesProgramming the emergenceReal-world setup

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 68 / 78

Page 74: Engineering computational ecosystems (2nd year PhD seminar)

Open issues Programming the emergence

Abstraction level

We can not (yet) program the emergence.

Chemical-inspired rules are powerful, but hard to control

Interactions among zilions of possibly mobile nodes may exposeunpredicted situations

We would like to express a spatial pattern, and automatically get thesingle node program

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 69 / 78

Page 75: Engineering computational ecosystems (2nd year PhD seminar)

Open issues Programming the emergence

Simulator improvement

Functional guarantees prior-to-deployment: large scale realistic simulations

Real life data (e.g. from Wien marathon)

Realistic environment (e.g. from Google Maps)

Realistic human behaviour (already partially there)

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 70 / 78

Page 76: Engineering computational ecosystems (2nd year PhD seminar)

Open issues Real-world setup

Outline

1 Pervasive Computing(Near) Future city scenario(Near) Future devicesPervasive displaysCase studies

2 Pervasive EcosystemsCloud or pervasive?Self-organising spatial data structures

3 Engineering Pervasive EcosystemsAnticipative adaptationThe SAPERE EU ProjectAlchemistSimulations and demos

4 Open issuesProgramming the emergenceReal-world setup

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 71 / 78

Page 77: Engineering computational ecosystems (2nd year PhD seminar)

Open issues Real-world setup

Communication

P2P Communication issues

Bluetooth: tight bandwidth, slow device detection

ZigBee: sensor oriented, not enough diffused

WiFi: difference between master mode and “normal” mode

Near Field Communication: too Near!

Wifi direct: we need to deepen

What do you suggest?

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 72 / 78

Page 78: Engineering computational ecosystems (2nd year PhD seminar)

Open issues Real-world setup

Localisation and orientation

Outdoor

GPS: very good

Computer vision: good if the seeing node knows where it is

Latitude API: Android only, mixes 3G, WiFi, GPS and onboardmagnetometer. Very good

Indoor

GPS: useless within buildings

Computer vision: good if the seeing node knows where it is

Latitude API: Inaccurate, but promising

Signal power (Bluetooth, WiFi): Almost useless

Ultra Wide Band: extremely promising, but requires specific setup

Resonant coupling [Pirkl and Lukowicz, 2012]: promising!

Ideas?Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 73 / 78

Page 79: Engineering computational ecosystems (2nd year PhD seminar)

Open issues Real-world setup

Other issues

Identification

Relation between devices and userDevice identification: addresses, idsUser identification: computer vision, explicit login

Privacy

Security

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 74 / 78

Page 80: Engineering computational ecosystems (2nd year PhD seminar)

Open issues Real-world setup

Bibliography I

Bachrach, J., Beal, J., and McLurkin, J. (2010).Composable continuous-space programs for robotic swarms.Neural Computing and Applications, 19(6).

Beal, J. and Bachrach, J. (2006).Infrastructure for engineered emergence on sensor/actuator networks.IEEE Intelligent Systems, 21(2):10–19.

Gibson, M. A. and Bruck, J. (2000).Efficient Exact Stochastic Simulation of Chemical Systems with ManySpecies and Many Channels.The Journal of Physical Chemistry A, 104(9):1876–1889.

Gillespie, D. T. (1977).Exact stochastic simulation of coupled chemical reactions.Journal of Physical Chemistry, 81(25):2340–2361.

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 75 / 78

Page 81: Engineering computational ecosystems (2nd year PhD seminar)

Open issues Real-world setup

Bibliography II

Montagna, S., Pianini, D., and Viroli, M. (2012a).Gradient-based self-organisation patterns of anticipative adaptation.In Proceedings of 6th IEEE International Conference on Self-Adaptiveand Self-Organizing Systems (SASO 2012), pages 169–174.

Montagna, S., Pianini, D., and Viroli, M. (2012b).A model for drosophila melanogaster development from a single cell tostripe pattern formation.In Shin, D., Hung, C.-C., and Hong, J., editors, Proceedings of the27th Annual ACM Symposium on Applied Computing (SAC 2012),pages 1406–1412, Riva del Garda (Trento), Italy. ACM.

Pianini, D., Montagna, S., and Viroli, M. (2013).Chemical-oriented simulation of computational systems withAlchemist.Journal of Simulation.

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 76 / 78

Page 82: Engineering computational ecosystems (2nd year PhD seminar)

Open issues Real-world setup

Bibliography III

Pirkl, G. and Lukowicz, P. (2012).Robust, low cost indoor positioning using magnetic resonant coupling.In UbiComp, pages 431–440.

Viroli, M., Casadei, M., Montagna, S., and Zambonelli, F. (2011).Spatial coordination of pervasive services through chemical-inspiredtuple spaces.ACM Transactions on Autonomous and Adaptive Systems, 6(2):14:1 –14:24.

Zambonelli, F. and Viroli, M. (2011).A survey on nature-inspired metaphors for pervasive serviceecosystems.International Journal of Pervasive Computing and Communications,7(3):186–204.

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 77 / 78

Page 83: Engineering computational ecosystems (2nd year PhD seminar)

SAPERE Self-aware Pervasive Service Ecosystems

Engineering Computational Ecosystems

Danilo Pianini – [email protected]

Supervisor: prof. Mirko Viroli

Alma Mater Studiorum—Universita di Bologna

June 7, 2013

Danilo Pianini (UniBo) Computational Ecosystems June 7, 2013 78 / 78