June 2010
gearing up for dynamic adaptation to context
Ambience
programming in
Dr. Sebastián González & Prof. Kim Mens
Éco...
Programming desktops and servers
2
Thursday 17 June 2010
Programming for Ambient Intelligence
2
Thursday 17 June 2010
Programming for Ambient Intelligence
2
Thursday 17 June 2010
Programming for Ambient Intelligence
2
Thursday 17 June 2010
Programming for Ambient Intelligence
2
Thursday 17 June 2010
Programming for Ambient Intelligence
2
Thursday 17 June 2010
Programming for Ambient Intelligence
2
Thursday 17 June 2010
Programming for Ambient Intelligence
2
Thursday 17 June 2010
... is programming with context in mind
Programming for Ambient Intelligence
2
Thursday 17 June 2010
... is programming with context in mind
Programming for Ambient IntelligenceNew hardware phenomena unveil new opportunitie...
Examples
take advantage of room projector for presentation
user task
disable phone ringtone in quiet places
location seman...
4
Running Example
call reception behaviour
Thursday 17 June 2010
4
context behaviour
Running Example
call reception behaviour
Thursday 17 June 2010
4
context behaviour
Running Example
call reception behaviour
ringtonedefault
Thursday 17 June 2010
4
context behaviour
Running Example
call reception behaviour
vibrationquiet
Thursday 17 June 2010
off-hook
4
call waiting signal
context behaviour
Running Example
call reception behaviour
Thursday 17 June 2010
unavailable
4
forward call
context behaviour
Running Example
call reception behaviour
Thursday 17 June 2010
4
context behaviour
Running Example
call reception behaviour
quietoff-hook +
Thursday 17 June 2010
4
context behaviour
Running Example
call reception behaviour
quietoff-hook + call waiting signal
Thursday 17 June 2010
class phone {
method receive ( call ) {
if ( phone.isOffHook( ) )
play( phone.callWaitingSignal( ), 2 );
else if ( phone.e...
class phone {
method receive ( call ) {
if ( phone.isOffHook( ) )
play( phone.callWaitingSignal( ), 2 );
else if ( phone.e...
class Phone
{ attribute strategy;
method receive ( call )
{ strategy.receive( call ); } }
special software architecture
Co...
class UnavailableStrategy
{ method receive ( call ) { ... } }
class QuietStrategy
{ method receive ( call ) { ... } }
clas...
class UnavailableStrategy
{ method receive ( call ) { ... } }
class QuietStrategy
{ method receive ( call ) { ... } }
clas...
class UnavailableStrategy
{ method receive ( call ) { ... } }
class QuietStrategy
{ method receive ( call ) { ... } }
clas...
class UnavailableStrategy
{ method receive ( call ) { ... } }
class QuietStrategy
{ method receive ( call ) { ... } }
clas...
From programming in
isolation...
Programming languages do not
feature dedicated abstractions to deal
with contexts and cor...
Context Reification
8
current-context
First-class context
Thursday 17 June 2010
Context Reification
8
advertise
telephony
current-context
First-class context
Thursday 17 June 2010
Context Reification
8
advertise
quiet
advertise
telephony
meeting
current-context
First-class context
Thursday 17 June 2010
Context Reification
8
advertise
off-hook
advertise
quiet
advertise
telephony
meeting
current-context
First-class context
Th...
Context Reification
8
advertise
off-hook
advertise
quiet
advertise
telephony
meeting
advertise
off-hook+quiet
current-conte...
Context Reification
8
advertise
off-hook
advertise
quiet
advertise
telephony
meeting
advertise
off-hook+quiet
current-conte...
receive: alices-call on: bobs-phone
9
receive: call (phone-call) on: phone (mobile-phone)
[ advertise: call on: phone.
enq...
receive: alices-call on: bobs-phone
9
receive: call (phone-call) on: phone (mobile-phone)
[ advertise: call on: phone.
enq...
receive: alices-call on: bobs-phone
9
receive: call (phone-call) on: phone (mobile-phone)
[ advertise: call on: phone.
enq...
receive: alices-call on: bobs-phone
9
receive: call (phone-call) on: phone (mobile-phone)
[ advertise: call on: phone.
enq...
4
10
receive: call (phone-call) on: phone (mobile-phone)
[ advertise: call on: phone.
enqueue: call in: phone incoming-cal...
4
10
receive: call (phone-call) on: phone (mobile-phone)
[ advertise: call on: phone.
enqueue: call in: phone incoming-cal...
receive: alices-call on: bobs-phone
advertise: call (phone-call) on: phone (mobile-phone)
[ activate: phone vibrator durin...
(current-context)
current-activation
in-context: quiet do:
[
]
receive: alices-call on: bobs-phone
advertise: call (phone-...
current-context
current-activation
in-context: quiet do:
[
]
receive: alices-call on: bobs-phone
advertise: call (phone-ca...
in-context: quiet do:
[
]
receive: alices-call on: bobs-phone
advertise: call (phone-call) on: phone (mobile-phone)
[ acti...
in-context: quiet do:
[ advertise: call (phone-call) on: phone (mobile-phone)
[ activate: phone vibrator during: 10 second...
in-context: quiet do:
[ advertise: call (phone-call) on: phone (mobile-phone)
[ activate: phone vibrator during: 10 second...
in-context: quiet do:
[ advertise: call (phone-call) on: phone (mobile-phone)
[ activate: phone vibrator during: 10 second...
in-context: quiet do:
[ advertise: call (phone-call) on: phone (mobile-phone)
[ activate: phone vibrator during: 10 second...
in-context: off-hook do:
[ advertise: call (phone-call) on: phone (mobile-phone)
[ play: phone call-waiting-signal during:...
in-context: off-hook do:
[ advertise: call (phone-call) on: phone (mobile-phone)
[ play: phone call-waiting-signal during:...
in-context: off-hook do:
[ advertise: call (phone-call) on: phone (mobile-phone)
[ play: phone call-waiting-signal during:...
in-context: off-hook do:
[ advertise: call (phone-call) on: phone (mobile-phone)
[ play: phone call-waiting-signal during:...
Upcoming SlideShare
Loading in …5
×

Ambience In A Nutshell

481 views

Published on

Programming in Ambience - gearing up for dynamic adaptation to context.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
481
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
7
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Ambience In A Nutshell

  1. 1. June 2010 gearing up for dynamic adaptation to context Ambience programming in Dr. Sebastián González & Prof. Kim Mens École Polytechnique de Louvain Université catholique de Louvain Pôle d’ingénierie informatique ICTEAM Thursday 17 June 2010
  2. 2. Programming desktops and servers 2 Thursday 17 June 2010
  3. 3. Programming for Ambient Intelligence 2 Thursday 17 June 2010
  4. 4. Programming for Ambient Intelligence 2 Thursday 17 June 2010
  5. 5. Programming for Ambient Intelligence 2 Thursday 17 June 2010
  6. 6. Programming for Ambient Intelligence 2 Thursday 17 June 2010
  7. 7. Programming for Ambient Intelligence 2 Thursday 17 June 2010
  8. 8. Programming for Ambient Intelligence 2 Thursday 17 June 2010
  9. 9. Programming for Ambient Intelligence 2 Thursday 17 June 2010
  10. 10. ... is programming with context in mind Programming for Ambient Intelligence 2 Thursday 17 June 2010
  11. 11. ... is programming with context in mind Programming for Ambient IntelligenceNew hardware phenomena unveil new opportunities for delivering specific services according to the physical and logical environment of use 2 Thursday 17 June 2010
  12. 12. Examples take advantage of room projector for presentation user task disable phone ringtone in quiet places location semantics decrease playback quality when battery power is low internal state peer service environmental conditions give more detailed indications when visibility is low show parking spots and gas stations while driving 3 Thursday 17 June 2010
  13. 13. 4 Running Example call reception behaviour Thursday 17 June 2010
  14. 14. 4 context behaviour Running Example call reception behaviour Thursday 17 June 2010
  15. 15. 4 context behaviour Running Example call reception behaviour ringtonedefault Thursday 17 June 2010
  16. 16. 4 context behaviour Running Example call reception behaviour vibrationquiet Thursday 17 June 2010
  17. 17. off-hook 4 call waiting signal context behaviour Running Example call reception behaviour Thursday 17 June 2010
  18. 18. unavailable 4 forward call context behaviour Running Example call reception behaviour Thursday 17 June 2010
  19. 19. 4 context behaviour Running Example call reception behaviour quietoff-hook + Thursday 17 June 2010
  20. 20. 4 context behaviour Running Example call reception behaviour quietoff-hook + call waiting signal Thursday 17 June 2010
  21. 21. class phone { method receive ( call ) { if ( phone.isOffHook( ) ) play( phone.callWaitingSignal( ), 2 ); else if ( phone.environment( ).acoustics( ).isQuiet( ) ) phone.vibrate( 5 ); else if ( phone.user( ).isUnavailable( ) ) forwardCall( call, phone.forwardNumber( ) ); else play( phone.ringTone( ), 10 ); } conditional statements Contemporary Solution 5 Thursday 17 June 2010
  22. 22. class phone { method receive ( call ) { if ( phone.isOffHook( ) ) play( phone.callWaitingSignal( ), 2 ); else if ( phone.environment( ).acoustics( ).isQuiet( ) ) phone.vibrate( 5 ); else if ( phone.user( ).isUnavailable( ) ) forwardCall( call, phone.forwardNumber( ) ); else play( phone.ringTone( ), 10 ); } conditional statements Tangled Fixed Contemporary Solution 5 Scattered Thursday 17 June 2010
  23. 23. class Phone { attribute strategy; method receive ( call ) { strategy.receive( call ); } } special software architecture Contemporary Solution 6 Thursday 17 June 2010
  24. 24. class UnavailableStrategy { method receive ( call ) { ... } } class QuietStrategy { method receive ( call ) { ... } } class OffHookStrategy { method receive ( call ) { ... } } class DefaultStrategy { method receive ( call ) { ... } } class Phone { attribute strategy; method receive ( call ) { strategy.receive( call ); } } UnavailableStrategy OffHookStrategy special software architecture Contemporary Solution 6 QuietStrategy Phone DefaultStrategy Thursday 17 June 2010
  25. 25. class UnavailableStrategy { method receive ( call ) { ... } } class QuietStrategy { method receive ( call ) { ... } } class OffHookStrategy { method receive ( call ) { ... } } class DefaultStrategy { method receive ( call ) { ... } } class Phone { attribute strategy; method receive ( call ) { strategy.receive( call ); } } UnavailableStrategy OffHookStrategy special software architecture Contemporary Solution 6 QuietStrategy Phone DefaultStrategy Thursday 17 June 2010
  26. 26. class UnavailableStrategy { method receive ( call ) { ... } } class QuietStrategy { method receive ( call ) { ... } } class OffHookStrategy { method receive ( call ) { ... } } class DefaultStrategy { method receive ( call ) { ... } } class Phone { attribute strategy; method receive ( call ) { strategy.receive( call ); } } UnavailableStrategy OffHookStrategy special software architecture Contemporary Solution 6 QuietStrategy Phone DefaultStrategy Infrastructural burden Anticipated adaptation points Thursday 17 June 2010
  27. 27. class UnavailableStrategy { method receive ( call ) { ... } } class QuietStrategy { method receive ( call ) { ... } } class OffHookStrategy { method receive ( call ) { ... } } class DefaultStrategy { method receive ( call ) { ... } } class Phone { attribute strategy; method receive ( call ) { strategy.receive( call ); } } UnavailableStrategy OffHookStrategy special software architecture Contemporary Solution 6 QuietStrategy Phone DefaultStrategy Infrastructural burden Anticipated adaptation points in Ambient Intelligence dynamic adaptation is commonplace rather than an occasional need Thursday 17 June 2010
  28. 28. From programming in isolation... Programming languages do not feature dedicated abstractions to deal with contexts and corresponding behavioural adaptations at run time ... to programming in Ambience Develop programming abstractions to permit the natural expression of adaptable behaviour according to changing contexts 7 Thursday 17 June 2010
  29. 29. Context Reification 8 current-context First-class context Thursday 17 June 2010
  30. 30. Context Reification 8 advertise telephony current-context First-class context Thursday 17 June 2010
  31. 31. Context Reification 8 advertise quiet advertise telephony meeting current-context First-class context Thursday 17 June 2010
  32. 32. Context Reification 8 advertise off-hook advertise quiet advertise telephony meeting current-context First-class context Thursday 17 June 2010
  33. 33. Context Reification 8 advertise off-hook advertise quiet advertise telephony meeting advertise off-hook+quiet current-context First-class context Thursday 17 June 2010
  34. 34. Context Reification 8 advertise off-hook advertise quiet advertise telephony meeting advertise off-hook+quiet current-context • partly managed by user • partly managed by system First-class context Thursday 17 June 2010
  35. 35. receive: alices-call on: bobs-phone 9 receive: call (phone-call) on: phone (mobile-phone) [ advertise: call on: phone. enqueue: call in: phone incoming-calls ] Call Reception Behaviour 1 Running Example in Ambience Thursday 17 June 2010
  36. 36. receive: alices-call on: bobs-phone 9 receive: call (phone-call) on: phone (mobile-phone) [ advertise: call on: phone. enqueue: call in: phone incoming-calls ] advertise: call (phone-call) on: phone (mobile-phone) [ play: phone ringtone during: 20 seconds ] Call Reception Behaviour 1 Running Example in Ambience Thursday 17 June 2010
  37. 37. receive: alices-call on: bobs-phone 9 receive: call (phone-call) on: phone (mobile-phone) [ advertise: call on: phone. enqueue: call in: phone incoming-calls ] advertise: call (phone-call) on: phone (mobile-phone) [ play: phone ringtone during: 20 seconds ] application logic Call Reception Behaviour 1 Running Example in Ambience Thursday 17 June 2010
  38. 38. receive: alices-call on: bobs-phone 9 receive: call (phone-call) on: phone (mobile-phone) [ advertise: call on: phone. enqueue: call in: phone incoming-calls ] advertise: call (phone-call) on: phone (mobile-phone) [ play: phone ringtone during: 20 seconds ] application logic how do we express adaptations of base application logic to context? Call Reception Behaviour 1 Running Example in Ambience Thursday 17 June 2010
  39. 39. 4 10 receive: call (phone-call) on: phone (mobile-phone) [ advertise: call on: phone. enqueue: call in: phone incoming-calls ]. advertise: call (phone-call) on: phone (mobile-phone) [ if: phone is-off-hook then: [ play: phone call-waiting-signal during: 3 seconds ] else: [ play: phone ringtone during: 20 seconds ] ]. application logic 1 2 Basic Telephony Behaviour Thursday 17 June 2010
  40. 40. 4 10 receive: call (phone-call) on: phone (mobile-phone) [ advertise: call on: phone. enqueue: call in: phone incoming-calls ]. advertise: call (phone-call) on: phone (mobile-phone) [ if: phone is-off-hook then: [ play: phone call-waiting-signal during: 3 seconds ] else: [ play: phone ringtone during: 20 seconds ] ]. application logic 1 2 Basic Telephony Behaviour Fixed Thursday 17 June 2010
  41. 41. receive: alices-call on: bobs-phone advertise: call (phone-call) on: phone (mobile-phone) [ activate: phone vibrator during: 10 seconds ] Implicit Context Specialisation 11 advertise: call (phone-call) on: phone (mobile-phone) [ play: phone ringtone during: 20 seconds ] Thursday 17 June 2010
  42. 42. (current-context) current-activation in-context: quiet do: [ ] receive: alices-call on: bobs-phone advertise: call (phone-call) on: phone (mobile-phone) [ activate: phone vibrator during: 10 seconds ] Implicit Context Specialisation 11 implicit explicit advertise: call (phone-call) on: phone (mobile-phone) [ play: phone ringtone during: 20 seconds ] Thursday 17 June 2010
  43. 43. current-context current-activation in-context: quiet do: [ ] receive: alices-call on: bobs-phone advertise: call (phone-call) on: phone (mobile-phone) [ activate: phone vibrator during: 10 seconds ] Implicit Context Specialisation 11 phone-call mobile-phone bobs-phone implicit explicit advertise: call (phone-call) on: phone (mobile-phone) [ play: phone ringtone during: 20 seconds ] alices-callcurrent-activation Thursday 17 June 2010
  44. 44. in-context: quiet do: [ ] receive: alices-call on: bobs-phone advertise: call (phone-call) on: phone (mobile-phone) [ activate: phone vibrator during: 10 seconds ] Implicit Context Specialisation 11 phone-call mobile-phone advertise: call (phone-call) on: phone (mobile-phone) [ play: phone ringtone during: 20 seconds ] quiet Thursday 17 June 2010
  45. 45. in-context: quiet do: [ advertise: call (phone-call) on: phone (mobile-phone) [ activate: phone vibrator during: 10 seconds ] ] advertise: call (phone-call) on: phone (mobile-phone) [ play: phone ringtone during: 20 seconds ]. receive: call (phone-call) on: phone (mobile-phone) [ advertise: call on: phone. enqueue: call in: phone incoming-calls ]. 12 application logic adaptation logic Context-Specific Behaviour Thursday 17 June 2010
  46. 46. in-context: quiet do: [ advertise: call (phone-call) on: phone (mobile-phone) [ activate: phone vibrator during: 10 seconds ] ] advertise: call (phone-call) on: phone (mobile-phone) [ play: phone ringtone during: 20 seconds ]. receive: call (phone-call) on: phone (mobile-phone) [ advertise: call on: phone. enqueue: call in: phone incoming-calls ]. 12 straightforward application logic adaptation logic Context-Specific Behaviour Thursday 17 June 2010
  47. 47. in-context: quiet do: [ advertise: call (phone-call) on: phone (mobile-phone) [ activate: phone vibrator during: 10 seconds ] ] advertise: call (phone-call) on: phone (mobile-phone) [ play: phone ringtone during: 20 seconds ]. receive: call (phone-call) on: phone (mobile-phone) [ advertise: call on: phone. enqueue: call in: phone incoming-calls ]. 12 straightforward non-intrusive application logic adaptation logic Context-Specific Behaviour Thursday 17 June 2010
  48. 48. in-context: quiet do: [ advertise: call (phone-call) on: phone (mobile-phone) [ activate: phone vibrator during: 10 seconds ] ] advertise: call (phone-call) on: phone (mobile-phone) [ play: phone ringtone during: 20 seconds ]. receive: call (phone-call) on: phone (mobile-phone) [ advertise: call on: phone. enqueue: call in: phone incoming-calls ]. 12 application logic adaptation logic Context-Specific Behaviour Thursday 17 June 2010
  49. 49. in-context: off-hook do: [ advertise: call (phone-call) on: phone (mobile-phone) [ play: phone call-waiting-signal during: 3 seconds ] ] 13 advertise: call (phone-call) on: phone (mobile-phone) [ play: phone ringtone during: 20 seconds ]. receive: call (phone-call) on: phone (mobile-phone) [ advertise: call on: phone. enqueue: call in: phone incoming-calls ]. application logic application logic Adapted Telephony Behaviour Thursday 17 June 2010
  50. 50. in-context: off-hook do: [ advertise: call (phone-call) on: phone (mobile-phone) [ play: phone call-waiting-signal during: 3 seconds ] ] 13 advertise: call (phone-call) on: phone (mobile-phone) [ play: phone ringtone during: 20 seconds ]. receive: call (phone-call) on: phone (mobile-phone) [ advertise: call on: phone. enqueue: call in: phone incoming-calls ]. straightforward application logic application logic Adapted Telephony Behaviour Thursday 17 June 2010
  51. 51. in-context: off-hook do: [ advertise: call (phone-call) on: phone (mobile-phone) [ play: phone call-waiting-signal during: 3 seconds ] ] 13 advertise: call (phone-call) on: phone (mobile-phone) [ play: phone ringtone during: 20 seconds ]. receive: call (phone-call) on: phone (mobile-phone) [ advertise: call on: phone. enqueue: call in: phone incoming-calls ]. straightforward application logic simplified application logic Adapted Telephony Behaviour Thursday 17 June 2010
  52. 52. in-context: off-hook do: [ advertise: call (phone-call) on: phone (mobile-phone) [ play: phone call-waiting-signal during: 3 seconds ] ] 13 advertise: call (phone-call) on: phone (mobile-phone) [ play: phone ringtone during: 20 seconds ]. receive: call (phone-call) on: phone (mobile-phone) [ advertise: call on: phone. enqueue: call in: phone incoming-calls ]. application logic application logic Adapted Telephony Behaviour Thursday 17 June 2010

×