21
O2S Planning Technology Delta Technology Transfer 27 October 2005 Justin Mazzola Paluska [email protected]

O2S Planning Technology Delta Technology Transfer 27 October 2005 Justin Mazzola Paluska

Embed Size (px)

DESCRIPTION

Approach ● Make application adaptation points explicit – Provide mechanism to choose, startup, teardown, and swap alternatives. ● Evaluation-based – Very little analysis – Exploit contexts or cached results to “learn” what should be done ● Reduce ad-hoc decision making – How well can you make do with what you have?

Citation preview

Page 1: O2S Planning Technology Delta Technology Transfer 27 October 2005 Justin Mazzola Paluska

O2S Planning Technology

Delta Technology Transfer27 October 2005

Justin Mazzola [email protected]

Page 2: O2S Planning Technology Delta Technology Transfer 27 October 2005 Justin Mazzola Paluska

Overview● System Model● Model Details● A few examples

– Generic Techniques– Node Cloning– Free Teleconference

Page 3: O2S Planning Technology Delta Technology Transfer 27 October 2005 Justin Mazzola Paluska

Approach● Make application adaptation points explicit

– Provide mechanism to choose, startup, teardown, and swap alternatives.

● Evaluation-based– Very little analysis– Exploit contexts or cached results to “learn” what

should be done● Reduce ad-hoc decision making

– How well can you make do with what you have?

Page 4: O2S Planning Technology Delta Technology Transfer 27 October 2005 Justin Mazzola Paluska

System Model

Page 5: O2S Planning Technology Delta Technology Transfer 27 October 2005 Justin Mazzola Paluska

Components● Goal – parameterized intent or

representation of a desired condition● Technique – code that implements a Goal● Planner – runtime system that matches

Goals to Techniques

Page 6: O2S Planning Technology Delta Technology Transfer 27 October 2005 Justin Mazzola Paluska

Planner● Recursively bind Techniques to Goals

– AND/“OR” tree● At each OR node, choose a node for

execution.– based on the satisfaction property

● Execute the chosen nodes● Maintain the tree over time

– Re-execute relevant stages– Propagate property updates

Page 7: O2S Planning Technology Delta Technology Transfer 27 October 2005 Justin Mazzola Paluska

Planner

FindAudioSource()

via MP3s

viaMP3Server

FindAudioSink()

PlayMusic(criteria=“jazz”)

AudioFader()

viaAudioFader

viaLaptop

.75

.75

.50

.50

.25

.25

.50

.50

viaSpeaker

.75

.75

.67

.67

(…other music sources…)

Page 8: O2S Planning Technology Delta Technology Transfer 27 October 2005 Justin Mazzola Paluska

Model Details

Page 9: O2S Planning Technology Delta Technology Transfer 27 October 2005 Justin Mazzola Paluska

Goals● parameterized

specification of a class of intents or desires– input parameters– types and names of

returned Properties● Goal names the

specification used.

<?xml version="1.0" standalone="yes" ?> <goal> <documentation> <brief_description> A <this /> connects two Oxygen users so that they may communicate. </brief_description> <long_description> A <this /> connects two Oxygen users so that they may communicate. The initiator of the conversation may set an "importance" level for the teleconference, which may be used by the receiving end to determine if the conversation should be accepted and the like. </long_description> </documentation> <parameters> <parameter> <name>person1</name> <type>http://o2s.lcs.mit.edu/specs/rtypes/Person.xml</type> <documentation> <brief_description> The initiating end of the teleconference. </brief_description> </documentation> </parameter> <parameter> <name>person2</name> <type>http://o2s.lcs.mit.edu/specs/rtypes/Person.xml</type> <documentation> <brief_description> The other end of the teleconference. </brief_description>

from http://o2s.csail.mit.edu/system.html

Page 10: O2S Planning Technology Delta Technology Transfer 27 October 2005 Justin Mazzola Paluska

Goal Instances● Goal bound with parameters

SendText(“jmp”, “Meeting Time!”)

● Return value of call is a Solution– Properties mirror that of the chosen Technique.

● A Goal Instance persists until it is told to shutdown.

Page 11: O2S Planning Technology Delta Technology Transfer 27 October 2005 Justin Mazzola Paluska

Techniques● parameterized template for satisfying a

particular Goal– Both declarative and imperitive code– subgoals

● Technique Instances satisfy Goal Instances– parameters bound to Goal Instance's– fill in Properties of Solutions

Page 12: O2S Planning Technology Delta Technology Transfer 27 October 2005 Justin Mazzola Paluska

Technique Code● Partitioned into

Stages– write stage N+1 as

though stage N has completed

● All state is stored in Solution objects– subgoal properties– one's own properties

to PlayMusic(criteria=any): via MP3s: subgoals: source = FindMusicStream(goal.criteria) sink = FindAudioSink() fader = AudioFader() eval: solution.satisfaction = (source.satisfaction + sink.satisfaction) / 2 exec: fader.resource.connect(source.out, sink.in) update sink from old: fader.replace(old, sink.in)

Page 13: O2S Planning Technology Delta Technology Transfer 27 October 2005 Justin Mazzola Paluska

Technique Stages● only exec is required● The Planner keeps

track of stage dependencies.

● evaluation stages must be idempotent– are time limited!

● evaluation stages– first– subgoals– eval– foreground

● execution stages– exec– update– shutdown

Page 14: O2S Planning Technology Delta Technology Transfer 27 October 2005 Justin Mazzola Paluska

A Few Examples

Page 15: O2S Planning Technology Delta Technology Transfer 27 October 2005 Justin Mazzola Paluska

PlayMusic via MP3 Technique

• Don't want a new Technique for each and every format.

to PlayMusic(criteria):

via MP3s:

subgoals:

source = FindMusicStream(criteria=goal.criteria, stream_format="MP3") sink = FindAudioSink(stream_format="MP3") fader = AudioFader(in_stream_format="MP3", out_stream_format="MP3")

...

Page 16: O2S Planning Technology Delta Technology Transfer 27 October 2005 Justin Mazzola Paluska

PlayMusic via GenericStream

• Choose an AudioFader that matches the inputs and outputs.

to PlayMusic(criteria):

via GenericStream:

subgoals:

source = FindMusicStream(criteria=goal.criteria) sink = FindAudioSink()

subgoals: fader = AudioFader(in_stream_type=source.stream_format, out_stream_type=sink.stream_format)

Page 17: O2S Planning Technology Delta Technology Transfer 27 October 2005 Justin Mazzola Paluska

Making the Best Choices

• Given two subgoals, the best of each may not be the best pair.

VideoSink()

via Monitor/AudioSink

via TV

AudioSink()

OutputAV()

viaMonitor

viaTV Speaker

.75

.75

.50 .25

.75

.50

viaReceiver

.75

Page 18: O2S Planning Technology Delta Technology Transfer 27 October 2005 Justin Mazzola Paluska

AND/“OR” Tree?● Nodes may be

cloned– GenerateSolution

subgoal– “When necessary”

● Push decision making up the tree.

viaTV

Speaker

VideoSink()

via AV

via TV

AudioSink()

OutputAV()

viaMonitor

viaReceiver

via AV#2

via TV

OutputAV()

viaMonitor

viaTV

Speaker

viaReceiver

via AV#3 via AV#4via AV#1

Page 19: O2S Planning Technology Delta Technology Transfer 27 October 2005 Justin Mazzola Paluska

Free Communication● Use parameters to

influence the choices of the Planner– pass down

information– fail if a choice is not

good enough

to FreeTeleconference(person_a, person_b): via CheckFree: subgoals: tc = Teleconference(goal.person_a, goal.person_b) eval: if tc.cost > 0: fail(“No free teleconference!") ...

to FreeTeleconference(person_a, person_b):

via RequireFree: subgoals: tc = Teleconference(goal.person_a, goal.person_b, cost=0) ...

Page 20: O2S Planning Technology Delta Technology Transfer 27 October 2005 Justin Mazzola Paluska

Limits to Parameter Passing

● Passing down needs to be specified

● Passing up needs to be calculated

G1(cost=$$)

via T1

G2()

via T2

G3()

via T3

$$

$$

Page 21: O2S Planning Technology Delta Technology Transfer 27 October 2005 Justin Mazzola Paluska

Questions?

Planner in o2s/plannerTechniques scattered through o2s/playground