Koen HindriksMulti-Agent Systems 2012 Introduction Agent Programming Koen Hindriks Delft University of Technology, The Netherlands Learning to program.

Slides:



Advertisements
Similar presentations
Koen Hindriks, Birna van RiemsdijkMulti-agent systemen Agent Programming in G OAL Multi-agent Systems & Communication Koen Hindriks Delft University of.
Advertisements

ARCHITECTURES FOR ARTIFICIAL INTELLIGENCE SYSTEMS
Formal Semantics for an Abstract Agent Programming Language K.V. Hindriks, Ch. Mayer et al. Lecture Notes In Computer Science, Vol. 1365, 1997
ECE457 Applied Artificial Intelligence R. Khoury (2007)Page 1 Please pick up a copy of the course syllabus from the front desk.
Computing & Information Sciences Kansas State University Lecture 20 of 42 CIS 530 / 730 Artificial Intelligence Lecture 20 of 42 Introduction to Classical.
Planning Planning is fundamental to “intelligent” behaviour. E.g.
Planning Russell and Norvig: Chapter 11 Slides adapted from: robotics.stanford.edu/~latombe/cs121/2003/ home.htm.
Artificial Intelligence II S. Russell and P. Norvig Artificial Intelligence: A Modern Approach Chapter 11: Planning.
Koen HindriksProgramming Multi-Agent Systems Agent Programming in G OAL Modules Koen Hindriks Delft University of Technology, The Netherlands Multi-Agent.
Ch. 10 – Planning Supplemental slides for CSE 327 Prof. Jeff Heflin.
1 Classical STRIPS Planning Alan Fern * * Based in part on slides by Daniel Weld.
Lecture 2: Reactive Systems Gal A. Kaminka Introduction to Robots and Multi-Robot Systems Agents in Physical and Virtual Environments.
Planning Russell and Norvig: Chapter 11. Planning Agent environment agent ? sensors actuators A1A2A3.
Planning Problem Solving  Planning –Action Centred –More flexible decision strategies A Representation for Planning –Add & Delete Lists Planning Techniques.
COMP 4640 Intelligent & Interactive Systems Cheryl Seals, Ph.D. Computer Science & Software Engineering Auburn University.
1 Software Testing and Quality Assurance Lecture 15 - Planning for Testing (Chapter 3, A Practical Guide to Testing Object- Oriented Software)
1 Action Planning (Where logic-based representation of knowledge makes search problems more interesting) R&N: Chap. 11, Sect. 11.1–4.
AI Principles, Lecture on Planning Planning Jeremy Wyatt.
PLANNING Partial order regression planning Temporal representation 1 Deductive planning in Logic Temporal representation 2.
Introduction to Jadex programming Reza Saeedi
University of Palestine software engineering department Testing of Software Systems Fundamentals of testing instructor: Tasneem Darwish.
Vermelding onderdeel organisatie September 12, Intro Multi-Agent Systemen Multi-Agent Systemen Koen Hindriks, Birna van Riemsdijk Man-machine interaction.
Introduction to Artificial Intelligence. Content Definition of AI Typical AI problems Practical impact of AI Approaches of AI Limits of AI Brief history.
SWE 316: Software Design and Architecture – Dr. Khalid Aljasser Objectives Lecture 11 : Frameworks SWE 316: Software Design and Architecture  To understand.
1 07. The planning problem 2  Inputs: 1. A description of the world state 2. The goal state description 3. A set of actions  Output: A sequence of actions.
COMP 4640 Intelligent & Interactive Systems Cheryl Seals, Ph.D. Computer Science & Software Engineering Auburn University Lecture 2: Intelligent Agents.
April 3, 2006AI: Chapter 11: Planning1 Artificial Intelligence Chapter 11: Planning Michael Scherger Department of Computer Science Kent State University.
22/11/04 AIPP Lecture 16: More Planning and Operators1 More Planning Artificial Intelligence Programming in Prolog.
CS.462 Artificial Intelligence SOMCHAI THANGSATHITYANGKUL Lecture 07 : Planning.
Triggers A Quick Reference and Summary BIT 275. Triggers SQL code permits you to access only one table for an INSERT, UPDATE, or DELETE statement. The.
NAVEEN AGENT BASED SOFTWARE DEVELOPMENT. WHAT IS AN AGENT? A computer system capable of flexible, autonomous (problem-solving) action, situated in dynamic,
Artificial Intelligence By Michelle Witcofsky And Evan Flanagan.
CPS 270: Artificial Intelligence Planning Instructor: Vincent Conitzer.
1 Search vs. planning Situation calculus STRIPS operators Search vs. planning Situation calculus STRIPS operators.
Artificial Intelligence 2005/06 Partially Ordered Plans - or: "How Do You Put Your Shoes On?"
Lecture 11 Data Structures, Algorithms & Complexity Introduction Dr Kevin Casey BSc, MSc, PhD GRIFFITH COLLEGE DUBLIN.
Kansas State University Department of Computing and Information Sciences CIS 730: Introduction to Artificial Intelligence Lecture 17 Wednesday, 01 October.
CPS 570: Artificial Intelligence Planning Instructor: Vincent Conitzer.
1 Chapter 16 Planning Methods. 2 Chapter 16 Contents (1) l STRIPS l STRIPS Implementation l Partial Order Planning l The Principle of Least Commitment.
Automated Planning Dr. Héctor Muñoz-Avila. What is Planning? Classical Definition Domain Independent: symbolic descriptions of the problems and the domain.
Introduction to Planning Dr. Shazzad Hosain Department of EECS North South Universtiy
Algorithmic, Game-theoretic and Logical Foundations
Introduction to Artificial Intelligence CS 438 Spring 2008 Today –AIMA, Ch. 25 –Robotics Thursday –Robotics continued Home Work due next Tuesday –Ch. 13:
AI Lecture 17 Planning Noémie Elhadad (substituting for Prof. McKeown)
SQL Based Knowledge Representation And Knowledge Editor UMAIR ABDULLAH AFTAB AHMED MOHAMMAD JAMIL SAWAR (Presented by Lei Jiang)
University of Kurdistan Artificial Intelligence Methods (AIM) Lecturer: Kaveh Mollazade, Ph.D. Department of Biosystems Engineering, Faculty of Agriculture,
1/16 Planning Chapter 11- Part1 Author: Vali Derhami.
A Guide to SQL, Eighth Edition Chapter Six Updating Data.
1 CMSC 471 Fall 2004 Class #21 – Thursday, November 11.
Planning in FOL Systems sequences of actions to achieve goals.
Koen HindriksMulti-Agent Systems Introduction Agent Programming Koen Hindriks Delft University of Technology, The Netherlands Learning to program teaches.
Koen HindriksMulti-Agent Systems Environments and Sensing Multi-Agent Systems Course Koen Hindriks Delft University of Technology, The Netherlands.
Artificial Intelligence 2004 Planning: Situation Calculus Review STRIPS POP Hierarchical Planning Situation Calculus (John McCarthy) situations.
CS621: Artificial Intelligence Pushpak Bhattacharyya Computer Science and Engineering Department IIT Bombay Lecture 19: Hidden Markov Models.
Intelligent Agents Chapter 2. How do you design an intelligent agent? Definition: An intelligent agent perceives its environment via sensors and acts.
COMP 4640 Intelligent & Interactive Systems Cheryl Seals, Ph.D. Computer Science & Software Engineering Auburn University.
Ch. 11 – Planning Supplemental slides for CSE 327 Prof. Jeff Heflin.
Koen HindriksMulti-Agent Systems Environments, Rules, Architectures Koen Hindriks Delft University of Technology, The Netherlands.
ECE457 Applied Artificial Intelligence R. Khoury (2007)Page 1 Please pick up a copy of the course syllabus from the front desk.
Action Modeling with Graph-Based Version Spaces in Soar
Instructor: Vincent Conitzer
Introduction Contents Sungwook Yoon, Postdoctoral Research Associate
CS344 : Introduction to Artificial Intelligence
AI Planning.
L11. Planning Agents and STRIPS
CPS 570: Artificial Intelligence Planning
CS344 : Introduction to Artificial Intelligence
Russell and Norvig: Chapter 11 CS121 – Winter 2003
Artificial Intelligence Planning
Prof. Pushpak Bhattacharyya, IIT Bombay
Presentation transcript:

Koen HindriksMulti-Agent Systems 2012 Introduction Agent Programming Koen Hindriks Delft University of Technology, The Netherlands Learning to program teaches you how to think. Computer science is a liberal art. Steve Jobs Multi-Agent Systems Course

Koen Hindriks Multi-Agent Systems Koen HindriksMulti-Agent Systems Introducing Myself Dr. Koen Hindriks –PhD on Agent Programming Languages (Utrecht, ) –Consultant at Accenture (Amsterdam, ) –Assistant Professor Artificial Intelligence (Nijmegen, ) –Assistant Professor MMI Group (Delft, …) Main Research Interests –Rational agent programming and theory –Automated negotiation –Logic (with applications to agent modeling and NLP semantics) –Cognitive engineering and architectures

Koen Hindriks Multi-Agent Systems Koen HindriksMulti-Agent Systems Outline This lecture: –Blocks, Blocks, Blocks… Basic Blocks World example in the G OAL agent programming language –Actions –Rule-Based Action Selection

Koen Hindriks Multi-Agent Systems Koen HindriksMulti-Agent Systems This Part: BW4T Assignment Abstract simulated environment called: Blocks World for Teams (BW4T) Search and retrieval task Control robot by cognitive agent program Your task: implement decision-making

Koen HindriksMulti-Agent Systems 2012 The G OAL Agent Programming Language

Koen Hindriks Multi-Agent Systems Koen HindriksMulti-Agent Systems 2012 THE BLOCKS WORLD The Hello World example of Agent Programming

Koen Hindriks Multi-Agent Systems Koen HindriksMulti-Agent Systems The Blocks World Positioning of blocks on table is not relevant. A block can be moved only if it there is no other block on top of it. Objective: Move blocks in initial state such that result is goal state. A classic AI planning problem.

Koen Hindriks Multi-Agent Systems Koen HindriksMulti-Agent Systems Mental State of G OAL Agent knowledge{ block(X) :- on(X, _). clear(X) :- block(X), not(on(Y,X)). clear(table). tower([X]) :- on(X,table). tower([X,Y|T]) :- on(X,Y), tower([Y|T]). } beliefs{ on(a,b). on(b,c). on(c,table). on(d,e). on(e,table). on(f,g). on(g,table). } goals{ on(a,e), on(b,table), on(c,table), on(d,c), on(e,b), on(f,d), on(g,table). } The knowledge, belief, and goal sections together constitute the specification of the mental state of a G OAL Agent. Initial mental state of agent

Koen Hindriks Multi-Agent Systems Koen HindriksMulti-Agent Systems Previous Lecture Percepts Action events actionsgoals plans beliefs environment agent

Koen Hindriks Multi-Agent Systems Koen HindriksMulti-Agent Systems This Lecture Percepts Action events actionsgoals plans beliefs environment agent

Koen Hindriks Multi-Agent Systems Koen HindriksMulti-Agent Systems Next Lecture Percepts Action events actionsgoals plans beliefs environment agent

Koen Hindriks Multi-Agent Systems Koen HindriksMulti-Agent Systems Why “Hello World” Example? The Blocks World is: –Single agent: no other agents that can change the world –Fully observable: the agent can see “everything” –Static: only actions of agent can change the world  We do not need sensing / percepts.

Koen Hindriks Multi-Agent Systems Koen HindriksMulti-Agent Systems Agent Oriented Programming Agents provide a very effective way of building applications for dynamic and complex environments + Develop agents based on Belief-Desire-Intention agent metaphor, i.e. develop software components as if they have beliefs and goals, act to achieve these goals, and are able to interact with their environment and other agents.

Koen Hindriks Multi-Agent Systems Koen HindriksMulti-Agent Systems 2012 ACTIONS SPECIFICATIONS Changing Blocks World Configurations

Koen Hindriks Multi-Agent Systems Koen HindriksMulti-Agent Systems Actions Change the Environment… move(a,d)

Koen Hindriks Multi-Agent Systems Koen HindriksMulti-Agent Systems and Require Updating Mental States. To ensure adequate beliefs after performing an action the belief base needs to be updated (and possibly the goal base). –Add effects to belief base: insert on(a,d) after move(a,d). –Delete old beliefs: delete on(a,b) after move(a,d).

Koen Hindriks Multi-Agent Systems Koen HindriksMulti-Agent Systems and Require Updating Mental States. If a goal has been (believed to be) completely achieved, the goal is removed from the goal base. It is not rational to have a goal you believe to be achieved. Default update implements a blind commitment strategy. move(a,b) beliefs{ on(a,table), on(b,table). } goals{ on(a,b), on(b,table). } beliefs{ on(a,b), on(b,table). } goals{ }

Koen Hindriks Multi-Agent Systems Koen HindriksMulti-Agent Systems Action Specifications Actions in GOAL have preconditions and postconditions. Executing an action in GOAL means: –Preconditions are conditions that need to be true: Check preconditions on the belief base. –Postconditions (effects) are add/delete lists (STRIPS): Add positive literals in the postcondition Delete negative literals in the postcondition STRIPS-style specification move(X,Y){ pre { clear(X), clear(Y), on(X,Z), not( on(X,Y) ) } post { not(on(X,Z)), on(X,Y) } }

Koen Hindriks Multi-Agent Systems Koen HindriksMulti-Agent Systems move(X,Y){ pre { clear(X), clear(Y), on(X,Z), not( on(X,Y) ) } post { not(on(X,Z)), on(X,Y) } } Example: move(a,b) Check: clear(a), clear(b), on(a,Z), not( on(a,b) ) Remove: on(a,Z) Add: on(a,b) Note: first remove, then add. Actions Specifications table

Koen Hindriks Multi-Agent Systems Koen HindriksMulti-Agent Systems move(X,Y){ pre { clear(X), clear(Y), on(X,Z), not( on(X,Y) ) } post { not(on(X,Z)), on(X,Y) } } Example: move(a,b) Actions Specifications beliefs{ on(a,table). on(b,table). } beliefs{ on(b,table). on(a,b). }

Koen Hindriks Multi-Agent Systems Koen HindriksMulti-Agent Systems move(X,Y){ pre { clear(X), clear(Y), on(X,Z), not( on(X,Y) ) } post { not(on(X,Z)), on(X,Y) } } 1.Is it possible to perform move(a,b) ? 2.Is it possible to perform move(a,d) ? Actions Specifications EXERCISE: knowledge{ block(a), block(b), block(c), block(d), block(e), block(f), block(g), block(h), block(i). clear(X) :- block(X), not(on(Y,X)). clear(table). tower([X]) :- on(X,table). tower([X,Y|T]) :- on(X,Y), tower([Y|T]). } beliefs{ on(a,b). on(b,c). on(c,table). on(d,e). on(e,table). on(f,g). on(g,table). } No, clear(b) fails. Yes.

Koen Hindriks Multi-Agent Systems Koen HindriksMulti-Agent Systems move(X,Y){ pre { clear(X), clear(Y), on(X,Z), not( on(X,Y) ) } post { not(on(X,Z)), on(X,Y) } } We already check clear(Y). Why do we also have not(on(X,Y)) in the precondition? Actions Specifications EXERCISE: Since we always have clear(table). The condition prevents moving blocks that are already on the table. knowledge{ block(a), block(b), block(c), block(d), block(e), block(f), block(g), block(h), block(i). clear(X) :- block(X), not(on(Y,X)). clear(table). tower([X]) :- on(X,table). tower([X,Y|T]) :- on(X,Y), tower([Y|T]). } beliefs{ on(a,b). on(b,c). on(c,table). on(d,e). on(e,table). on(f,g). on(g,table). }

Koen Hindriks Multi-Agent Systems Koen HindriksMulti-Agent Systems 2012 ACTION RULES Selecting actions to perform

Koen Hindriks Multi-Agent Systems Koen HindriksMulti-Agent Systems Agent-Oriented Programming How do humans choose and/or explain actions? Examples: I believe it rains; so, I will take an umbrella with me. I go to the video store because I want to rent I-robot. I don’t believe busses run today so I take the train. Use intuitive common sense concepts: beliefs + goals => action See Chapter 1 of the Programming Guide

Koen Hindriks Multi-Agent Systems Koen HindriksMulti-Agent Systems Selecting Actions: Action Rules Action rules are used to define a strategy for action selection. Defining a strategy for blocks world: –If constructive move can be made, make it. –If block is misplaced, move it to table. program{ if bel(tower([Y|T])), a-goal(tower([X,Y|T])) then move(X,Y). if a-goal(tower([X|T])) then move(X,table). }

Koen Hindriks Multi-Agent Systems Koen HindriksMulti-Agent Systems Selecting Actions: Action Rules What happens? Check whether condition a-goal(tower([X|T]) can be derived from the current mental state of agent. If so, then apply rule and perform move(X,table). if a-goal(tower([X|T])) then move(X,table).

Koen Hindriks Multi-Agent Systems Koen HindriksMulti-Agent Systems Selecting Actions: Action Rules What happens? if a-goal(tower([X|T])) then move(X,table). knowledge{ block(X) :- on(X, _). clear(X) :- block(X), not(on(Y,X)). clear(table). tower([X]) :- on(X, table). tower([X,Y|T]) :- on(X,Y), tower([Y|T]). } beliefs{ on(a, b). on(c, d). } goals{ on(a, table), on(c, table). } d c b a EXERCISE: Random choice for either moving a or c.

Koen Hindriks Multi-Agent Systems Koen HindriksMulti-Agent Systems Order of Action Rules Action rules are executed by default in linear order. The first rule that fires is executed. Default order can be changed to random. Arbitrary rule that is able to fire may be selected. program{ if bel(tower([Y|T])), a-goal(tower([X,Y|T])) then move(X,Y). if a-goal(tower([X|T])) then move(X,table). } program[order=random]{ if bel(tower([Y|T])), a-goal(tower([X,Y|T])) then move(X,Y). if a-goal(tower([X|T])) then move(X,table). }

Koen Hindriks Multi-Agent Systems Koen HindriksMulti-Agent Systems Example Program: Action Rules Agent program may allow for multiple action choices d To table Random, arbitrary choice program[order=random]{ if bel(tower([Y|T])), a-goal(tower([X,Y|T])) then move(X,Y). if a-goal(tower([X|T])) then move(X,table). }

Koen Hindriks Multi-Agent Systems Koen HindriksMulti-Agent Systems The Sussman Anomaly (1/5) Non-interleaved planners typically separate the main goal, on(A,B),on(B,C) into 2 sub-goals: on(A,B) and on(B,C). Planning for these two sub-goals separately and combining the plans found does not work in this case, however. a c Initial state bc b a Goal state

Koen Hindriks Multi-Agent Systems Koen HindriksMulti-Agent Systems The Sussman Anomaly (2/5) Initially, all blocks are misplaced One constructive move can be made (c to table) Note: move(b,c) not enabled. Only action enabled: c to table (2x). Need to check conditions of action rules: if bel(tower([Y|T]),a-goal(tower([X,Y|T))then move(X,Y). if a-goal(tower([X|T))then move(X,table). We have bel(tower([c,a]) and a-goal(tower([c])). c b a Goal state a c Initial state b

Koen Hindriks Multi-Agent Systems Koen HindriksMulti-Agent Systems The Sussman Anomaly (3/5) Only constructive move enabled is –Move b onto c Need to check conditions of action rules: if bel(tower([Y|T]), a-goal(tower([X,Y|T))then move(X,Y). if a-goal(tower([X|T))then move(X,table). Note that we have: a-goal(on(a,b),on(b,c),on(c,table)), but not: a-goal(tower[c])). Current state c b a Goal state a c b

Koen Hindriks Multi-Agent Systems Koen HindriksMulti-Agent Systems The Sussman Anomaly (4/5) Again, only constructive move enabled –Move a onto b Need to check conditions of action rules: if bel(tower([Y|T]), a-goal(tower([X,Y|T))then move(X,Y). if a-goal(tower([X,T))then move(X,Y). Note that we have: a-goal(on(a,b),on(b,c),on(c,table)), but not: a-goal(tower[b,c]). c b a Goal state a c b Current state

Koen Hindriks Multi-Agent Systems Koen HindriksMulti-Agent Systems The Sussman Anomaly (5/5) Upon achieving a goal completely that goal is automatically removed. The idea is that no resources should be wasted on achieving the goal. In our case, goal(on(a,b),on(b,c),on(c,table)) has been achieved, and is dropped. The agent has no other goals and is ready. c b a Goal state a c b Current state

Koen Hindriks Multi-Agent Systems Koen HindriksMulti-Agent Systems Organisation Read Programming Guide Ch1-3 (+ User Manual) See: Tutorial: –Download G OAL : See –Practice exercises from Programming Guide –BW4T assignments 3 and 4 made available today Next lecture: –Sensing, perception, environments –Other types of rules & macros –Agent architecture