Danilo Pianini, Mirko Viroli, Roberto Casadei
Throw everything at the cloud, and let it process it
...somehowRely on opportunistic communication
write software with nature inspirationsomething as small as the flutter of a butterfly’s wing can ultimately cause a typhoon halfway around the world
Basically the foundation of
simple behavioural and communicational rules, global effects
simple local behaviours
↓↓↓
complex global behaviour
effects reified on different scales
emergent behaviour is difficult to forecast
simple behavioural and communicational rules, global effects
↓↓↓
small mistakes, global consequences
nature can bet on numbers, we can't.
devices
logical network
each device holds some values
interpret such values as a field in space-time
(computational field)
↑↑↑ Compute on these things ↑↑↑
straightforward mapping to functional languages
↓Nice place to work↓
Reusable aggregate library
Self-stabilizing blocks
Language primitives
Interpreter
Device abstraction (sensors, actuators)
Underlying platform (cloud? actors? LoRaWAN?)red means overcrowding
import ...
// A field counting people around each point in space
def countNearby(range) {
let human = rep(h <- env.has("human")) { h };
sumHood PlusSelf(
mux(human && nbrRange() < range) { 1 } else { 0 })
}
actual code from Modelling and simulation of Opportunistic IoT Services with Aggregate Computing
import ...
// A field estimating people density in an area
def densityEst(p, range, w) {
countNearby(range) / (p * pi * range ^ 2 * w)
}
(actual code from Modelling and simulation of Opportunistic IoT Services with Aggregate Computing)
import ...
// A field of boolean, true if the area is overcrowded
def dangerousDensity(p, range, dangerousDensity, groupSize, w) {
let partition = S(range, nbrRange);
let localDensity = densityEst(p, range, w);
let avg = summarize(partition, sum, localDensity, 0)
/ summarize(partition, sum, 1, 0);
let count = summarize(partition, sum, 1 / p, 0);
avg > dangerousDensity && count > groupSize
}
(actual code from Modelling and simulation of Opportunistic IoT Services with Aggregate Computing)
import ...
/* A field that partitions space in safe, overcrowded,
and overcrowding areas, given a certain time window */
def crowdTracking(p, range, w, maxDense,
dangerThr, groupSize, time) {
if (isRecentEvent(densityEst(p, range, w) > maxDense, time)) {
if (dangerousDensity(p, range, dangerThr, groupSize, w)) {
overcrowded()
} else { atRisk() }
} else { none() }
}
// Application code: crowd density tracking in a 60s window
crowdTracking(0.005, 30, 0.25, 1.08, 2.17, 300, 60);
(actual code from Modelling and simulation of Opportunistic IoT Services with Aggregate Computing)
Computation may happen:
No magic, deployment-specific complexity is simply incapsulated under the hood
divide et impera
nope
abstraction raised by hiding networking and protocols
enabling technology for projects dealing with the Internet of Things and Smart Cities
A tutorial for learning Protelis is available
Scafi is better learned by reading a paper (for now)