intelegensia semu - planning

53
MATAKuliah Inteligensia Semu “PLANNING”

Upload: danang-hira-kusuma

Post on 15-Oct-2014

194 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Intelegensia Semu - Planning

MATAKuliah

Inteligensia Semu

“PLANNING”

Page 2: Intelegensia Semu - Planning

Clasical Paradigm (Serial)

En

vir

on

men

t

Sense

Model

Plant

Act

Targ

et/

Goal

Page 3: Intelegensia Semu - Planning
Page 4: Intelegensia Semu - Planning

Planning

• Planning dalam Artificcial Intelligent (AI) adalah bagaimana kita merencanakan setiap langkah untuk mengatasi masalah-masalah yang sewaktu-waktu dapat terjadi dalam suatu pengembangan sistem kecerdasan buatan.

• Cara yang kita pakai untuk mendapatkan sebuah goal atau solusi pemecahan masalah.

• Selain itu adapula yang kita sebut sebagai Classical Planning yang mencakup ke semua ruang lingkup, determinasi, observasi dan diskrit dimana hal tersebut berhubungan dengan waktu, tindakan serta efek yang di timbulkan dalam pencarian suatu cara,suatu keputusan atau solusi terbaik.

Page 5: Intelegensia Semu - Planning

Planning

1. Employ to avoid calculation of the entire problem state when we move from one state to the next (consider only parts of the state that may have changed)

2. Decomposition : divide a single difficult problem into several, hopefully easier, sub-problems.

Page 6: Intelegensia Semu - Planning

So …what is planning

1. In everyday usage, planning refers to the process of computing several steps of a problem solving procedures before executing any of them

2. To be more specific, planning is the use of decomposition methods including ways of recording and handling interaction among the subparts

Page 7: Intelegensia Semu - Planning

Examples of Planning Systems

• Spacecraft assembly, integration and verification

• Job shop scheduling

• Space mission scheduling

• Building construction

• Operations on a flight deck of an aircraft carrier

• For demos: blocks world

Page 8: Intelegensia Semu - Planning

State of the Art

• Planning and scheduling: NASA• Game playing: Deep Blue• Autonomous control: ALVINN• Diagnosis• Logistics planning: DART• Robotics: HipNav• Language understanding and problem-

solving: PROVERB

Page 9: Intelegensia Semu - Planning

Boeing Company

Boeing 787 Dreamliner™.Aurora Intelligent Planning & Scheduling System

Page 10: Intelegensia Semu - Planning

Scheduling vs. Planning

Planning is deciding what to do.Scheduling is deciding when to do it.

Page 11: Intelegensia Semu - Planning

Contoh Planning

Page 12: Intelegensia Semu - Planning

The Blocks World

Operator :• UNSTACK(A,B) Ambil block A dari posisi saat ini di atas

block B. Arm (tangan) harus empty (kosong) dan block A harus kosong di atasnya.

• STACK(A,B) Tempatkan block A di atas block B. Arm harus sudah holding (memegang) A dan permukaan B harus clear (kosong).

• PICKUP(A) Ambil block A dari meja dan pegang. Arm harus empty dan harus tidak ada apa-apa di atas block A.

• PUTDOWN(A) Letakkan block A ke atas meja. Arm harus sudah holding block A.

Page 13: Intelegensia Semu - Planning

The Block World

Predicates :• ON (A,B) – Block A is on block B

• ONTABLE (A) – Block A is on the table

• CLEAR (A) – There is nothing on top of block A

• HOLDING (A) – The arm is holding block A

• ARMEMPTY – The arm is holding nothing

Page 14: Intelegensia Semu - Planning

Components of a Planning System

1. Choose the best rule to apply next based on the best available heuristic information (examine representation)

2. Applying rules (divide and conquer) : (If actions only affect small parts of state, solve sub-goal independently and merge sub-plans)

A B C D

A

DB

C

Page 15: Intelegensia Semu - Planning

Problem : Sub-goals can interfere

A B C

A

B

C

Getting A on B interferes with getting B on C

We might even have to undo satisfied sub-goals, e.g. :

A

B C

A

B

C

Page 16: Intelegensia Semu - Planning

STRIPS -Style Operator1. STACK(x,y) : place x on y, the arm must already

be holding x and the surface of y must be clear

1. P : CLEAR(y) HOLDING(x)2. D : CLEAR(y) HOLDING(x)3. A : ARMEMPTY ON(x,y)

2. UNSTACK(x,y) : pick up x from y, the arm must be empty and x must have no blocks on top of it

1. P : ON(x,y) CLEAR(y) ARMEMPTY2. D : ON(x,y) ARMEMPTY3. A : HOLDING(x) CLEAR(y)

STRIPS, STanford Research Institute Planning Systems

Page 17: Intelegensia Semu - Planning

STRIPS-Style Operator(cont’d)

3. PICKUP(x) : pick up x from the table and hold it. The arm must be empty and there must be nothing on top of block x.

P : CLEAR(x) ONTABLE(x) ARMEMPTYD : ONTABLE(x) ARMEMPTY A : HOLDING(x)

4. PUTDOWN(x) : put x down on the table, the arm must have been holding x

P : HOLDING(x)D : HOLDING(x)A : ONTABLE(x) ARMEMPTY

P, Precondition ; D, Deletion ; A, Add (list).

Page 18: Intelegensia Semu - Planning

A simple blocks world description

A

BON(A,B,S0) ONTABLE(B,S0) CLEAR(A,S0)

Applying operator UNSTACK(A,B), our description of the world would be:

ONTABLE(B,S1) CLEAR(A,S1) CLEAR(B,S1) HOLDING (A,S1)

Page 19: Intelegensia Semu - Planning

Goal Stack Planning

A

B

C D

C

DA

B

Start : ON(B,A) ONTABLE(A) ONTABLE(C) ONTABLE(D) ARMEMPTY

Goal: ON(C,A) ON (B,D) ONTABLE(A) ONTABLE(D)

Page 20: Intelegensia Semu - Planning

Planning Solution

UNSTACK(B,A)STACK(B,D)PICKUP(C)

STACK(C,A)

C

DA

B

A

B

C D

Page 21: Intelegensia Semu - Planning

Divide & Conquer

C

DA

B

ON(C,A) ON(B,D) ON(C,A) ON(B,D) ONTAD

ON(B,D) ON(C,A) ON(C,A) ON(B,D) ONTAD

(1) (2)

Page 22: Intelegensia Semu - Planning

Alternative 1

ON(C,A) ON(B,D) ON(C,A) ON(B,D) ONTAD

STACK(C,A) ON(B,D) ON(C,A) ON(B,D) ONTAD

CLEAR(A)

HOLDING(C)

ON(B,D) ON(C,A) ON(B,D) ONTADSUB-GOALS

A

B

C D

Page 23: Intelegensia Semu - Planning

Goal Stack PlanningUNSTACK(B,A)

ON(B,A) CLEAR(B) ARMEMPTYHOLDING(C)CLEAR(A) HOLDING(C)

STACK(C,A)

ON(B,D)

ON(C,A) ON(B,D) ONTAD

ONTABLE(A) ONTABLE(C) ONTABLE(D) HOLDING(B) CLEAR(A) database

CLEAR(A)HOLDING(C)

ON(B,D)

ON(C,A) ON(B,D) ONTAD

Page 24: Intelegensia Semu - Planning

Goal Stack Planning

PICKUP(C)

UNSTACK(C,x)

ON(B,A) CLEAR(B) ARMEMPTY

UNSTACK(B,A)

HOLDING(C)CLEAR(A) HOLDING(C)

STACK(C,A)

ON(B,D)

ON(C,A) ON(B,D) ONTAD

Page 25: Intelegensia Semu - Planning

Goal Stack Planning

PICKUP(C)ONTABLE(C) CLEAR(C) ARMEMPTY

CLEAR(A) HOLDING(C)

STACK(C,A)

ON(B,D)

ON(C,A) ON(B,D) ONTAD

UNSTACK(C,x)ON (C,x) CLEAR(C) ARMEMPTY

CLEAR(A) HOLDING(C)

STACK(C,A)

ON(B,D)

ON(C,A) ON(B,D) ONTAD

(1) (2)

Page 26: Intelegensia Semu - Planning

Goal Stack Planning

ON (C,x)CLEAR(A) HOLDING(C)

STACK(C,A) ON(B,D) ON(C,A) ON(B,D) ONTAD

CLEAR(x) HOLDING(C)STACK(C,x)

ON (C,x) CLEAR(C) ARMEMPTYUNSTACK(C,x)CLEAR(A) HOLDING(C)

STACK(C,A) ON(B,D) ON(C,A) ON(B,D) ONTAD

Page 27: Intelegensia Semu - Planning

Goal Stack Planning (back to alternative 1)

PICKUP(C)ONTABLE(C) CLEAR(C) ARMEMPTYONTABLE(C) (satisfied)CLEAR(C) (satisfied)ARMEMPTY (false since HOLDING(B) is true)

CLEAR(A) HOLDING(C)

STACK(C,A)

ON(B,D)

ON(C,A) ON(B,D) ONTAD

C

DA

BUNSTACK(B,A) has been called at the beginning

A

B

C D

Page 28: Intelegensia Semu - Planning

Goal Stack Planning (alternative 1)

CLEAR(D)HOLDING(B)CLEAR(D) HOLDING(B)STACK(B,D)

ONTABLE(C) CLEAR(C) ARMEMPTYPICKUP(C)CLEAR(A) HOLDING(C)

STACK(C,A)

ON(B,D) (done, using stack(B,D)

ON(C,A) ON(B,D) ONTAD

C

DA

BONTABLE(A) ONTABLE(C) ONTABLE(D) ON(B,D) ARMEMPTY

Now satisfied

Database updated

Page 29: Intelegensia Semu - Planning

Goal Stack Planning (alternative 1)

UNSTACK(B,A)STACK(B,D)PICKUP(C)

STACK(C,A)

C

DA

B

ON(B,A)CLEAR(B)ARMEMPTYON(B,A) CLEAR(B) ARMEMPTYUNSTACK(B,A)CLEAR(D)HOLDING(B)CLEAR(D) HOLDING(B)STACK(B,D)ONTABLE(C)CLEAR(C)ARMEMPTYONTABLE(C) CLEAR(C) ARMEMPTYPICKUP(C)CLEAR(A) HOLDING(C)STACK(C,A) ON(B,D) ON(C,A) ON(B,D) ONTAD

A

B

C D

Page 30: Intelegensia Semu - Planning

Another Problem

C

A

B

A B

C

Start :

ON(C,A) ONTABLE(A) ONTABLE(B) ARMEMPTY

Goal :

ON(A,B) ON(B,C)

Page 31: Intelegensia Semu - Planning

Two (2) Solution

C

A

B

ON(A,B)

ON(B,C)

ON(A,B) ON(B,C)

ON(B,C)

ON(A,B)

ON(A,B) ON(B,C)

(1) (2)

A B

C

Page 32: Intelegensia Semu - Planning

C

A

B

ON(C,A)CLEAR(C)ARMEMPTYUNSTACK(C,A)ARMEMPTYCLEAR(A) ARMEMPTYPICKUP(A)CLEAR(B) HOLDING(A)STACK(A,B) ON(B,C) ON(A,B) ON(B,C)

A B

C

Page 33: Intelegensia Semu - Planning

C

A

B

Goal stack:ON(B,C) ON(A,B) ON(B,C)

Current state:ONTABLE(B) ON(A,B) ONTABLE(C) ARMEMPTY

ON(C,A)CLEAR(C)ARMEMPTYUNSTACK(C,A)ARMEMPTYCLEAR(A) ARMEMPTYPICKUP(A)CLEAR(B) HOLDING(A)STACK(A,B) ON(B,C) ON(A,B) ON(B,C)

Page 34: Intelegensia Semu - Planning

C

A

B

UNSTACK(C,A)ARMEMPTY (PUTDOWN(C))PICKUP(A)STACK(A,B) ON(B,C) ON(A,B) ON(B,C)

C A

B

UNSTACK(C,A)PUTDOWN(C)PICKUP(A)STACK(A,B) UNSTACK(A,B)PUTDOWN(A)PICKUP(B)STACK(B,C)ON(A,B) ON(B,C)CHECK

Page 35: Intelegensia Semu - Planning

C A

B UNSTACK(C,A)PUTDOWN(C)PICKUP(A)STACK(A,B) UNSTACK(A,B)PUTDOWN(A)PICKUP(B)STACK(B,C)PICKUP(A)STACK(A,B)

C

A

B

UNSTACK(C,A)PUTDOWN(C)PICKUP(B)STACK(B,C)PICKUP(A)STACK(A,B)

Page 36: Intelegensia Semu - Planning

Blocks World

• PickUp(X)– X on table, hand empty, X

free

• PutDown(X)– X in hand

• Stack(X,Y)– X in hand, y free

• Unstack(X,Y)– X free, X on Y, hand free

A B

Initial State

AB

Goal State

Page 37: Intelegensia Semu - Planning

Blocks World (cont)

Page 38: Intelegensia Semu - Planning

Partial Ordered PlanningIntroduction

• A partially ordered plan is a general representation of

plans.

• Idea:– Working parallel on several sub-goals.

– Ordering of goals based on interactions

• Underlying assumption:

– Not many interactions.

• Partially ordered plan = directed graph (AND).

Page 39: Intelegensia Semu - Planning

Partial Ordered PlanningAn Example

Page 40: Intelegensia Semu - Planning

STRIPS (cont)

Figure 10.1. STRIPS representation for (1) opening a door (2) closing a door.

Page 41: Intelegensia Semu - Planning

STRIPS Example

Figure 10.2. Example of STRIPS Planning (Operator Schema & Initial Model).

Page 42: Intelegensia Semu - Planning

STRIPS Example (cont)

Figure 10.3. Example of STRIPS Planning (Goal wff and Plan).

Page 43: Intelegensia Semu - Planning
Page 44: Intelegensia Semu - Planning

1/15/2011 T0264 - Artificial Intelligence 44

» Goal stack planning dalam treeGoal stack planning dalam tree

ONTABLE(D)

CLEAR(C)

ARMEMPTYONTABLE(C)CLEAR(C)

ARMEMPTYON(C,A)

STACK(C,A)

CLEAR(D) HOLDING(B)

GOAL

ON(C,A)ON(B,D)

ONTABLE(A)

CLEAR(A)UNSTACK(B,A)

HOLDING(C)

PICKUP(C) UNSTACK(C,A)

ON(B,A)CLEAR(B)

ARMEMPTY

CLEAR(A) HOLDING(C)STACK(B,D) PUTDOWN(B)

STACK(C,A)

Page 45: Intelegensia Semu - Planning

1/15/2011 T0264 - Artificial Intelligence 45

On(B,C)On(B,C)

Start State (KB) : Ontable(A), On(C,A), Clear(C), Ontable(B), Clear(B), Empty, Start State (KB) : Ontable(A), On(C,A), Clear(C), Ontable(B), Clear(B), Empty,

Empty

Unstack(C,A)

On(C,A) Clear(C)

Clear(C)

Holding (C)

GOALGOAL

Putdown(C)

Linear Planning (Goal Stack)Linear Planning (Goal Stack)

CC

AA BB

On(A,B)On(A,B)

Empty

EmptyEmpty

Ontable(C)Ontable(C)

Clear(A)

Clear(A)Clear(A)

CC

AA

BB

Page 46: Intelegensia Semu - Planning

1/15/2011 T0264 - Artificial Intelligence 46

On(B,C)On(B,C)

Start State : Empty, Ontable(A), On(C,A), Clear(C), Ontable(B), Clear(B) Start State : Empty, Ontable(A), On(C,A), Clear(C), Ontable(B), Clear(B)

Stack(B,C)

Empty

Unstack(C,A)

On(C,A) Clear(C)

Clear(B)EmptyClear(C)

Holding(B)

Pickup(B)

Ontable(B)

Clear(B)

Empty

Holding (C)

GOALGOAL

Putdown(C)

CC

AA BB

On(A,B)On(A,B)

Empty

EmptyEmpty

Ontable(C)Ontable(C)

Clear(C)

Clear(A)

Clear(A)Clear(A)

Page 47: Intelegensia Semu - Planning

1/15/2011 T0264 - Artificial Intelligence 47

On(B,C)On(B,C)

Start State : Empty, Ontable(A), On(C,A), Clear(C), Ontable(B), Clear(B) Start State : Empty, Ontable(A), On(C,A), Clear(C), Ontable(B), Clear(B)

Stack(B,C)

Empty

Unstack(C,A)

On(C,A) Clear(C)

Clear(B)EmptyClear(C)

Holding(B)

Pickup(B)

Ontable(B)

Clear(B)

Empty

Holding (C)

GOALGOAL

Putdown(C)

CC

AA BB

Stack(A,B)

On(A,B)On(A,B)Clear(A)Clear(A)

Clear(B)Holding(A)

Pickup(A)

EmptyOntable(A)

Clear(A)

Empty

EmptyEmpty

Ontable(C)Ontable(C)

Clear(C)

Clear(A)

Page 48: Intelegensia Semu - Planning

Kasus 1

C

A

BA B

C

Start :

ON(C,A) ONTABLE(A) ONTABLE(B) ARMEMPTY

Goal :

ON(A,B) ON(B,C)

Page 49: Intelegensia Semu - Planning

• A Very Simple Blocks World Problem

BB E A EA C D C D

Kasus 2

Page 50: Intelegensia Semu - Planning

• A Very Simple Blocks World Problem

AC E B DB A D C E

Kasus 3

Page 51: Intelegensia Semu - Planning

• Buatlah suatu urutan logika perencanaan• Jika saudara diminta membuat Planning

jadwal “take off” 5 buah pesawat (no. pes. 1, 2, 3, 4, dan 5) yang sedang parkir di hanggar setelah diperbaiki. Kondisi awal urutan parkir pesawat 3, 2, 4, 5, dan 1

• Target pesawat take off dengan urutan 1, 2, 3, 4, dan 5

• Jika perlu tambahkan suatu informasi/ kondisi 3 2 4 5 1 5 4 3 2 1

Initial State Goal State

Page 52: Intelegensia Semu - Planning

AI Planning Is Different in PracticeThan it Was in Theory

Unstack(x,y) Pre: on(x,y), clear(x), handempty Del: on(x,y), clear(x), handempty Add: holding(x), clear(y)

• Theory:

– Symbolic computations (STRIPS operators)

– Single agent (the planner)

– Perfect information

• Practice:

– Complex numeric computations(geometry, images, probabilities)

– Multiple agents

– Imperfect information, external information sources

Page 53: Intelegensia Semu - Planning

Sampai Jumpa di

Pertemuan 19

Selamat Belajar