AI – Week 5 More on HEURISTICS and domain modelling Lee McCluskey, room 2/09

Slides:



Advertisements
Similar presentations
Artificial Intelligence: Knowledge Representation
Advertisements

Heuristic Search techniques
CPSC 388 – Compiler Design and Construction
CSE391 – 2005 NLP 1 Planning The Planning problem Planning with State-space search.
Planning  We have done a sort of planning already  Consider the “search” applied to general problem solving  The sequence of moves with the “Jugs” was.
Semantics Static semantics Dynamic semantics attribute grammars
Planning Module THREE: Planning, Production Systems,Expert Systems, Uncertainty Dr M M Awais.
Intermediate Code Generation
CS344: Introduction to Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 10– Club and Circuit Examples.
Planning Module THREE: Planning, Production Systems,Expert Systems, Uncertainty Dr M M Awais.
CLASSICAL PLANNING What is planning ?  Planning is an AI approach to control  It is deliberation about actions  Key ideas  We have a model of the.
ICE1341 Programming Languages Spring 2005 Lecture #6 Lecture #6 In-Young Ko iko.AT. icu.ac.kr iko.AT. icu.ac.kr Information and Communications University.
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.
The Semantic Web Week 20: Agents that can plan and learn.. Module Website: Practical this week:
AI – Week 5 Implementing your own AI Planner in Prolog – part II : HEURISTICS Lee McCluskey, room 2/09
AI – Week 11 AI and Games (3) Lee McCluskey, room 2/09
AI - Week 13 Knowledge Representation, Logic, Semantic Web Lee McCluskey, room 2/07
CPSC 322, Lecture 18Slide 1 Planning: Heuristics and CSP Planning Computer Science cpsc322, Lecture 18 (Textbook Chpt 8) February, 12, 2010.
Constraint Logic Programming Ryan Kinworthy. Overview Introduction Logic Programming LP as a constraint programming language Constraint Logic Programming.
CHA2555 Week 7: Prolog: Some Tips Planners: Some Tips Lee McCluskey First term:
AI – Week 5 An Introduction to AI Planning Lee McCluskey, room 2/07
Week 4: Introduction to AI Planning Lee McCluskey, room 2/07
AI - Week 24 Uncertain Reasoning (quick mention) then REVISION Lee McCluskey, room 2/07
Modelling Conceptual Knowledge using Logic - Week 6 Lee McCluskey Department of Computing and Mathematical Sciences University of Huddersfield.
AI – Week 8 AI + 2 Player Games Lee McCluskey, room 3/10
Uninformed Search Reading: Chapter 3 by today, Chapter by Wednesday, 9/12 Homework #2 will be given out on Wednesday DID YOU TURN IN YOUR SURVEY?
Data Structures Introduction. What is data? (Latin) Plural of datum = something given.
School of Computing and Mathematics, University of Huddersfield PDDL and other languages.. Lee McCluskey Department of Computing and Mathematical Sciences,
Formal Aspects of Computer Science – Week 12 RECAP Lee McCluskey, room 2/07
School of Computing and Mathematics, University of Huddersfield Week 21: Knowledge Acquisition / GIPO Lee McCluskey, room 2/09
Automated Planning and HTNs Planning – A brief intro Planning – A brief intro Classical Planning – The STRIPS Language Classical Planning – The STRIPS.
1 Planning Chapters 11 and 12 Thanks: Professor Dan Weld, University of Washington.
AI – Week 10 AI and Games (2) Lee McCluskey, room 3/10
CPSC 411, Fall 2008: Set 4 1 CPSC 411 Design and Analysis of Algorithms Set 4: Greedy Algorithms Prof. Jennifer Welch Fall 2008.
Planning II CSE 573. © Daniel S. Weld 2 Logistics Reading for Wed Ch 18 thru 18.3 Office Hours No Office Hour Today.
Adapted from slides by Marie desJardins
Course Overview  What is AI?  What are the Major Challenges?  What are the Main Techniques?  Where are we failing, and why?  Step back and look at.
Week 6: PDDL, itSIMPLE and running “state of the art” planners Lee McCluskey, room 3/10
22/11/04 AIPP Lecture 16: More Planning and Operators1 More Planning Artificial Intelligence Programming in Prolog.
CHA2555 Week2: Knowledge Representation, Logic and Planning Lee McCluskey First term:
110/19/2015CS360 AI & Robotics AI Application Areas  Neural Networks and Genetic Algorithms  These model the structure of neurons in the brain  Humans.
Planning, page 1 CSI 4106, Winter 2005 Planning Points Elements of a planning problem Planning as resolution Conditional plans Actions as preconditions.
Knowledge and search, page 1 CSI 4106, Winter 2005 Knowledge and search Points Properties of knowledge  Completeness  Objectivity  Certainty  Formalizability.
What does a computer program look like: a general overview.
CMP-MX21: Lecture 4 Selections Steve Hordley. Overview 1. The if-else selection in JAVA 2. More useful JAVA operators 4. Other selection constructs in.
CS344: Introduction to Artificial Intelligence (associated lab: CS386)
Programming Languages
Introduction to Planning Dr. Shazzad Hosain Department of EECS North South Universtiy
AI Lecture 17 Planning Noémie Elhadad (substituting for Prof. McKeown)
Introduction to Artificial Intelligence Class 1 Planning & Search Henry Kautz Winter 2007.
1/16 Planning Chapter 11- Part1 Author: Vali Derhami.
Intro to Planning Or, how to represent the planning problem in logic.
Fall 2008Programming Development Techniques 1 Topic 17 Assignment, Local State, and the Environment Model of Evaluation Section 3.1 & 3.2.
1 Algorithms CSCI 235, Fall 2015 Lecture 30 More Greedy Algorithms.
1 Propositional Logic Limits The expressive power of propositional logic is limited. The assumption is that everything can be expressed by simple facts.
Natural Language Processing AI Revision Lee McCluskey, room 2/07
AI – Week 16 Machine Learning Applied to AI Planning Lee McCluskey, room 2/09
1 Structure of a Compiler Source Language Target Language Semantic Analyzer Syntax Analyzer Lexical Analyzer Front End Code Optimizer Target Code Generator.
Artificial Intelligence Lecture No. 8 Dr. Asad Ali Safi ​ Assistant Professor, Department of Computer Science, COMSATS Institute of Information Technology.
Object Design More Design Patterns Object Constraint Language Object Design Specifying Interfaces Review Exam 2 CEN 4010 Class 18 – 11/03.
AI – Week 3 An Introduction to AI Planning Lee McCluskey, room 3/10
Heuristic Search Planners. 2 USC INFORMATION SCIENCES INSTITUTE Planning as heuristic search Use standard search techniques, e.g. A*, best-first, hill-climbing.
Artificial Intelligence Knowledge Representation.
HW5: Planning. PDDL Planning Domain Description Language Based on STRIPS with various extensions Originally defined by Drew McDermott (Yale) and others.
Hybrid Architectures Today: More Planning Tuesday: Examples of Hierarchical Systems Hand-out Midterm How can "natural" interaction with a robot be designed?
Chapter 3 of Programming Languages by Ravi Sethi
Control Flow Testing Handouts
Outline of the Chapter Basic Idea Outline of Control Flow Testing
Chapter 6 Intermediate-Code Generation
5.3 Adding and Subtracting Polynomials
Presentation transcript:

AI – Week 5 More on HEURISTICS and domain modelling Lee McCluskey, room 2/09

Artform Research Group This week … -- TOPIC 1 – Continue from last week to look at how heuristics are implemented – use code under “Application 5” – called “planblocksGH” -TOPIC 2 – Domain Modelling – how to encode domains

Search Tree Example INITIAL STATE Goal condition: A&B&C&D&E A&B&C&D solved A&B solved A&B&C solved C&D solved A&B solved E solved C&D solved Greedy Scores in Red

Adding Heuristics to the Prolog Code-1 Heuristic: Prune the tree: don't add a new open node to the search if it contains a state (X below) which is the SAME state that is already in an open node. assert_and_record_node(X) :- not_already_there(X), % If it is there, don’t assert it … assertz(X), ETC not_already_there(node(X,_,_)) :- node(X,_,_),!,fail. % not_already_there(_) :- !. Q: does this affect search completeness? Does this affect optimality?

Adding Heuristics to the Prolog Code-2 Pseudo-A* Heuristic Recall node n = (list of object states, sequence of actions, node COST), Where COST(n ) = g(n)+h(n) g(n) = length of sequence of actions (length of list of ops) it took to get there h(n) = how many subgoals still to solve. Prolog Fragments: plan(Goal) :- retract_the_best(node(Advanced_state, Op_sequence, COST)), ETC ……. cal_cost(Goal, New_Advanced_state, New_action_seq, COST) :- goals_left(Goal, New_Advanced_state, LEFT), length(LEFT, HN), length(New_action_seq,GN), COST is GN + HN,!.

Artform Research Group Topic 2: Domain Modelling NB Improvement to basic STRIPS encoding: I have added the ability to put EVALUABLE predicates in states such as maths operators and assignment, so we can easily deal with RESOURCES Domain: Robot moves around Canalside West and can carry things around. We want to give it tasks and it has to work out a correct and efficient plan to carry out the tasks, within its resource limit.

Objects Cargo (c1, c2, ….) Robots (r1, r2, ….) Places (Rooms – room319, landing3,..)

Objects + Attributes/Relations Cargo (c1, c2, ….) at(Cargo, Place), in(Cargo, Robot), Robots (r1, r2, ….) position(Robot, Place), fuel_level(Robot, Int) Places (Rooms – room319, landing3,..) connects(Place, Place) Built-in predicates – is(Int Parameter, Int Expression) – always true with a side effect ge(Int Parameter, Int Expression) – true or false

World State (see applic. 7 code) A “world state” is a set of the states of each object in the problem. A state of an object is the object name, followed by a set of predicates that are true of the object. NB 1. Sets are represented by lists 2. Normally predicates are only represented once 3. Some objects are STATIC – that is their predicates (attributes and relations) cannot be change by operators

Example of Initial State (see applic. 7 code) [ state(c1,[at(c1,landing)]), state(c2,[at(c2,landing)]), state(c3,[at(c3,landing)]), state(c4,[at(c4,landing)]), state(r1,[position(r1,landing),fuel_level(r1,4)]), state(r2,[position(r2,landing),fuel_level(r2,4)]), state(landing, [connects(landing,menstoilet), connects(landing,corridor)]), state(menstoilet, [connects(menstoilet,landing), connects(menstoilet,corridor)]), state(corridor, [connects(corridor,menstoilet), connects(corridor,landing)])

Goal Condition (see applic. 7 code) A “goal condition” is a set of conditions on objects that have to be achieved. Eg from application 7 [ condition(r2,[position(r2,menstoilet)]) ] [ condition(c1,[at(c1,corridor)]), condition(r2,[position(r2,menstoilet)]) ],

Operator Schema Move robot Pickup Cargo Putdown Cargo op(move(R,A,B), % prevail [condition(A,[connects(A,B)])], % necessary [ trans(R,[position(R,A), fuel_level(R,X), ge(X,1), is(XX,X-1)], [position(R,B), fuel_level(R,XX)] ) ], % conditional [ ]).

PDDL Syntax (:types Cargo - object Robot - object Place - object ) (:predicates (at ?c - Cargo ?p - Place) (in ?c - Cargo?r - Robot) (fuel_level ?r – Robot ?l - Int) (position ?r – Robot, ?p – Place) (connected ?p1 – Place ?p2 - Place) ) (:action load :parameters (?c – Cargo ?r - Robot ?a - Place) :precondition (and (position ?r ?a) (at ?c ?a) ) :effect (and (in ?c ?r) (not (at ?c ?a)) )

Domain Modelling – another example Seller (apollo, amazon, ….) Product (star_wars, terminator, cats,..) constants - bank, service state(bank, [have_password(bank,abcd),balance(bank,100)]), state(money, [haveresource(money,10)]), state(service,[logged_off]), state(apollo,[service(apollo), freeseat(apollo,cats), seat_price(apollo,25)]), state(amazon, [service(amazon), dvd_price(amazon,terminator,10), instock(amazon, terminator), instock(amazon, star_wars), ETC

Artform Research Group Operator Schema- example op( book_theatre_seat(Ticket,Seller,Prod), [condition(Seller,[freeseat(Seller,Prod), seat_price(Seller,X)]), condition(S,[logged_on(S,Seller)]) ], [trans(Money, [haveresource(Money,Y), ge(Y, X), is(YX,Y-X)], [haveresource(Money,YX)]), trans(Ticket, [have_no_ticket(Seller,Prod)], [have_ticket(Ticket,Seller,Prod)]) ], [ ]).

Summary Heuristics are vital to make a Planner work efficiently Domain Modelling is the art of constructing a model of a domain within some knowledge representation language such as OCL or PDDL.