• No results found

Advanced Artificial Intelligence (Multi-Agent Systems) Dr. Muhammad Adnan Hashmi

N/A
N/A
Protected

Academic year: 2020

Share "Advanced Artificial Intelligence (Multi-Agent Systems) Dr. Muhammad Adnan Hashmi"

Copied!
58
0
0

Loading.... (view fulltext now)

Full text

(1)

Advanced Artificial Intelligence

(Multi-Agent Systems)

(2)
(3)

3

What is an Agent?

■ An agent is a computer system capable of autonomous

action in some environment in order to meet its design objectives (goals).

(4)

4

Planning

■ Finding a sequence of actions that takes agent from

Initial State to Goal State

Initial state: clear(c), on(c,a), ontable(a), clear(b), ontable(b), handempty c a b Goal: on(a,b), on(b,c) c a b c a b a b c a c b c a b

(5)

Domain-Independent Planning

Inputs:

Domain Action Theory

Problem Instance

Description of (initial) state of the world Specification of desired goal behavior

Output: sequence of actions that executed in

initial state satisfy goal

(6)

Representation Languages

Languages must represent..

States Goals Actions

Languages must be

Expressive for ease of representation Flexible for manipulation by algorithms

(7)

Example Problem Instance:

Initial State: (on-table A) (on C A) (on-table B) (clear B) (clear C)

Goal: (on A B) (on B C)

A B

C

A

B

C Initial State: Goal:

(8)

Example Problem Instance:

STRIPS Representation

Initial State: (and (on-table A) (on C A)

(on-table B) (clear B) (clear C)) Goal: (and (on A B) (on B C))

A B

C

A

B

C Initial State: Goal:

(9)

Action Representation:

Propositional STRIPS

Move-C-from-A-to-Table:

preconditions: (on C A) (clear C) effects:

add (on-table C) delete (on C A) add (clear A)

Solution to frame problem: explicit effects are the only changes to the state.

(10)

Action Representation:

Propositional STRIPS

Move-C-from-A-to-Table:

preconditions: (and (on C A) (clear C)) effects:

(and (on-table C) (not (on C A))

(clear A))

Solution to frame problem: explicit effects are the only changes to the state.

(11)

Different Concerns during Knowledge

Representation

Frame problem:

How to specify what does not change

Qualification problem

Hard to specify all preconditions

Ramification problem

(12)

“Classical Planning” Assumptions

Atomic Time

Deterministic

Fully Observable

Static

Goals of attainment

(13)

Plan Generation:

Search space of world states

Planning as a (graph) search problem

Nodes: world states

Arcs: actions

Solution: path from the initial state to one

state that satisfies the goal

Initial state is fully specified There are many goal states

(14)

Progression:

Forward search (I -> G)

ProgWS(state, goals, actions, path)

If state satisfies goals, then return path else a = choose(actions), s.t.

preconditions(a) satisfied in state if no such a, then return failure

else return

ProgWS(apply(a, state), goals, actions, concatenate(path, a))

(15)

Progression Example:

I: (on-table A) (on C A) (on-table B) (clear B) (clear C) G: (on A B) (on B C) ■ P(I, G, BlocksWorldActions, ()) ■ P(S1, G, BWA, (move-C-from-A-to-table)) ■ P(S2, G, BWA, (move-C-from-A-to-table, move-B-from-table-to-C)) ■ P(S3, G, BWA, (move-C-from-A-to-table, move-B-from-table-to-C, move-A-from-table-to-B)) G ⊆ S3 => Success! Non-Deterministic Choice!

(16)

Regression:

Backward Search (I <- G)

RegWS(init-state, current-goals, actions, path)

If init-state satisfies current-goals, then return path else a =choose (actions), s.t. some effect of a

satisfies one of current-goals

If no such a, then return failure [unachievable*]

If some effect of a contradicts some of current-goals, then return failure [inconsistent state] CG’ = current-goals – effects(a) + preconditions(a) If current-goals ⊂ CG’, then return failure [useless*]

RegWS(init-state, CG’, actions, concatenate(a,path))

(17)

Regression Example:

I: (on-table A) (on C A) (on-table B) (clear B) (clear C) G: (on A B) (on B C)

■ R(I, G, BlocksWorldActions, ())

■ R(I, ((clear A) (on-table A) (clear B) (on B C)), BWA,

(move-A-from-table-to-B))

■ R(I, ((clear A) (on-table A) (clear B) (clear C), (on-table B)),

BWA, (move-B-from-table-to-C, move-A-from-table-to-B))

■ R(I, ((on-table A) (clear B) (clear C) (on-table B) (on C A)),

BWA, (move-C-from-A-to-table, move-B-from-table-to-C, move-A-from-table-to-B))

current-goals ⊆ I => Success!

Non-Deterministic Choice!

(18)

Regression Example:

I: (on-table A) (on C A) (on-table B) (clear B) (clear C) G: (on A B) (on B C) ■ P(I, G, BlocksWorldActions, ()) ■ P(S1, G, BWA, (move-C-from-A-to-table)) ■ P(S2, G, BWA, (move-C-from-A-to-table, move-B-from-table-to-C)) ■ P(S3, G, BWA, (move-C-from-A-to-table, move-B-from-table-to-C, move-A-from-table-to-B)) G ⊆ S3 => Success! Non-Deterministic Choice!

(19)
(20)

Plan Generation:

Search space of plans

Partial-Order Planning (POP)

Nodes are partial plans

Arcs/Transitions are plan refinements

Solution is a node (not a path).

Principle of “Least commitment”

e.g. do not commit to an order of actions until

(21)

Partial Plan Representation

■ Plan = (A, O, L), where

A: set of actions in the plan

O: temporal orderings between actions (a < b) L: causal links linking actions via a literal

■ Causal Link:

Action Ac (consumer) has precondition Q that is established in the plan by Ap (producer).

move-a-from-b-to-table move-c-from-d-to-b

Ap Q Ac

(22)

Threats to causal links

Step A

t

threatens link (A

p

, Q, A

c

) if:

1. A

t

has (not Q) as an effect, and

2. A

t

could come between A

p

and A

c

, i.e.

O ∪ (A

p

< A

t

< A

c

) is consistent

What’s an example of an action that threatens

the link example from the last slide?

(23)

Initial Plan

For uniformity, represent initial state and goal with two special actions:

■ A

0:

no preconditions,

initial state as effects,

must be the first step in the plan. ■ A

∞:

no effects

goals as preconditions

(24)

POP algorithm

POP((A, O, L), agenda, actions)

If agenda = () then return (A, O, L) Pick (Q, aneed) from agenda

aadd = choose(actions) s.t. Q ∈effects(aadd) If no such action aadd exists, fail.

L’ := L ∪ (aadd, Q, aneed) ; O’ := O ∪ (aadd < aneed) agenda’ := agenda - (Q, aneed)

If aadd is new, then A := A ∪ aadd and

∀P ∈preconditions(aadd), add (P, aadd) to agenda’

For every action at that threatens any causal link (ap, Q, ac) in L’ choose to add at < ap or ac < at to O.

If neither choice is consistent, fail. POP((A’, O’, L’), agenda, actions)

Termination

Action Selection

Update goals

Protect causal links - Demotion: at < ap - Promotion: ac < at

(25)

POP

POP is sound and complete

POP Plan is a solution if:

All preconditions are supported (by causal links), i.e., no open conditions.

No threats

Consistent temporal ordering

By construction, the POP algorithm reaches a

(26)

POP example:

Sussman Anomaly

Ain f (on A B) (on B C) A0

(27)

Work on open precondition (on B C)

A0

(on C A) (on-table A) (on-table B) (clear C) (clear B)

A1: move B from Table to C

(on B C) -(on-table B) -(clear C)

(clear B) (clear C) (on-table B)

(on A B) (on B C)

Ain f

(28)

Work on open precondition (on A B)

(on A B) (on B C)

A2: move A from Table to B

(clear A) (clear B) (on-table A) (on A B) -(on-table A) -(clear B)

A0

(on C A) (on-table A) (on-table B) (clear C) (clear B)

A1: move B from Table to C

(on B C) -(on-table B) -(clear C)

(clear B) (clear C) (on-table B)

Ain f

(29)

Protect causal links

(on A B) (on B C)

A2: move A from Table to B

(clear A) (clear B) (on-table A) (on A B) -(on-table A) -(clear B)

A0

(on C A) (on-table A) (on-table B) (clear C) (clear B)

A1: move B from Table to C

(on B C) -(on-table B) -(clear C)

(clear B) (clear C) (on-table B)

Ain f (A0, (clear B), A1) theatened by A2 --> Promotion

(30)

Work on open precondition (clear A)

(on A B) (on B C)

A2: move A from Table to B

(clear A) (clear B) (on-table A) (on A B) -(on-table A) -(clear B)

A3: move C from A to Table

(clear C) (on C A)

-(on C A) (on-table C) (clear A)

A0

(on C A) (on-table A) (on-table B) (clear C) (clear B)

A1: move B from Table to C

(on B C) -(on-table B) -(clear C)

(clear B) (clear C) (on-table B)

Ain f

(31)

Final plan

(on A B) (on B C)

A2: move A from Table to B

(clear A) (clear B) (on-table A) (on A B) -(on-table A) -(clear B)

A3: move C from A to Table

(clear C) (on C A)

-(on C A) (on-table C) (clear A)

A0

(on C A) (on-table A) (on-table B) (clear C) (clear B)

A1: move B from Table to C

(on B C) -(on-table B) -(clear C)

(clear B) (clear C) (on-table B)

Ain f

(32)
(33)

Basic idea

Construct a graph that encodes constraints

on possible plans

Use this “planning graph” to constrain search

for a valid plan:

If valid plan exists, it’s a subgraph of the planning graph

Planning graph can be built for each problem

(34)

Problem handled by GraphPlan

*

Pure STRIPS operators:

conjunctive preconditions no negated preconditions no conditional effects

no universal effects

Finds “shortest parallel plan”

Sound, complete and will terminate with

failure if there is no plan.

*Version in [Blum& Furst IJCAI 95, AIJ 97],

(35)

Planning graph

■ Directed, leveled graph 2 types of nodes:

■ Proposition: P ■ Action: A

3 types of edges (between levels)

■ Precondition: P -> A ■ Add: A -> P

■ Delete: A -> P

■ Proposition and action levels alternate

■ Action level includes actions whose preconditions are satisfied in previous level plus no-op actions (to solve frame problem).

(36)
(37)

Planning graph

(38)

Constructing the planning graph

Level P

1

: all literals from the initial state

Add an action in level A

i

if all its preconditions

are present in level P

i

Add a precondition in level P

i

if it is the effect

of some action in level A

i-1

(including no-ops)

Maintain a set of exclusion relations to

eliminate incompatible propositions and

actions (thus reducing the graph size)

(39)

Mutual Exclusion relations

Two actions (or literals) are mutually

exclusive (mutex) at some stage if no valid

plan could contain both.

Two actions are mutex if:

Interference: one clobbers others’ effect or precondition

Competing needs: mutex preconditions

Two propositions are mutex if:

(40)

Mutual Exclusion relations

Inconsistent Effects Inconsistent Support Competing Needs Interference (prec-effect)

(41)

Dinner Date example

■ Initial Conditions: (and (garbage) (cleanHands) (quiet)) ■ Goal: (and (dinner) (present) (not (garbage))

■ Actions:

Cook :precondition (cleanHands) :effect (dinner)

Wrap :precondition (quiet) :effect (present)

Carry :precondition

:effect (and (not (garbage)) (not (cleanHands)) Dolly :precondition

(42)
(43)
(44)

Observation 1

Propositions monotonically increase

(always carried forward by no-ops)

p ¬q ¬r p q ¬q ¬r p q ¬q r ¬r p q ¬q r ¬r A A B A B

(45)

Observation 2

Actions monotonically increase

p ¬q ¬r p q ¬q ¬r p q ¬q r ¬r p q ¬q r ¬r A A B A B

(46)

Observation 3

Proposition mutex relationships monotonically decrease

p q r … A p q r … p q r …

(47)

Observation 4

Action mutex relationships monotonically decrease

p q … B p q r s … p q r s … A C B C A p q r s … B C A

(48)

Observation 5

Planning Graph ‘levels off’.

After some time k all levels are identical

Because it’s a finite space, the set of literals

never decreases and mutexes don’t

reappear.

(49)

Valid plan

A valid plan is a planning graph where:

Actions at the same level don’t interfere

Each action’s preconditions are made true by

the plan

(50)

GraphPlan algorithm

Grow the planning graph (PG) until all goals

are reachable and not mutex. (If PG levels off

first, fail)

Search the PG for a valid plan

If non found, add a level to the PG and try

(51)

Searching for a solution plan

■ Backward chain on the planning graph

■ Achieve goals level by level

■ At level k, pick a subset of non-mutex actions to achieve current goals. Their preconditions

become the goals for k-1 level.

■ Build goal subset by picking each goal and choosing an action to add. Use one already selected if possible. Do forward checking on remaining goals (backtrack if can’t pick

(52)

Plan Graph Search

If goals are present & non-mutex: Choose action to achieve each goal Add preconditions to next goal set

(53)

Termination for unsolvable problems

■ Graphplan records (memoizes) sets of

unsolvable goals:

U(i,t) = unsolvable goals at level i after stage t. ■ More efficient: early backtracking

■ Also provides necessary and sufficient conditions for termination:

Assume plan graph levels off at level n, stage t > n If U(n, t-1) = U(n, t) then we know we’re in a loop and can terminate safely.

(54)

Dinner Date example

■ Initial Conditions: (and (garbage) (cleanHands) (quiet)) ■ Goal: (and (dinner) (present) (not (garbage))

■ Actions:

Cook :precondition (cleanHands) :effect (dinner)

Wrap :precondition (quiet) :effect (present)

Carry :precondition

:effect (and (not (garbage)) (not (cleanHands)) Dolly :precondition

(55)
(56)
(57)
(58)

58

References

Related documents

Paid: Job Placement, 30-day retention, 180-day retention Total Served: 4,533 Basic Ed: 361 Occupational Skills Training: 395 Subsidized Transitional Employment: 14 Internships:

Leading Japanese manufacturers have used target costing and target pricing systems to their advantage and the paper also examines the adaptation of the Western companies to

If simplified, this study attempts to answer the following questions; is the top down policy implementation model currently in place in South Africa the reason for this lag? Or

Teamlease  is  one  of  India’s  leading providers  of  human  resource  services  in 

Contribution on maximal pattern mining From the contributions on dualiza- tion, we deduce a new classification of pattern mining problems. We point out how known problems

Best Practices Approach for Client’s Specific Needs pp p Strategy, Assessment  &amp; Roadmap Litigation Readiness &amp;  e‐Discovery  Automation

This individual Small Business Subcontracting Plan describes our approach to involving small business (SB), veteran-owned small business (VOSB), service-disabled veteran-owned small

División Plantas Vasculares, Facultad de Ciencias Naturales y Museo, Universidad Nacional de La Plata.. 2: