AI – Week 5 An Introduction to AI Planning Lee McCluskey, room 2/07

Slides:



Advertisements
Similar presentations
Uninformed Search in Prolog
Advertisements

Heuristic Search techniques
Language for planning problems
Hierarchical Task Network (HTN) Planning Hai Hoang 4/17/2007.
Planning Module THREE: Planning, Production Systems,Expert Systems, Uncertainty Dr M M Awais.
Planning Module THREE: Planning, Production Systems,Expert Systems, Uncertainty Dr M M Awais.
PROBLEM SOLVING AND SEARCH
PLANNING Ivan Bratko Acknowledgement: Some of these slides were adapted from D. Nau’s course on planning.
October 1, 2012Introduction to Artificial Intelligence Lecture 8: Search in State Spaces II 1 A General Backtracking Algorithm Let us say that we can formulate.
AI – Week 5 Implementing your own AI Planner in Prolog – part II : HEURISTICS Lee McCluskey, room 2/09
September 26, 2012Introduction to Artificial Intelligence Lecture 7: Search in State Spaces I 1 After our “Haskell in a Nutshell” excursion, let us move.
AI – Week 11 AI and Games (3) Lee McCluskey, room 2/09
Problem Solving and Search in AI Part I Search and Intelligence Search is one of the most powerful approaches to problem solving in AI Search is a universal.
ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM] Professor Janis Grundspenkis Riga Technical University Faculty of Computer Science and Information.
AI – Week AI Planning – Plan Generation Algorithms: GraphPlan Lee McCluskey, room 2/09
Planning Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 11.
1 Using Search in Problem Solving Part II. 2 Basic Concepts Basic concepts: Initial state Goal/Target state Intermediate states Path from the initial.
Using Search in Problem Solving
Artificial Intelligence Chapter 11: Planning
Constraint Logic Programming Ryan Kinworthy. Overview Introduction Logic Programming LP as a constraint programming language Constraint Logic Programming.
The Semantic Web Week 18: Web Agents that can reason … Module Website: Practical this week:
Introduction to Artificial Intelligence Blind Search Ruth Bergman Fall 2004.
Constraint Satisfaction Problems
Week 4: Introduction to AI Planning Lee McCluskey, room 2/07
Planning Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 11.
Using Search in Problem Solving
Branch and Bound Algorithm for Solving Integer Linear Programming
Automated Planning and HTNs Planning – A brief intro Planning – A brief intro Classical Planning – The STRIPS Language Classical Planning – The STRIPS.
Solving problems by searching
Backtracking.
AI – Week 10 AI and Games (2) Lee McCluskey, room 3/10
For Friday Finish chapter 3 Homework: –Chapter 3, exercise 6 –May be done in groups. –Clarification on part d: an “action” must be running the program.
Classical Planning Chapter 10.
Review: Search problem formulation Initial state Actions Transition model Goal state (or goal test) Path cost What is the optimal solution? What is the.
Busby, Dodge, Fleming, and Negrusa. Backtracking Algorithm Is used to solve problems for which a sequence of objects is to be selected from a set such.
Week 6: PDDL, itSIMPLE and running “state of the art” planners Lee McCluskey, room 3/10
Artificial Intelligence Lecture 9. Outline Search in State Space State Space Graphs Decision Trees Backtracking in Decision Trees.
Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:
Do you drive? Have you thought about how the route plan is created for you in the GPS system? How would you implement a cross-and- nought computer program?
CHA2555 Week2: Knowledge Representation, Logic and Planning Lee McCluskey First term:
Planning (Chapter 10)
CS 415 – A.I. Slide Set 5. Chapter 3 Structures and Strategies for State Space Search – Predicate Calculus: provides a means of describing objects and.
Lecture 7: Uninformed Search Dr John Levine Algorithms and Complexity February 13th 2006.
Lecture 3: Uninformed Search
AI Lecture 17 Planning Noémie Elhadad (substituting for Prof. McKeown)
1 Solving problems by searching Chapter 3. Depth First Search Expand deepest unexpanded node The root is examined first; then the left child of the root;
Basic Problem Solving Search strategy  Problem can be solved by searching for a solution. An attempt is to transform initial state of a problem into some.
CSCI 4310 Lecture 2: Search. Search Techniques Search is Fundamental to Many AI Techniques.
AI – Week 5 More on HEURISTICS and domain modelling Lee McCluskey, room 2/09
George F Luger ARTIFICIAL INTELLIGENCE 5th edition Structures and Strategies for Complex Problem Solving Structures and Strategies For Space State Search.
Search in State Spaces Problem solving as search Search consists of –state space –operators –start state –goal states A Search Tree is an efficient way.
Planning I: Total Order Planners Sections
Natural Language Processing AI Revision Lee McCluskey, room 2/07
February 11, 2016Introduction to Artificial Intelligence Lecture 6: Search in State Spaces II 1 State-Space Graphs There are various methods for searching.
AI – Week 3 An Introduction to AI Planning Lee McCluskey, room 3/10
By J. Hoffmann and B. Nebel
Biointelligence Lab School of Computer Sci. & Eng. Seoul National University Artificial Intelligence Chapter 8 Uninformed Search.
Lecture 3: Uninformed Search
Breadth First and Depth First
Introduction Contents Sungwook Yoon, Postdoctoral Research Associate
Artificial Intelligence Problem solving by searching CSC 361
Chapter 10: Algorithm Design Techniques
Depth-First Searches Introduction to AI.
Principles of Computing – UFCFA3-30-1
CSE (c) S. Tanimoto, 2001 Search-Introduction
Haskell Tips You can turn any function that takes two inputs into an infix operator: mod 7 3 is the same as 7 `mod` 3 takeWhile returns all initial.
CSE (c) S. Tanimoto, 2002 State-Space Search
Graphplan/ SATPlan Chapter
Graphplan/ SATPlan Chapter
CSE (c) S. Tanimoto, 2004 State-Space Search
Presentation transcript:

AI – Week 5 An Introduction to AI Planning Lee McCluskey, room 2/07

Artform Research Group Overview How do we make automated planning programs? - we will consider several planning algorithms How do we model planning application knowledge? - we will study several ways of encoding planning domains

Artform Research Group PLANS Are what planners generate. They are orders of instantiated operator schemas. They should be: CORRECT - preconditions are satisfied COMPLETE - achieve the final goal OPTIMAL - n shorter plan exists

Artform Research Group Simple Planning Worlds A simple planning problem can be formulated by: - An INITIAL STATE - A GOAL - A set of OPERATOR schema Later we will see other formulations.,.

Artform Research Group Recall Last Week: The Modelling of States A STATE represents a situation or snapshot of an application. This is sometimes called a WORLD STATE STATES of a planning world are most simply defined (as in PDDL) as conjunctions of ground literals (like a relational database for each state) In object centred representations, dynamic OBJECTS have their own state also (sometimes called ‘sub- state’). A world state therefore consists of a conjunction of the states of each object.

Artform Research Group Recall Last Week: The Modelling of Actions This is CENTRAL to planning. Most simply, actions are modelled as OPERATORS with PRE and POST conditions in the form of n PRECONDITION SET n ADD SET n DELETE SET In object – centred notations we use a more structured form: n PREVAIL CONDITION n NECESSARY OBJECT TRANSITIONS n CONDITIONAL OBJECT TRANSITIONS

Artform Research Group The Relationship: from O-C to Literal-based (assume no conditional transitions) n PRECONDITION SET = PREVAIL + LHS of NECESSARY OBJECT TRANSITIONS n ADD SET = RHS of NECESSARY OBJECT TRANSITIONS n DELETE SET = LHS of NECESSARY OBJECT TRANSITIONS So can define things in terms of a literal-based representation, and they will also apply to an OC one.

Artform Research Group Operators - An Operator Schema O has Precons(O), Deletes(O) and Adds(O) - An instance of an Operator Schema (a ground operator) is one which has all its parameters are replaced by constants. (NB two instances may have different effects because of conditional effects) A ground operator O can be applied to a state S IF Precons(O) are satisfied in S If operator O is applied/executed to state S then new state O(S) = S minus Deletes(O) plus Adds(O) [More complex for a conditional Operator]

Artform Research Group Automated Planning How can algorithms solve planning problems? - Easiest answer: 1. Apply ‘applicable’ OPERATORS to INITIAL STATE to create new states, then repeat this process from new states (use breadth, depth or heuristic search). 2. Stop when a state S is reached in which S satisfies the GOAL condition BUT this leads to an exponential explosion of states!

Artform Research Group Solution to Plan Generation Problems A “goal achievement” plan generation problem is given by an Initial state, a Goal and a set of Operator Schema. A linear SOLUTION to a plan generation problem is a sequence of ground operators that are COMPLETE and CORRECT: Complete: The preconditions of the first operator are satisfied by the Initial state, and the preconditions of each subsequent operator in the sequence are satisfied by the corresponding intermediate states Correct: The Goal is satisfied in the final state

Artform Research Group FORWARD, STATE SPACE SEARCH INITIAL STATE Main source of inefficiency in search algorithms is the branching factor EXHAUSTIVE SEARCH IS VERY INEFFICIENT!!! Assume each state is modelled as a set of LITERALS

Artform Research Group Planning Algorithm: breadth-first forward search through state-space 1. Store the first node (initial state + empty solution) Repeat 2. pick and “retract” a node(State, Soln, heuristic value) 3. pick an operator and parameter grounding - 'O' - that can be applied to State 4. apply O to State to get State' 5. assert(node(State', Soln++[O], heuristic value) 6. if possible, backtract to 3. and make a different choice. until a node has been asserted that contains a solution

Artform Research Group Building your own forward searching planner INITIAL NODE Each node is a state + sequence of operators that lead to the state + heuristic value

Artform Research Group Initialisation – assert the first node % asserts the root node in the search.. start(Goal, Initial_State) :- % this records the run-time clock statistics(runtime,[_,Time]), % initialise node count to 0 retractall(count(_)), assert(count(0)), assert_and_record_node( node(Initial_State,[ ])), plan(Goal).

Artform Research Group Pick a node to EXPAND % Retracts the first node in the prolog program and expands it.. % a node is of the form node(Advanced_state, Op_sequence) plan(Goal) :- retract(node(Advanced_state, Op_sequence)), length(Op_sequence,Len), tell(user),write(Len), process_node(Goal, Advanced_state, Op_sequence), % then keep searching.. plan(Goal). % SEARCH FINISHES: if no nodes left - end - close trace file plan(_) :- tell(trace), told.

Artform Research Group But wait.. have we found a complete plan? process_node(Goal, Advanced_state, Op_sequence):- achieved(Goal, Advanced_state), ETC.. Collect stats and tidy up retractall(node(_,_)),!. % if no success, generate more nodes process_node(Goal, Advanced_state, Op_sequence):- generate_new_nodes(Advanced_state, Op_sequence),!.

Artform Research Group Heart of the Algorithm – generate new nodes generate_new_nodes(Advanced_state, Op_sequence) :- op(Op_name, Prev, Nec, Cond), achieved(Prev,Advanced_state), lhs_achieved(Nec,Advanced_state), % apply(Op_name, Advanced_state, New_Advanced_state), append(Op_sequence, [Op_name], New_Op_sequence), assert_and_record_node(node(New_Advanced_state, New_Op_sequence)), fail. % after all operators are tried, this procedure should succeed - generate_new_nodes(_,_).

Artform Research Group Are object states achieved in a state? NB no cuts to allow for backtracking lhs_achieved([],_). lhs_achieved([trans(O,E,_)|Tail],State) :- member(state(O,S),State), is_a_subset(E,S), lhs_achieved(Tail,State). achieved([],_). achieved([condition(O,E)|Tail], State) :- member(state(O,S),State), is_a_subset(E,S), achieved(Tail,State).

Artform Research Group Summary n Creating forward search AI Planners in Prolog is fairly easy n The main part is the generation of ALL new nodes possible from an existing node n The sample AI Planners can be augmented with heuristics (next week)