12.08.2013 Views

Silvia Rossi - Lezione 3

Silvia Rossi - Lezione 3

Silvia Rossi - Lezione 3

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

martedì 9 ottobre 12<br />

Sistemi per il Governo dei<br />

Robot<br />

<strong>Silvia</strong> <strong>Rossi</strong> - <strong>Lezione</strong> 3


INTRODUZIONE<br />

ARCHITETTURE ROBOTICHE<br />

martedì 9 ottobre 12


martedì 9 ottobre 12<br />

I paradigmi per il controllo dei robot<br />

Gerarchico: S-P-A<br />

Reattivo: S-A<br />

Ibrido: P, S-A<br />

PLAN<br />

SENSE ACT


martedì 9 ottobre 12<br />

Il Paradigma Gerarchico<br />

Gerarchico: S-P-A<br />

PLAN<br />

world<br />

SENSE ACT


martedì 9 ottobre 12<br />

Il Paradigma Gerarchico<br />

ROBOT<br />

PRIMITIVES<br />

SENSE<br />

PLAN<br />

ACT<br />

INPUT<br />

Sensor data<br />

Information<br />

(sensed or<br />

cognitive)<br />

Sensed<br />

information or<br />

directives<br />

OUTPUT<br />

Sensed<br />

information<br />

Directives<br />

Actuator<br />

commands


martedì 9 ottobre 12<br />

Architetture Gerarchiche<br />

Caratteristiche comuni:<br />

Struttura gerarchica<br />

Chiara divisione delle funzionalità<br />

Comunicazione e controllo predeterminati<br />

I livelli alti forniscono i sotto-goal per il livelli più bassi<br />

Ha bisogno di rappresentazione simbolica<br />

Appropriate per ambienti strutturati e predicibili


martedì 9 ottobre 12<br />

Architetture Gerarchiche<br />

Vantaggi<br />

Funzionamento predicibile ovvero pianificazione a priori dei comportamenti<br />

Efficienza e stabilità del sistema<br />

Svantaggi<br />

Alta complessità computazionale dovuta principalmente alla modellazione<br />

dell’ambiente e al ragionamento<br />

Poca adattabilità alle modifiche in tempo reale dell’ambiente o bassa reattività<br />

Basso parallelismo<br />

Non incrementale<br />

una mancanza di sensibilità in ambienti non strutturati e incerti dovuta sia ai<br />

requisiti di modellazione del mondo sia alle limitate vie di comunicazione;<br />

la difficoltà nell’ingegnerizzare sistemi completi con competenze incrementali.<br />

In questo caso, infatti, virtualmente l’intero sistema deve essere costruito<br />

prima di verificare che sia fattibile.


martedì 9 ottobre 12<br />

Il Paradigma Reattivo<br />

Reattivo: S-A<br />

PLAN<br />

world<br />

SENSE ACT


martedì 9 ottobre 12<br />

Il Paradigma Reattivo<br />

Reattivo: S-A<br />

ROBOT<br />

PRIMITIVES<br />

SENSE<br />

PLAN<br />

ACT<br />

INPUT<br />

Sensor data<br />

Information<br />

(sensed or<br />

cognitive)<br />

Sensed<br />

Information<br />

or directives<br />

OUTPUT<br />

Sensed<br />

information<br />

Directives<br />

Actuator<br />

commands


martedì 9 ottobre 12<br />

Architetture Reattive<br />

I comportamenti del robot sono reazioni alle<br />

informazioni percepite dall’ambiente<br />

Il modulo di base di tali sistemi è costituito quindi<br />

da un comportamento (behavior) che è ottenuto<br />

da una relazione diretta tra sensori e attuatori<br />

Si parla di behaviour-based robotics o sistemi<br />

reattivi, ovvero sistemi capaci di rispondere in<br />

tempo reale agli stimoli provenienti dall'ambiente<br />

circostante


martedì 9 ottobre 12<br />

Architetture Reattive<br />

Il robot interagisce con il mondo attraverso sensori<br />

e attuatori<br />

Non esiste una rappresentazione del mondo, (“The<br />

world is the best model” di R. A. Brooks, 1986): la<br />

conoscenza del mondo non è né modellizzata né<br />

memorizzata nel robot ma è estratta in tempo<br />

reale dal mondo stesso attraverso i sensori<br />

Poiché non esiste un modello del mondo, di<br />

conseguenza non esiste pianificazione a priori<br />

delle azioni del robot


martedì 9 ottobre 12<br />

Architetture Reattive<br />

Nelle architetture di controllo reattive l’esecuzione<br />

di un compito è suddivisa tra moduli ognuno dei<br />

quali ha assegnata una specifica competenza e<br />

attua un determinato comportamento del robot<br />

Il comportamento complessivo del robot è<br />

determinato dall’insieme dei comportamenti<br />

presenti


martedì 9 ottobre 12<br />

Architetture Reattive<br />

Dalla suddivisione orizzontale e sequenziale della<br />

catena di informazioni alla suddivisione verticale e<br />

parallela<br />

Identificazione degli<br />

oggetti<br />

Costruzione della<br />

mappa<br />

Sensori Attuatori<br />

Explorazione<br />

Evitamento Ostacoli


martedì 9 ottobre 12<br />

Architetture Reattive<br />

Decomposizione verticale che produce flussi multipli di<br />

informazione ciascuno relativo ad una particolare funzione<br />

assegnata al robot.<br />

In questo modo, ogni sequenza si occupa di uno specifico<br />

aspetto nel funzionamento globale del sistema e può<br />

svilupparsi parallelamente ad altri processi<br />

Behaviour n<br />

Behaviour n-1<br />

Behaviour 0<br />

SENSE<br />

SENSE<br />

.. ..<br />

.<br />

.<br />

SENSE<br />

ACT<br />

ACT<br />

ACT


martedì 9 ottobre 12<br />

Architetture Reattive<br />

Principio di indipendenza: i vari moduli devono<br />

essere mutuamente indipendenti tra loro.<br />

Conseguenza immediata all'applicazione di questo<br />

principio è l'impossibilità di mantenere un modello<br />

del mondo completo, condivisibile tra tutti i moduli.<br />

Principio di località: ciascun sottocompito richiede,<br />

per completarsi, solo una parte limitata di tutta<br />

l'informazione sensoriale disponibile. Il robot<br />

risponde solo ad eventi del mondo senza mantenere<br />

stati persistenti: la memoria di cui ha bisogno è<br />

realizzata leggendo direttamente la situazione<br />

ambientale che gli indica il modo operativo corrente.


martedì 9 ottobre 12<br />

Architetture Reattive<br />

Vantaggi<br />

Non esiste un modello del modo<br />

Alta adattabiltà alle modifiche dell’ambiente (risposte in tempo reale)<br />

Bassa complessità di ogni livello e basso costo computazionale<br />

complessivo del sistema<br />

E’ possibile avere parallelismo nel controllo<br />

L’estensione dei comportamenti è relativamente semplice<br />

Svantaggi<br />

Difficoltà nel prevedere a priori il comportamento globale del robot<br />

gestione della concorrenza tra moduli<br />

Aumentando i comportamenti si aumenta anche la complessità della<br />

gestione della concorrenza tra i moduli con conseguente difficoltà nella<br />

risoluzione dei conflitti


martedì 9 ottobre 12<br />

Subsumption Architecture<br />

Input Output<br />

Behavioural<br />

module<br />

Suppressor Inhibitor<br />

Dock<br />

Operate<br />

Find<br />

Wander<br />

Avoid<br />

Highest<br />

priority<br />

Lowest<br />

priority


martedì 9 ottobre 12<br />

Subsumption Architecture<br />

Reason about behavior of objects<br />

Plan changes to the world<br />

Identify objects<br />

Monitor changes<br />

Build maps<br />

Explore<br />

Wander<br />

Avoid objects


martedì 9 ottobre 12<br />

Architetture Reattive<br />

Livello 0: evitare gli ostacoli<br />

Livello 1: navigazione casuale nell’ambiente<br />

Livello 2: esplorazione del mondo e ‘identificazione’ dei punti di<br />

interesse<br />

Livello 3: costruzione della mappa dell’ambiente (relazioni tra punti)<br />

Livello 4: rilevazione dei cambiamenti dell’ambiente statico<br />

Livello 5: ragionamento sul mondo in termini di esecuzione di task in<br />

relazione al rilevamento di determinati oggetti<br />

Livello 6: formulazione ed esecuzione di comportamenti che<br />

determinano cambiamenti dello stato del mondo<br />

Livello 7: ragionamento sui comportamenti degli oggetti e modifica dei<br />

piani in accordo


martedì 9 ottobre 12<br />

Il Paradigma Ibrido<br />

Ibrido: P, S-A<br />

PLAN<br />

SENSE<br />

world<br />

ACT


martedì 9 ottobre 12<br />

Il Paradigma Ibrido<br />

Ibrido: P, S-A<br />

ROBOT<br />

PRIMITIVES<br />

PLAN<br />

SENSE-ACT<br />

INPUT<br />

Information (sensed<br />

or cognitive)<br />

Sensor data<br />

OUTPUT<br />

Directives<br />

Actuator<br />

commands


martedì 9 ottobre 12<br />

Architetture Ibride<br />

Un approccio puramente reattivo dota il robot<br />

della capacità di eseguire compiti semplici in<br />

maniera efficiente, come ad esempio evitare gli<br />

ostacoli e adattarsi alle variazioni del mondo, ma<br />

non garantisce l’esecuzione di task più complessi,<br />

che includono modellizzazione dell’ambiente e<br />

comportamenti più complessi<br />

L’integrazione dei metodi reattivi con i metodi<br />

gerarchici combina l’efficienza della pianificazione<br />

con la flessibilità dei sistemi di controllo reattivo


martedì 9 ottobre 12<br />

Architetture Ibride<br />

Tipicamente una architettura<br />

ibrida comprende un modulo<br />

pianificatore strategico e un modulo<br />

pianificatore tattico per la gestione<br />

dei comportamenti di un robot.<br />

Il pianificatore strategico pianifica a<br />

lungo termine le azioni del robot,<br />

individuando la sequenza di sottoobiettivi<br />

da realizzare per<br />

raggiungere il goal e passando i<br />

risultati per l'esecuzione al<br />

pianificatore tattico.<br />

Il pianificatore tattico inizializza e<br />

monitora i comportamenti<br />

prendendosi cura degli aspetti<br />

temporali per la loro coordinazione


martedì 9 ottobre 12<br />

Aura


martedì 9 ottobre 12<br />

Architetture decentralizzate o distribuite<br />

Un approccio alternativo all’uso di un unico<br />

sistema robotico per l’esecuzione di compiti è<br />

l’uso di un gruppo di sistemi robotici, ciascuno di<br />

complessità inferiore, che cooperano per<br />

l’esecuzione dello stesso compito.<br />

L’intelligenza è distribuita tra i vari sistemi, ognuno<br />

dei quali è autonomo


Il controllo dei Robot<br />

Il lato sinistro rappresenta metodi che assumono un ragionamento deliberativo e la<br />

parte destra rappresenta il controllo reattivo.<br />

martedì 9 ottobre 12<br />

DELIBERATIVA REATTIVA<br />

PURAMENTE SIMBOLICA RIFLESSIVA<br />

VELOCITÀ DI RISPOSTA<br />

CAPACITÀ PREDITTIVE<br />

DIPENDENZA DA UN MODELLO DEL MONDO COMPLETO E ACCURATO<br />

Dipendenza dalla rappresentazione Indipendenza dalla rappresentazione<br />

Lentezza nella risposta Risposta in tempo reale<br />

Alto livello di intelligenza (cognitiva) Basso livello di intelligenza<br />

Latenza variabile Computazioni semplici<br />

26


martedì 9 ottobre 12<br />

Quanta IA?<br />

Di quali funzioni ha bisogno il robot?<br />

Generazione? Monitor? Selezione? Implementazione? Esecuzione?<br />

Apprendimento?<br />

Qual’e’ l’orizzonte di pianificazione?<br />

Presente, presente+passato, presente+passato+futuro<br />

Quanto velocemente gli algoritmi si devono<br />

aggiornare?<br />

Assunzione di mondo chiuso<br />

Di che tipo di modello ha bisogno il robot?<br />

Locale, globale, entrambi<br />

Ridurre al minimo


PLAN<br />

world<br />

SENSE ACT<br />

IL PARADIGMA GERARCHICO<br />

martedì 9 ottobre 12


martedì 9 ottobre 12<br />

Il Paradigma Gerarchico<br />

Gerarchico: S-P-A<br />

Il robot in maniera sequenziale percepisce con i sensori<br />

l’ambiente in cui è immerso e se ne costruisce una<br />

mappa.<br />

Dopo, “ad occhi chiusi”, pianifica tutte le direttive che<br />

deve dare agli attuatori per raggiungere il suo goal.<br />

Infine opera iniziando dalla prima direttiva.<br />

PLAN<br />

world<br />

SENSE ACT


martedì 9 ottobre 12<br />

Il Paradigma Gerarchico<br />

ROBOT<br />

PRIMITIVES<br />

SENSE<br />

PLAN<br />

ACT<br />

INPUT<br />

Sensor data<br />

Information<br />

(sensed or<br />

cognitive)<br />

Sensed<br />

information or<br />

directives<br />

OUTPUT<br />

Sensed<br />

information<br />

Directives<br />

Actuator<br />

commands


martedì 9 ottobre 12<br />

Modello<br />

Tutte le informazioni fornite dai sensori vengono<br />

messe in una struttura dati a cui accede il<br />

pianificatore.<br />

Questa struttura dati è anche detta modello del<br />

mondo del robot.<br />

In questa struttura dati, nel paradigma gerarchico,<br />

sono contenuti:<br />

a - una rappresentazione a priori del mondo in cui il robot è immerso<br />

b - informazioni sensoriali (mi trovo in questo punto della stanza)<br />

c - ogni ulteriore informazione di tipo cognitivo (es. il goal che deve<br />

perseguire)


martedì 9 ottobre 12<br />

Soluzione<br />

Una soluzione di un problema di pianificazione<br />

deve avere le seguenti proprietà:<br />

essere efficace, cioè garantire il raggiungimento dell’obiettivo<br />

essere completa, cioè le precondizioni necessarie per ogni azione<br />

devono essere verificate e ove necessario attuate attraverso<br />

l’esecuzione delle azioni precedenti<br />

essere consistente, cioè non ci debbono essere contraddizioni derivanti<br />

dall’ordine di esecuzione delle azioni o dall’istanziazione delle variabili


martedì 9 ottobre 12<br />

Block words<br />

•A set of blocks, a table and a robot arm.<br />

•All the blocks are equal in size, form and color, distinguished<br />

only by name.<br />

•The table has an unlimited extension.<br />

•A block can be on the table, on top of another block or held by<br />

the robot.<br />

•The robot arm can only hold one block at a time.<br />

•Solve problems by changing the initial configuration (state) into<br />

a state that meets the goals.


martedì 9 ottobre 12<br />

Robotics


martedì 9 ottobre 12<br />

Satellites


martedì 9 ottobre 12<br />

Manufacturing<br />

Sheet-metal bending machines - Amada Corporation<br />

Software to plan the sequence of bends<br />

[Gupta and Bourne, J. Manufacturing Sci. and Engr., 1999]


martedì 9 ottobre 12<br />

Control Sequences on Industrial Plants


martedì 9 ottobre 12<br />

Games<br />

Bridge Baron - Great Game Products<br />

1997 world champion of computer bridge<br />

[Smith, Nau, and Throop, AI Magazine, 1998]<br />

2004: 2nd place<br />

LeadLow(P 1; S)<br />

PlayCard(P 1; S, R 1)<br />

WEST— ♠2<br />

… …<br />

(NORTH— ♠Q)<br />

StandardFinesseTwo(P 2; S)<br />

Finesse(P 1; S)<br />

Us:East declarer, West dummy<br />

Opponents:defenders, South & North<br />

Contract:East – 3NT<br />

On lead:West at trick East:♠KJ74 3<br />

West: ♠A2<br />

FinesseTwo(P2; S)<br />

Out: ♠QT98653<br />

EasyFinesse(P2; S) StandardFinesse(P2; S) BustedFinesse(P2; S)<br />

StandardFinesseThree(P 3; S)<br />

PlayCard(P2; S, R2) PlayCard(P3; S, R3) PlayCard(P4; S, R4) (NORTH— 3)<br />

FinesseFour(P 4; S)<br />

PlayCard(P 4; S, R 4’)<br />

NORTH— ♠3 EAST— ♠J SOUTH— ♠5 SOUTH— ♠Q


martedì 9 ottobre 12<br />

Transportation Logistics<br />

•Set of cities, with airports and post offices<br />

•Set of plans that can fly between cities<br />

•Set of trucks that can only transfer packages between<br />

locations in the same city<br />

•Set of packages that need to be distributed to different<br />

locations, possibly in different cities


martedì 9 ottobre 12<br />

Tourisms


martedì 9 ottobre 12<br />

Military Operations


martedì 9 ottobre 12<br />

Civil Emergencies


martedì 9 ottobre 12<br />

VideoGames


martedì 9 ottobre 12<br />

Classical Planning<br />

Classical planning requires all eight restrictive assumptions<br />

Offline generation of action sequences for a deterministic,<br />

static, finite system, with complete knowledge, attainment<br />

goals, and implicit time<br />

Reduces to the following problem:<br />

Given (Σ, s 0, S g)<br />

Find a sequence of actions (a 1, a 2, … a n) that produces<br />

a sequence of state transitions (s 1, s 2, …, s n)<br />

such that s n is in S g.<br />

This is just path-searching in a graph<br />

Nodes = states<br />

Edges = actions<br />

Is this trivial?


martedì 9 ottobre 12<br />

Deterministic Planning Approaches<br />

•Strips Algorithms (1970): means-ends analysis, backward chaining<br />

search, HACKER, PRODIGY<br />

•Partial Order Planning (1980): search in the plan space, TWEAK,<br />

UCPOP, SNLP, UNPOP<br />

•Graphplan Planning (1995): search in a graph plan, GRAPHPLAN,<br />

IPP<br />

•SAT Planning (1996): convert a planning problem into a SAT<br />

problem, BLACKBOX<br />

•Heuristic Search Planning (1997): HSP, GRT, FF, MIPS, STAN<br />

•Hierarchical Planning (1994) : O-PLAN, UMCP, ABSTRIPS, SHOP,<br />

SIADEX


Major approaches<br />

PLANNING RAPIDLY CHANGING SUBFIELD OF AI<br />

IN BIANNUAL Situation COMPETITION calculus AT AI PLANNING SYSTEMS<br />

CONFERENCE:<br />

•FOUR<br />

State<br />

YEARS<br />

space<br />

AGO,<br />

planning<br />

BEST PLANNER DID PLAN SPACE SEARCH<br />

USING Partial order planning<br />

SAT SOLVER Planning graphs<br />

•THREE YEARS AGO, THE BEST PLANNER DID REGRESSION<br />

Hierarchical decomposition (HTN planning)<br />

SEARCH<br />

martedì 9 ottobre 12<br />

•LAST Reactive YEAR, BEST planning PLANNER DID FORWARD STATE SPACE<br />

SEARCH WITH<br />

AN INADMISSIBLE HEURISTIC FUNCTION


martedì 9 ottobre 12<br />

STRIPS (Fikes and Nilsson 1971)<br />

Stanford Research Institute Problem Solver<br />

Control System for the Shakey robot<br />

http://www.ai.sri.com/shakey/


martedì 9 ottobre 12<br />

Knowledge Representation in Strips<br />

A state is represented as a conjunction of<br />

instantiated predicates<br />

at(object1,airport1), at(plane1,airport1),<br />

at(truck1,airport1), at(truck2,post-office2), ...<br />

Normally, it is assumed that the facts not<br />

present in a state are false: closed world<br />

assumption.


martedì 9 ottobre 12<br />

States and Goals in Block world<br />

The following predicates can be used:<br />

on(x,y): block x is on top of block y<br />

on-table(x): block x is on the table<br />

clear(x): block x has no block above it and is<br />

not being held by the robot arm<br />

holding(x): the robot arm is holding block x<br />

arm-empty: the robot arm is not holding a<br />

block


martedì 9 ottobre 12<br />

Basic representations for planning<br />

Classic approach first used in STRIPS planner circa<br />

1970<br />

States represented as a conjunction of ground<br />

literals<br />

at(Home)<br />

Goals are conjunctions of literals, but may have<br />

existentially quantified variables<br />

at(x) ^ have(Milk) ^ have(bananas) ...<br />

Do not need to fully specify state<br />

Non-specified either don’t-care or assumed false<br />

Represent many cases in small storage<br />

Often only represent changes in state rather than entire situation<br />

Unlike theorem prover, not seeking whether the goal<br />

is true, but is there a sequence of actions to attain it


martedì 9 ottobre 12<br />

Operator/action representation<br />

Operators contain three components:<br />

Action description<br />

Precondition - conjunction of positive literals<br />

Effect - conjunction of positive or negative literals which<br />

describe how situation changes when operator is applied<br />

Example:<br />

Op[Action: Go(there),<br />

Precond: At(here) ^ Path(here,there),<br />

Effect: At(there) ^ ~At(here)]<br />

All variables are universally quantified<br />

Situation variables are implicit<br />

preconditions must be true in the state immediately before<br />

operator is applied; effects are true immediately after


martedì 9 ottobre 12<br />

Blocks world<br />

The blocks world is a micro-world that consists of a table, a<br />

set of blocks and a robot hand.<br />

Some domain constraints:<br />

Only one block can be on another block<br />

Any number of blocks can be on the table<br />

The hand can only hold one block<br />

Typical representation:<br />

ontable(a)<br />

ontable(c)<br />

on(b,a)<br />

handempty<br />

clear(b)<br />

clear(c)<br />

B<br />

A<br />

C<br />

TABLE


martedì 9 ottobre 12<br />

State Representation<br />

C<br />

A B<br />

TABLE<br />

CONJUNCTION OF PROPOSITIONS:<br />

BLOCK(A), BLOCK(B), BLOCK(C),<br />

ON(A,TABLE), ON(B,TABLE), ON(C,A),<br />

CLEAR(B), CLEAR(C), HANDEMPTY


martedì 9 ottobre 12<br />

Vacuum-Robot Example<br />

Two rooms: R 1 and R 2<br />

A vacuum robot<br />

Dust<br />

R 1<br />

R 2


State Representation<br />

In(Robot, R 1) ∧ Clean(R 1)<br />

R 1<br />

CONJUNCTION OF PROPOSITIONS<br />

NO NEGATED PROPOSITION, SUCH AS ¬CLEAN(R 2)<br />

CLOSED-WORLD ASSUMPTION: EVERY PROPOSITION<br />

THAT IS NOT LISTED IN A STATE IS FALSE IN THAT STATE<br />

NO “OR” CONNECTIVE, SUCH AS<br />

IN(ROBOT,R 1)∨IN(ROBOT,R 2)<br />

NO VARIABLE, E.G., ∃X CLEAN(X)<br />

martedì 9 ottobre 12<br />

R 2


martedì 9 ottobre 12<br />

Goal Representation<br />

C<br />

B<br />

A<br />

CONJUNCTION OF PROPOSITIONS:<br />

ON(A,TABLE), ON(B,A), ON(C,B)<br />

THE GOAL G IS ACHIEVED IN A STATE S IF ALL THE<br />

PROPOSITIONS IN G ARE ALSO IN S


martedì 9 ottobre 12<br />

Goal Representation<br />

EXAMPLE: CLEAN(R 1) ∧ CLEAN(R 2)<br />

CONJUNCTION OF<br />

PROPOSITIONS<br />

NO NEGATED PROPOSITION<br />

NO “OR” CONNECTIVE<br />

NO VARIABLE<br />

A GOAL G IS ACHIEVED IN A STATE S IF ALL<br />

THE PROPOSITIONS IN G (CALLED SUB-GOALS)<br />

ARE ALSO IN S


Action Representation<br />

UNSTACK(X,Y)<br />

• P =HANDEMPTY, BLOCK(X), BLOCK(Y),<br />

CLEAR(X), ON(X,Y)<br />

•E =¬HANDEMPTY, ¬CLEAR(X), HOLDING(X),<br />

¬ON(X,Y), CLEAR(Y)<br />

EFFECT: LIST OF LITERALS<br />

PRECONDITION: CONJUNCTION OF<br />

MEANS: REMOVE HANDEMPTY<br />

FROM STATE<br />

martedì 9 ottobre 12<br />

PROPOSITIONS<br />

MEANS: ADD<br />

HOLDING(X) TO STATE


martedì 9 ottobre 12<br />

Action Representation<br />

An action A is applicable to a state S if the<br />

propositions in its precondition are all in S<br />

The application of A to S is a new state<br />

obtained by deleting the propositions in the<br />

delete list from S and adding those in the<br />

add list<br />

RIGHT<br />

PRECONDITION = IN(ROBOT, R 1)<br />

DELETE-LIST = IN(ROBOT, R 1)<br />

ADD-LIST = IN(ROBOT, R 2)


martedì 9 ottobre 12<br />

I go from home to the store, creating a new<br />

situation S’. In S’:<br />

◦The store still sells chips<br />

◦My age is still the same<br />

◦Los Angeles is still the largest city in California…<br />

How can we efficiently represent everything that<br />

hasn’t changed?<br />

STRIPS provides a good solution for simple<br />

actions: explicit effects are the only changes to<br />

the state.


martedì 9 ottobre 12<br />

Example<br />

C<br />

A B<br />

BLOCK(A), BLOCK(B), BLOCK(C),<br />

ON(A,TABLE), ON(B,TABLE), ON(C,A),<br />

CLEAR(B), CLEAR(C), HANDEMPTY<br />

UNSTACK(C,A)<br />

• P =HANDEMPTY, BLOCK(C), BLOCK(A),<br />

CLEAR(C), ON(C,A)<br />

•E =¬HANDEMPTY, ¬CLEAR(C), HOLDING(C),<br />

¬ON(C,A), CLEAR(A)


martedì 9 ottobre 12<br />

Example<br />

A B<br />

C<br />

BLOCK(A), BLOCK(B), BLOCK(C),<br />

ON(A,TABLE), ON(B,TABLE), ON(C,A),<br />

CLEAR(B), CLEAR(C), HANDEMPTY,<br />

HOLDING(C), CLEAR(A)<br />

UNSTACK(C,A)<br />

• P =HANDEMPTY, BLOCK(C), BLOCK(A),<br />

CLEAR(C), ON(C,A)<br />

•E =¬HANDEMPTY, ¬CLEAR(C), HOLDING(C),<br />

¬ON(C,A), CLEAR(A)


Action Representation<br />

UNSTACK(X,Y)<br />

• P = HANDEMPTY, BLOCK(X), BLOCK(Y), CLEAR(X), ON(X,Y)<br />

•E = ¬HANDEMPTY, ¬CLEAR(X), HOLDING(X), ¬ ON(X,Y), CLEAR(Y)<br />

STACK(X,Y)<br />

• P = HOLDING(X), BLOCK(X), BLOCK(Y), CLEAR(Y)<br />

• E = ON(X,Y), ¬CLEAR(Y), ¬HOLDING(X), CLEAR(X), HANDEMPTY<br />

PICKUP(X)<br />

• P = HANDEMPTY, BLOCK(X), CLEAR(X), ON(X,TABLE)<br />

• E = ¬HANDEMPTY, ¬CLEAR(X), HOLDING(X), ¬ON(X,TABLE)<br />

PUTDOWN(X)<br />

• P = HOLDING(X)<br />

• E = ON(X,TABLE), ¬HOLDING(X), CLEAR(X), HANDEMPTY<br />

martedì 9 ottobre 12


martedì 9 ottobre 12<br />

Key-in-Box Example<br />

The robot must lock the door and put the key in<br />

the box<br />

The key is needed to lock and unlock the door<br />

Once the key is in the box, the robot can’t get it<br />

back<br />

R 1 R2


martedì 9 ottobre 12<br />

Initial State<br />

R 1 R2


martedì 9 ottobre 12<br />

Initial State<br />

In(Robot,R 2) ∧ In(Key,R 2) ∧ Unlocked(Door)<br />

R 1 R2


martedì 9 ottobre 12<br />

Goal<br />

R 1 R2


martedì 9 ottobre 12<br />

Goal<br />

Locked(Door) ∧ In(Key,Box)<br />

[The robot’s location isn’t specified in the goal]<br />

R 1 R2


martedì 9 ottobre 12<br />

Actions<br />

Grasp-Key-in-R 2<br />

Lock-Door<br />

Move-Key-from-R 2-into-R 1<br />

Put-Key-Into-Box<br />

R 1<br />

R 2


martedì 9 ottobre 12<br />

Actions<br />

Grasp-Key-in-R 2<br />

P = In(Robot,R 2) ∧ In(Key,R 2)<br />

D = ∅<br />

A = Holding(Key)<br />

Lock-Door<br />

P = Holding(Key)<br />

D = ∅<br />

A = Locked(Door)<br />

Move-Key-from-R 2-into-R 1<br />

P = In(Robot,R 2) ∧ Holding(Key) ∧ Unlocked(Door)<br />

D = In(Robot,R 2), In(Key,R 2)<br />

A = In(Robot,R 1), In(Key,R 1)<br />

Put-Key-Into-Box<br />

P = In(Robot,R 1) ∧ Holding(Key)<br />

D = Holding(Key), In(Key,R 1)<br />

A = In(Key,Box)<br />

R 1<br />

R 2


Typical BW planning problem<br />

Initial state:<br />

clear(a)<br />

clear(b)<br />

clear(c)<br />

ontable(a)<br />

ontable(b)<br />

ontable(c)<br />

handempty<br />

Goal:<br />

martedì 9 ottobre 12<br />

on(b,c)<br />

on(a,b)<br />

ontable(c)<br />

A C<br />

B<br />

A<br />

B<br />

C<br />

A plan:<br />

pickup(b)<br />

stack(b,c)<br />

pickup(a)<br />

stack(a,b)


Another BW planning problem<br />

Initial state:<br />

clear(a)<br />

clear(b)<br />

clear(c)<br />

ontable(a)<br />

ontable(b)<br />

ontable(c)<br />

handempty<br />

Goal:<br />

martedì 9 ottobre 12<br />

on(a,b)<br />

on(b,c)<br />

ontable(c)<br />

A C<br />

B<br />

A<br />

B<br />

C<br />

A plan:<br />

pickup(a)<br />

stack(a,b)<br />

unstack(a,b)<br />

putdown(a)<br />

pickup(b)<br />

stack(b,c)<br />

pickup(a)<br />

stack(a,b)


martedì 9 ottobre 12<br />

Forward Search<br />

Operators are applied until the goals are reached<br />

ProgWS(state, goals, actions, path)<br />

If state satisfies goals, then return path<br />

else a = choose(actions), s.t.<br />

preconditions(a) satisfied in state<br />

if no such a, then return failure<br />

else return<br />

ProgWS(apply(a, state), goals, actions,<br />

concatenate(path, a))<br />

First call: ProgWS(IS, G, Actions, ())

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!