University of Science and Technology Faculty of Computer

  • Slides: 30
Download presentation
University of Science and Technology Faculty of Computer Science and Information Technology Artificial Intelligence

University of Science and Technology Faculty of Computer Science and Information Technology Artificial Intelligence (AI) 4 th Year B. Sc : Information Technology Academic Year : 2017 -2018 Instructor : Diaa Eldin Mustafa Ahmed Intelligent Agents (IA)- (1/2)

You will be expected to know q Agent q Rational Agent q Task Environment

You will be expected to know q Agent q Rational Agent q Task Environment (PEAS) : - Performance measure, Environment, Actuators, Sensors q Examples for intelligent agents q Properties of Task Environments: q Basic Definitions: Percept, percept sequance, agent function, agent program. q Agent Types : Reflex , Model-based , Goal-based , Utility-based agents , and Learning agents. 2 AI - (2017 -2018) -Diaa Eldein Mustafa - Lecture (3) - Intelligent Agents (1/2)

Agents and environments Compare: Standard Embedded System Structure sensors ADC microcontroller ASIC 3 FPGA

Agents and environments Compare: Standard Embedded System Structure sensors ADC microcontroller ASIC 3 FPGA AI - (2017 -2018) -Diaa Eldein Mustafa - Lecture (3) - Intelligent Agents (1/2) DAC actuators

Agents and environments A Field-Programmable Gate Array (FPGA) is an integrated circuit (IC) that

Agents and environments A Field-Programmable Gate Array (FPGA) is an integrated circuit (IC) that can be programmed in the field after manufacture. FPGAs are similar in principle to, but have vastly wider potential application than, programmable read-only memory (PROM) chips. An ASIC (Application-Specific Integrated Circuit) is a microchip designed for a special application, such as a particular kind of transmission protocol or a hand-held computer. You might contrast it with general integrated circuits, such as the microprocessor and the random access memory chips in your PC. 4 AI - (2017 -2018) -Diaa Eldein Mustafa - Lecture (3) - Intelligent Agents (1/2)

Agents Definition q An agent is anything that can be viewed as perceiving its

Agents Definition q An agent is anything that can be viewed as perceiving its environment through sensors and acting upon that environment through actuators, and directs its activity towards achieving goals (i. e. it is "rational", Act rational with respect to a performance measure, e. g. time, energy, money, movement. Human agent: Ø Eyes, ears, skin, and other organs for sensors. Ø Hands, legs, mouth, and other body parts for actuators. Ø Light, sound, solidity as percepts. q Robotic agent: Ø Cameras , infrared detectors, microphone and accelerometers for sensors. Ø Various motors , grippers, wheels, speakers, for actuators Ø Light, sound, solidity as percepts. 5 AI - (2017 -2018) -Diaa Eldein Mustafa - Lecture (3) - Intelligent Agents (1/2)

Agents and Environments q Percept: agent’s perceptual inputs at an instant. q Agent’s behavior

Agents and Environments q Percept: agent’s perceptual inputs at an instant. q Agent’s behavior is Mathematically described by: q The agent function : A=F(P) Ø where P is the current percept, ØA is the action carried out, and F is the agent function F maps percepts to actions F: P* A Ø q Ø where P* is the set of all percepts, and A is the set of all actions q In general, an action may depend on all percepts obseved so far, not just the current percept. 6 AI - (2017 -2018) -Diaa Eldein Mustafa - Lecture (3) - Intelligent Agents (1/2)

An agent interacting with an environment q. Prior knowledge: about the agent and the

An agent interacting with an environment q. Prior knowledge: about the agent and the environment. q. History of interaction with the environment, which is composed of: Øobservations of the current environment and. Øpast experiences of previous actions and observations, or other data, from which it can learn. q. Goals that it must try to achieve or preferences over states of the world; and abilities, which are the primitive actions it is capable of carrying out. q. An agent could be a program that acts in a purely computational environment--a software agent. 7 AI - (2017 -2018) -Diaa Eldein Mustafa - Lecture (3) - Intelligent Agents (1/2)

Structure of Agents runs on the physical architecture to produce F. agent = architecture

Structure of Agents runs on the physical architecture to produce F. agent = architecture + program q Architecture Agent Sensors Percepts ? Actuators Actions Environment q The agent program : Ø device with sensors and actuators What AI should fill Reasoning Ø which also provides and interface to the environment (percepts, actions). e. g. , A robotic car, a camera, a PC. Ø implements the agent function on the architecture. Ø (Agent) Program = some function that implements the agent mapping = “? ”= Job of AI 8 AI - (2017 -2018) -Diaa Eldein Mustafa - Lecture (3) - Intelligent Agents (1/2)

Rationality and Rational Agents q. Rationality Ø A rational agent is one that does

Rationality and Rational Agents q. Rationality Ø A rational agent is one that does the right thing. Ø More precisely, what is rational at any given time depends on four things: – The performance measure that defines the criterion of success. – The agent’s prior knowledge of the environment. – The actions that the agent can perform. – The agent’s percept sequence to date. q Rational Agent: ØFor each possible percept sequence, a rational agent should select an action that is expected to maximize its performance measure. q Rational action: Øwhichever action maximizes the expected value of the performance measure given the percept sequence to date. 9 AI - (2017 -2018) -Diaa Eldein Mustafa - Lecture (3) - Intelligent Agents (1/2)

Specifying the Task Environments (PEAS) q Performance Measure: captures agent’s aspiration An objective function

Specifying the Task Environments (PEAS) q Performance Measure: captures agent’s aspiration An objective function that determines Ø How the agent does successfully Ø E. g. , 90% or 30% ? q Environment: context, restrictions. Ø the real world of the agent q Actuators: indicates what the agent can carry out. Ø Actions that can perform q Sensors: indicates what the agent can perceive Ø 10 AI - (2017 -2018) -Diaa Eldein Mustafa - Lecture (3) - Intelligent Agents (1/2)

Basic Agent Algorithm Basic algorithm for a rational agent While (true) do Get percept

Basic Agent Algorithm Basic algorithm for a rational agent While (true) do Get percept from sensors into memory Determine best action based on memory Record action in memory Perform action. Note: •  Memory capacity can be zero •  Performance measure is not part of the agent. 11 AI - (2017 -2018) -Diaa Eldein Mustafa - Lecture (3) - Intelligent Agents (1/2)

Properties of Environments Types of Environment q. There are different sorts of environments, which

Properties of Environments Types of Environment q. There are different sorts of environments, which affect what an agent has to be able to cope with. q. In designing agents, one should always consider the pair of agent and environment together. q Fully Observable vs. Partially Observable: 12 ØIf an agent's sensors give it full access to the complete state of the environment(sensors detect all aspects). Øthe environment is fully observable (e. g. Playing chess ). Øotherwise it is only partially observable or unobservable because of noisy and inaccurate sensors or because parts of the state are simply missing from the sensor data (A local dirt sensor of the cleaner cannot tell whether other squares are clean or not ). AI - (2017 -2018) -Diaa Eldein Mustafa - Lecture (3) - Intelligent Agents (1/2)

Properties of Environments Types of Environment q Single Ø agent vs. Multi-agent How many

Properties of Environments Types of Environment q Single Ø agent vs. Multi-agent How many objects must be modeled as agents – single agent (Playing a crossword puzzle ) – two agents Ø Ø 13 (Chess playing) Competitive multi-agent environment – Chess playing Cooperative multi-agent environment – Automated taxi driver – Avoiding collision AI - (2017 -2018) -Diaa Eldein Mustafa - Lecture (3) - Intelligent Agents (1/2)

Properties of Environments Types of Environment q Deterministic vs. Stochastic The environment is deterministic

Properties of Environments Types of Environment q Deterministic vs. Stochastic The environment is deterministic if the next state of the environment completely determined by the current state and the actions executed by the agent. Ø Otherwise Stochastic, ( environment may appear stochastic if it is only partially observable). Ø Strategic environment: deterministic except for actions of other agents Ø Vacuum - Cleaner and Auto-taxi driver are: – Stochastic because of some unobservable aspects noise or unknown Ø 14 AI - (2017 -2018) -Diaa Eldein Mustafa - Lecture (3) - Intelligent Agents (1/2)

Properties of Environments Types of Environment q Episodic vs. Sequential Ø In episodic environment

Properties of Environments Types of Environment q Episodic vs. Sequential Ø In episodic environment the agent’s experience can be divided into atomic steps. Ø agents perceives and then performs a single action. Ø An episode = agent has single pair of perception & action. Ø The quality of the agent’s action does not depend on other episodes – Every episode is independent of each other Ø Episodic environment is simpler – The agent does not need to think ahead Ø 15 Sequential – Current action may affect all future decisions –e. g. Taxi driving and chess. AI - (2017 -2018) -Diaa Eldein Mustafa - Lecture (3) - Intelligent Agents (1/2)

Properties of Environments Types of Environment q Static vs. Dynamic Ø A dynamic environment

Properties of Environments Types of Environment q Static vs. Dynamic Ø A dynamic environment is always changing over time – E. g. the number of people in the street Ø While static environment – E. g. the destination Ø 16 Semi-dynamic – environment is not changed over time – but the agent’s performance score does AI - (2017 -2018) -Diaa Eldein Mustafa - Lecture (3) - Intelligent Agents (1/2)

Properties of Environments Types of Environment q. Discrete vs. Continuous Ø The environment is

Properties of Environments Types of Environment q. Discrete vs. Continuous Ø The environment is discrete , If there a limited number of distinct states, clearly defined percepts and actions. – E. g. , Chess game Ø The environment is continuous, if the states changed with time (speed , velocity , etc. . ) – Taxi driving 17 AI - (2017 -2018) -Diaa Eldein Mustafa - Lecture (3) - Intelligent Agents (1/2)

Properties of Environments Types of Environment q. Known vs. Unknown. This distinction refers not

Properties of Environments Types of Environment q. Known vs. Unknown. This distinction refers not to the environment itself but to the agent’s (or designer’s) state of knowledge about the environment. Ø In known environment, the outcomes for all actions are given. – e. g: solitaire card games. Ø If the environment is unknown, the agent will have to learn how it works in order to make good decisions. – e. g: new video game. Ø 18 AI - (2017 -2018) -Diaa Eldein Mustafa - Lecture (3) - Intelligent Agents (1/2)

Examples of Agents (1) q. Agent : automatic car (automated taxi driver ) Ø

Examples of Agents (1) q. Agent : automatic car (automated taxi driver ) Ø Environment: streets, other vehicles, pedestrians, traffic signals /lights/signs. Ø Goals/Performance Measure: safe, fast, legal trip. Ø Percepts/Sensors: camera, GPS signals, speedometer, sonar. Ø Actions: steer, accelerate, brake. Agent : intelligent house Ø Environment: occupants enter and leave house, occupants enter and leave rooms; daily variation in outside light and temperature Ø Goals: occupants warm, room lights are on when room is occupied, house energy efficient. Ø Percepts: signals from temperature sensor, movement sensor, clock, sound sensor. Ø Actions: room heaters on/off, lights on/off. 19 AI - (2017 -2018) -Diaa Eldein Mustafa - Lecture (3) - Intelligent Agents (1/2)

Examples of Agents (2) q. Agent : Medical Diagnosis System. Ø Environment: Patient, hospital,

Examples of Agents (2) q. Agent : Medical Diagnosis System. Ø Environment: Patient, hospital, staff Ø Performance measure: Healthy patient, minimize costs, lawsuits Ø Actuators: Screen display (questions, tests, diagnoses, treatments, referrals) Ø Sensors: Keyboard (entry of symptoms, findings, patient's answers) q. Agent : Part-Picking Robot Ø Environment: Conveyor belt with parts, bins Ø Performance measure: Percentage of parts in correct bins Ø Actuators: Jointed arm and hand Ø Sensors: Camera, joint angle sensors 20 AI - (2017 -2018) -Diaa Eldein Mustafa - Lecture (3) - Intelligent Agents (1/2)

Examples of Agents (3) q. Agent : Interactive English Tutor. Ø Environment: Set of

Examples of Agents (3) q. Agent : Interactive English Tutor. Ø Environment: Set of students Ø Performance measure: Maximize student's score on test Ø Actuators: Screen display (exercises, suggestions, corrections) Ø Sensors: Keyboard q. Agent: Email Manage Ø Environment: mail reader , OS, internet Ø Goals: present important email first, hide junk mail, minimize email tardiness. Ø Percepts: email arrived, headers, content of email headers, message contents. Ø Actions: delete email, sort email, obtain user attention. 21 AI - (2017 -2018) -Diaa Eldein Mustafa - Lecture (3) - Intelligent Agents (1/2)

Examples of Agents (3) q. Agent: Internet Shopping Ø Environment: current and future WWW

Examples of Agents (3) q. Agent: Internet Shopping Ø Environment: current and future WWW sites, vendors. Ø Performance measure: price, quality, appropriateness, efficiency shippers. Ø Actuators: display to user, follow URL, fill in form. Ø Sensors: HTML pages (text, graphics, scripts). q. Agent: Program playing the game of checkers Ø Environment: A human opponent player Ø Performance measure: Maximize the number of games won Ø Actuators: Screen display (the move chosen by the program) Ø Sensors: Keyboard (the move chosen by the human player) AI - (2017 -2018) -Diaa Eldein Mustafa - Lecture 22 (3) - Intelligent Agents (1/2)

Home Work Specify the task environment (PEAS) of the following Agents: 1 - Spam

Home Work Specify the task environment (PEAS) of the following Agents: 1 - Spam filter ( A software that can detect spam and removed or discard it). 2 - Washing machine (automated machine for washing and drying clothes). 3 - Buyer agents (shopping bots): Buyer agents travel around a network (e. g. the internet) retrieving information about goods and services. These agents, also known as 'shopping bots', work very efficiently for commodity products such as CDs, books, electronic components, and other one-size-fits-all products. Buyer agents are typically optimized to allow for digital payment services used in e-commerce and traditional businesses. 23 AI - (2017 -2018) -Diaa Eldein Mustafa - Lecture (3) - Intelligent Agents (1/2)

Major Applications of Intelligent Agents in our daily life q. AI has successfully been

Major Applications of Intelligent Agents in our daily life q. AI has successfully been used in Ø Finance Ø Robotics Ø Games Ø Medicine Ø The Web q. The simplest environment is : Ø Fully observable, deterministic, episodic, static, discrete and single-agent. q. Most real situations are: Ø Partially observable, stochastic, sequential, dynamic, continuous and multi-agent. 24 AI - (2017 -2018) -Diaa Eldein Mustafa - Lecture (3) - Intelligent Agents (1/2)

AI in Finance Rates Trading Agent News Trades 25 AI - (2017 -2018) -Diaa

AI in Finance Rates Trading Agent News Trades 25 AI - (2017 -2018) -Diaa Eldein Mustafa - Lecture (3) - Intelligent Agents (1/2) Stock Market Bonds Commodities Market

AI in Robotics Cameras Microphones Touch Robot Environment Motors: wheels, legs, arms, grippers Voice

AI in Robotics Cameras Microphones Touch Robot Environment Motors: wheels, legs, arms, grippers Voice 26 AI - (2017 -2018) -Diaa Eldein Mustafa - Lecture (3) - Intelligent Agents (1/2)

AI in Games Your moves Game Agent You Its own moves 27 AI -

AI in Games Your moves Game Agent You Its own moves 27 AI - (2017 -2018) -Diaa Eldein Mustafa - Lecture (3) - Intelligent Agents (1/2)

AI in Medicine Vital Signals: blood Diagnostic Agent pressures, heart signals Diagnostics 28 AI

AI in Medicine Vital Signals: blood Diagnostic Agent pressures, heart signals Diagnostics 28 AI - (2017 -2018) -Diaa Eldein Mustafa - Lecture (3) - Intelligent Agents (1/2) You

AI and the Web Crawler Web Pages World Wide Web Information filtering. DB Information

AI and the Web Crawler Web Pages World Wide Web Information filtering. DB Information gathering Response Query You Crawler: a program that systematically browses the World Wide Web in order to create an index of data. 29 AI - (2017 -2018) -Diaa Eldein Mustafa - Lecture (3) - Intelligent Agents (1/2)

Thank You End 30 AI - (2017 -2018) -Diaa Eldein Mustafa - Lecture (3)

Thank You End 30 AI - (2017 -2018) -Diaa Eldein Mustafa - Lecture (3) - Intelligent Agents (1/2)