62
Spatial Computing for Networked Collaboration Jacob Beal May, 2010

Spatial Computing for Networked Collaboration · LDP/MELD (CMU Claytronics group) ... Advantages: powerful spatial ideas for that are good for inclusion in code libraries Disadvantages:

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Spatial Computing for Networked Collaboration · LDP/MELD (CMU Claytronics group) ... Advantages: powerful spatial ideas for that are good for inclusion in code libraries Disadvantages:

Spatial Computing for Networked Collaboration

Jacob BealMay, 2010

Page 2: Spatial Computing for Networked Collaboration · LDP/MELD (CMU Claytronics group) ... Advantages: powerful spatial ideas for that are good for inclusion in code libraries Disadvantages:

When you just don't have the infrastructure...

● Emergency response & disaster rescue● Developing nations & remote areas● … and many more

I need a med team!

We're on our way

Page 3: Spatial Computing for Networked Collaboration · LDP/MELD (CMU Claytronics group) ... Advantages: powerful spatial ideas for that are good for inclusion in code libraries Disadvantages:

Agenda

● Spatial Computing● Survey of Existing Approaches● Proto & Amorphous Medium

Page 4: Spatial Computing for Networked Collaboration · LDP/MELD (CMU Claytronics group) ... Advantages: powerful spatial ideas for that are good for inclusion in code libraries Disadvantages:

Networked devices are filling our environment...

Page 5: Spatial Computing for Networked Collaboration · LDP/MELD (CMU Claytronics group) ... Advantages: powerful spatial ideas for that are good for inclusion in code libraries Disadvantages:

Networked devices are filling our environment...

Page 6: Spatial Computing for Networked Collaboration · LDP/MELD (CMU Claytronics group) ... Advantages: powerful spatial ideas for that are good for inclusion in code libraries Disadvantages:

Networked devices are filling our environment...

How do we program aggregates robustly?

Page 7: Spatial Computing for Networked Collaboration · LDP/MELD (CMU Claytronics group) ... Advantages: powerful spatial ideas for that are good for inclusion in code libraries Disadvantages:

Spatial Computers

Robot Swarms Biological Computing

Modular RoboticsReconfigurable Computing

Sensor Networks

Cells during Morphogenesis

Page 8: Spatial Computing for Networked Collaboration · LDP/MELD (CMU Claytronics group) ... Advantages: powerful spatial ideas for that are good for inclusion in code libraries Disadvantages:

More formally...

● A spatial computer is a collection of computational devices distributed through a physical space in which:● the difficulty of moving information between any two

devices is strongly dependent on the distance between them, and

● the “functional goals” of the system are generally defined in terms of the system's spatial structure

Page 9: Spatial Computing for Networked Collaboration · LDP/MELD (CMU Claytronics group) ... Advantages: powerful spatial ideas for that are good for inclusion in code libraries Disadvantages:

More formally...

● A spatial computer is a collection of computational devices distributed through a physical space in which:● the difficulty of moving information between any two

devices is strongly dependent on the distance between them, and

● the “functional goals” of the system are generally defined in terms of the system's spatial structure

Notice the ambiguities in the definition

Page 10: Spatial Computing for Networked Collaboration · LDP/MELD (CMU Claytronics group) ... Advantages: powerful spatial ideas for that are good for inclusion in code libraries Disadvantages:

(w. Dan Yamins)

Graphs

Crystalline(e.g. CAs)

Amorphous/Continuous

Page 11: Spatial Computing for Networked Collaboration · LDP/MELD (CMU Claytronics group) ... Advantages: powerful spatial ideas for that are good for inclusion in code libraries Disadvantages:

(w. Dan Yamins)

Graphs

Crystalline(e.g. CAs)

Amorphous/Continuous

dens

ity

spac

e co

mpl

exi

tyjitter

grain size

Page 12: Spatial Computing for Networked Collaboration · LDP/MELD (CMU Claytronics group) ... Advantages: powerful spatial ideas for that are good for inclusion in code libraries Disadvantages:

(w. Dan Yamins)

Graphs

Crystalline(e.g. CAs)

Amorphous/Continuous

dens

ity

spac

e co

mpl

exi

tyjitter

grain size

spatial computing

Page 13: Spatial Computing for Networked Collaboration · LDP/MELD (CMU Claytronics group) ... Advantages: powerful spatial ideas for that are good for inclusion in code libraries Disadvantages:

Space/Network Duality

How well does the network cover space?

What space is covered well by the network?

Page 14: Spatial Computing for Networked Collaboration · LDP/MELD (CMU Claytronics group) ... Advantages: powerful spatial ideas for that are good for inclusion in code libraries Disadvantages:

Tentative Mathematical Definition

● A spatial computer is any set of n devices s.t. ● Graph {V,E} with edge weights w(v

1,v

2)

● Manifold M, with distance function d– M is compact, Riemannian (may be stronger than needed)

● Position function p: V → M

● w(v1,v

2) = O(1/d(p(v

1),p(v

2)))

Examples: unit disc network, chemical diffusion

Page 15: Spatial Computing for Networked Collaboration · LDP/MELD (CMU Claytronics group) ... Advantages: powerful spatial ideas for that are good for inclusion in code libraries Disadvantages:

I need a med team!

We're on our way

Example: Disaster Relief

Page 16: Spatial Computing for Networked Collaboration · LDP/MELD (CMU Claytronics group) ... Advantages: powerful spatial ideas for that are good for inclusion in code libraries Disadvantages:

Example: Museum Guide

I would like to see the Mona Lisa, avoiding the queues…I’ve gotten lost!

How can I rejoin my friends?

Page 17: Spatial Computing for Networked Collaboration · LDP/MELD (CMU Claytronics group) ... Advantages: powerful spatial ideas for that are good for inclusion in code libraries Disadvantages:

Example: Mobile Streaming

I want Alice to be able to listen in

on this great conversation

Page 18: Spatial Computing for Networked Collaboration · LDP/MELD (CMU Claytronics group) ... Advantages: powerful spatial ideas for that are good for inclusion in code libraries Disadvantages:

How can we program these?

● Desiderata for approaches:● Simple, easy to understand code● Robust to errors, adapt to changing environment● Scalable to potentially vast numbers of devices● Take advantage of spatial nature of problems

Page 19: Spatial Computing for Networked Collaboration · LDP/MELD (CMU Claytronics group) ... Advantages: powerful spatial ideas for that are good for inclusion in code libraries Disadvantages:

Agenda

● Spatial Computing● Survey of Existing Approaches● Proto & Amorphous Medium

Page 20: Spatial Computing for Networked Collaboration · LDP/MELD (CMU Claytronics group) ... Advantages: powerful spatial ideas for that are good for inclusion in code libraries Disadvantages:

A Taxonomy of Approaches

Spatial

DynamicsGeometry

Uniform Viral

Non-Spatial

Non-Composable

Page 21: Spatial Computing for Networked Collaboration · LDP/MELD (CMU Claytronics group) ... Advantages: powerful spatial ideas for that are good for inclusion in code libraries Disadvantages:

A Taxonomy of Approaches

Spatial

DynamicsGeometry

Uniform Viral

Non-Spatial

Non-Composable

Page 22: Spatial Computing for Networked Collaboration · LDP/MELD (CMU Claytronics group) ... Advantages: powerful spatial ideas for that are good for inclusion in code libraries Disadvantages:

Approaches from Local Dynamics

Primitives describe only actions between devices and the neighbors they communicate with.

● Advantages: coherent and correct semantics● Disadvantages: programmer must figure out

how to marshal local dynamics to produce coherent large-area programs

Page 23: Spatial Computing for Networked Collaboration · LDP/MELD (CMU Claytronics group) ... Advantages: powerful spatial ideas for that are good for inclusion in code libraries Disadvantages:

Proto: Computing with Fields

Beal & Bachrach

(def gradient (src) ...)(def distance (src dst) ...)(def dilate (src n) (<= (gradient src) n))(def channel (src dst width) (let* ((d (distance src dst)) (trail (<= (+ (gradient src) (gradient dst)) d))) (dilate trail width)))

neighborhood

device

DeviceKernel

evaluation

global to localcompilation

discreteapproximation

platformspecificity &optimization

Page 24: Spatial Computing for Networked Collaboration · LDP/MELD (CMU Claytronics group) ... Advantages: powerful spatial ideas for that are good for inclusion in code libraries Disadvantages:

Other Uniform Approaches

● LDP/MELD (CMU Claytronics group)● Distributed logic programs● Local resolution leads to long-distance properties

Page 25: Spatial Computing for Networked Collaboration · LDP/MELD (CMU Claytronics group) ... Advantages: powerful spatial ideas for that are good for inclusion in code libraries Disadvantages:

TOTA: Viral tuples

Page 26: Spatial Computing for Networked Collaboration · LDP/MELD (CMU Claytronics group) ... Advantages: powerful spatial ideas for that are good for inclusion in code libraries Disadvantages:

Other Viral Approaches

● Smart Messages (Borcea)● Execution migrates to nodes of interest, found via

self-routing code packets

● Paintable Computing (Butera)● Consistent transfer, view of neighbor data● Code for install, de-install, transfer-granted,

transfer-denied, update

● RGLL (Sutherland)● Code for arrival, tick, collision, departure● Communication via collision

Page 27: Spatial Computing for Networked Collaboration · LDP/MELD (CMU Claytronics group) ... Advantages: powerful spatial ideas for that are good for inclusion in code libraries Disadvantages:

Approaches from Geometry

Primitives describe large-scale geometric regions (e.g. “all devices on the left hill”)

● Advantages: coherent, easy to specify large-scale programs

● Disadvantages: generally easy to accidentally specify programs that cannot be executed correctly

Page 28: Spatial Computing for Networked Collaboration · LDP/MELD (CMU Claytronics group) ... Advantages: powerful spatial ideas for that are good for inclusion in code libraries Disadvantages:

MGS

Meristem formation Turing pattern on torus

Michel, Giavitto, Spicher

Page 29: Spatial Computing for Networked Collaboration · LDP/MELD (CMU Claytronics group) ... Advantages: powerful spatial ideas for that are good for inclusion in code libraries Disadvantages:

Regiment

● Streaming collection of data from regions● Spatial primitives:

– K-hop neighborhood– K-nearest nodes

● Composition:– Union/Intersection– Map/Filter

● Distributed execution as a compiler optimization

Page 30: Spatial Computing for Networked Collaboration · LDP/MELD (CMU Claytronics group) ... Advantages: powerful spatial ideas for that are good for inclusion in code libraries Disadvantages:

Other Geometric Approaches

● Borcea's Spatial Programming● EgoSpaces● SpatialViews● Spidey● Abstract Regions● Growing Point Language● Origami Shape Language

Page 31: Spatial Computing for Networked Collaboration · LDP/MELD (CMU Claytronics group) ... Advantages: powerful spatial ideas for that are good for inclusion in code libraries Disadvantages:

Non-Composable Approaches

Algorithms and techniques, generally based on geometry, but not part of a system of composable parts

● Advantages: powerful spatial ideas for that are good for inclusion in code libraries

● Disadvantages: developed as stand-alone ideas, and may have limited composability

Page 32: Spatial Computing for Networked Collaboration · LDP/MELD (CMU Claytronics group) ... Advantages: powerful spatial ideas for that are good for inclusion in code libraries Disadvantages:

Field-Based Coordination

Mamei & Zambonelli

Page 33: Spatial Computing for Networked Collaboration · LDP/MELD (CMU Claytronics group) ... Advantages: powerful spatial ideas for that are good for inclusion in code libraries Disadvantages:

Self-Healing Gradients

Page 34: Spatial Computing for Networked Collaboration · LDP/MELD (CMU Claytronics group) ... Advantages: powerful spatial ideas for that are good for inclusion in code libraries Disadvantages:

Local Check-Schemes

Yamins

Page 35: Spatial Computing for Networked Collaboration · LDP/MELD (CMU Claytronics group) ... Advantages: powerful spatial ideas for that are good for inclusion in code libraries Disadvantages:

Other Non-Composable Approaches

● hood (Whitehouse, et. al.)● nesC library for interacting with neighbors

● McLurkin's “Stupid Robot Tricks”● Swarm behaviors intended mainly for time-wise

multiplexing.

● Countless one-shot systems...

Page 36: Spatial Computing for Networked Collaboration · LDP/MELD (CMU Claytronics group) ... Advantages: powerful spatial ideas for that are good for inclusion in code libraries Disadvantages:

Significant Non-Spatial Approaches

● “roll-your-own” (e.g. C/C++)● TinyDB

● Distributed database queries for sensor networks

● Kairos● Distributed graph algorithms

● WaveScript● Distributed streaming language● Follow-on to Regiment w/o the spatial primitives

Page 37: Spatial Computing for Networked Collaboration · LDP/MELD (CMU Claytronics group) ... Advantages: powerful spatial ideas for that are good for inclusion in code libraries Disadvantages:

Summary

● Many approaches exist to programming pervasive applications for spatial computers

● Only approaches based on local dynamics currently offer predictable composition, correct execution, and spatial primitives

● Challenge: obtaining long-range coherent behavior from local dynamics

Page 38: Spatial Computing for Networked Collaboration · LDP/MELD (CMU Claytronics group) ... Advantages: powerful spatial ideas for that are good for inclusion in code libraries Disadvantages:

Agenda

● Spatial Computing● Survey of Existing Approaches● Proto & Amorphous Medium

Page 39: Spatial Computing for Networked Collaboration · LDP/MELD (CMU Claytronics group) ... Advantages: powerful spatial ideas for that are good for inclusion in code libraries Disadvantages:

Example: Mobile Streaming

Page 40: Spatial Computing for Networked Collaboration · LDP/MELD (CMU Claytronics group) ... Advantages: powerful spatial ideas for that are good for inclusion in code libraries Disadvantages:

Geometric Program: Channel

Desti-nationSource

(cf. Butera)

Page 41: Spatial Computing for Networked Collaboration · LDP/MELD (CMU Claytronics group) ... Advantages: powerful spatial ideas for that are good for inclusion in code libraries Disadvantages:

Geometric Program: Channel

(cf. Butera)

Desti-nationSource

Page 42: Spatial Computing for Networked Collaboration · LDP/MELD (CMU Claytronics group) ... Advantages: powerful spatial ideas for that are good for inclusion in code libraries Disadvantages:

Geometric Program: Channel

(cf. Butera)

Desti-nationSource

Page 43: Spatial Computing for Networked Collaboration · LDP/MELD (CMU Claytronics group) ... Advantages: powerful spatial ideas for that are good for inclusion in code libraries Disadvantages:

Geometric Program: Channel

(cf. Butera)

Desti-nationSource

Page 44: Spatial Computing for Networked Collaboration · LDP/MELD (CMU Claytronics group) ... Advantages: powerful spatial ideas for that are good for inclusion in code libraries Disadvantages:

Geometric Program: Channel

(cf. Butera)

Desti-nationSource

Page 45: Spatial Computing for Networked Collaboration · LDP/MELD (CMU Claytronics group) ... Advantages: powerful spatial ideas for that are good for inclusion in code libraries Disadvantages:

Geometric Program: Channel

(cf. Butera)

Desti-nationSource

Page 46: Spatial Computing for Networked Collaboration · LDP/MELD (CMU Claytronics group) ... Advantages: powerful spatial ideas for that are good for inclusion in code libraries Disadvantages:

Geometric Program: Channel

(cf. Butera)

Desti-nationSource

Page 47: Spatial Computing for Networked Collaboration · LDP/MELD (CMU Claytronics group) ... Advantages: powerful spatial ideas for that are good for inclusion in code libraries Disadvantages:

Why use continuous space?

Simplicity Scaling & Portability Robustness

(we'll come back to this in a bit...)

Page 48: Spatial Computing for Networked Collaboration · LDP/MELD (CMU Claytronics group) ... Advantages: powerful spatial ideas for that are good for inclusion in code libraries Disadvantages:

Amorphous Medium

Continuous space & timeInfinite number of devicesSee neighbors' past state

Approximate with:Discrete network of devicesSignals transmit state

neighborhood

device

Page 49: Spatial Computing for Networked Collaboration · LDP/MELD (CMU Claytronics group) ... Advantages: powerful spatial ideas for that are good for inclusion in code libraries Disadvantages:

Computing with fields

source destination

gradient distancegradient

<=

+

dilate

width

Page 50: Spatial Computing for Networked Collaboration · LDP/MELD (CMU Claytronics group) ... Advantages: powerful spatial ideas for that are good for inclusion in code libraries Disadvantages:

Computing with fields

source destination

gradient distancegradient

<=

+

dilate

width

37

10

Page 51: Spatial Computing for Networked Collaboration · LDP/MELD (CMU Claytronics group) ... Advantages: powerful spatial ideas for that are good for inclusion in code libraries Disadvantages:

Proto(def gradient (src) ...)(def distance (src dst) ...)(def dilate (src n) (<= (gradient src) n))(def channel (src dst width) (let* ((d (distance src dst)) (trail (<= (+ (gradient src) (gradient dst)) d))) (dilate trail width)))

neighborhood

device

DeviceKernel

evaluation

global to localcompilation

discreteapproximation

platformspecificity &optimization

Glob a

l Lo cal Di scre te

Page 52: Spatial Computing for Networked Collaboration · LDP/MELD (CMU Claytronics group) ... Advantages: powerful spatial ideas for that are good for inclusion in code libraries Disadvantages:

Proto's Families of PrimitivesPointwise Restriction

Feedback Neighborhood

+ restrict

+

741

delay

48

any-hoodnbr

Page 53: Spatial Computing for Networked Collaboration · LDP/MELD (CMU Claytronics group) ... Advantages: powerful spatial ideas for that are good for inclusion in code libraries Disadvantages:

Modulation by Restriction

source destination coord

channel

10

gradcast

10

(5, 7

)

Page 54: Spatial Computing for Networked Collaboration · LDP/MELD (CMU Claytronics group) ... Advantages: powerful spatial ideas for that are good for inclusion in code libraries Disadvantages:

Why use continuous space?

Simplicity Scaling & Portability Robustness

150 devices2000 devices

Page 55: Spatial Computing for Networked Collaboration · LDP/MELD (CMU Claytronics group) ... Advantages: powerful spatial ideas for that are good for inclusion in code libraries Disadvantages:

Device Motion = Vector Fields

brownian flock cluster-to

search-and-rescuecontour-field

Page 56: Spatial Computing for Networked Collaboration · LDP/MELD (CMU Claytronics group) ... Advantages: powerful spatial ideas for that are good for inclusion in code libraries Disadvantages:

Diving into the details

Let's build this up using the Proto simulator, one piece at a time...

(break to work w. simulator)

Page 57: Spatial Computing for Networked Collaboration · LDP/MELD (CMU Claytronics group) ... Advantages: powerful spatial ideas for that are good for inclusion in code libraries Disadvantages:

In simulation...

Page 58: Spatial Computing for Networked Collaboration · LDP/MELD (CMU Claytronics group) ... Advantages: powerful spatial ideas for that are good for inclusion in code libraries Disadvantages:

I need a med team!

We're on our way

Example: Disaster Relief

Page 59: Spatial Computing for Networked Collaboration · LDP/MELD (CMU Claytronics group) ... Advantages: powerful spatial ideas for that are good for inclusion in code libraries Disadvantages:

In simulation...

Page 60: Spatial Computing for Networked Collaboration · LDP/MELD (CMU Claytronics group) ... Advantages: powerful spatial ideas for that are good for inclusion in code libraries Disadvantages:

Weaknesses

Functional programming scares people Programmers can break the abstraction No dynamic allocation of processes No formal proofs available for quality of

approximation in a composed program

(active research on last two)

Page 61: Spatial Computing for Networked Collaboration · LDP/MELD (CMU Claytronics group) ... Advantages: powerful spatial ideas for that are good for inclusion in code libraries Disadvantages:

Summary

Amorphous Medium abstraction simplifies programming of space-filling networks

Proto has four families of space and time operations, compiles global descriptions into local actions that approximate the global

Geometric metaphors allow complex spatial computing problems to be solved with very short programs.

Page 62: Spatial Computing for Networked Collaboration · LDP/MELD (CMU Claytronics group) ... Advantages: powerful spatial ideas for that are good for inclusion in code libraries Disadvantages:

Proto is available

http://stpg.csail.mit.edu/proto.html

(or google “MIT Proto”)● Includes libraries, compiler, kernel, simulator,

platforms● Licensed under GPL (w. libc-type exception)

● Feedback on session: ● CTS2010 Website: Click “feedback” for tutorial● Password: cts10bluestar