24
An introduction to Artificial Intelligence CE-40417 CE-40417 Lecture 2: Intelligent Agents Ramin Halavati ([email protected]) In which we discuss what an intelligent agent does, how it is related to its environment, how it is evolved, and how we might go about building one.

CE-40417 An introduction to Artificial Intelligence CE-40417 Lecture 2: Intelligent Agents Ramin Halavati ([email protected]) In which we discuss

Embed Size (px)

Citation preview

Page 1: CE-40417 An introduction to Artificial Intelligence CE-40417 Lecture 2: Intelligent Agents Ramin Halavati (halavati@ce.sharif.edu) In which we discuss

An introduction to Artificial Intelligence CE-40417CE-40417

Lecture 2: Intelligent Agents

Ramin Halavati ([email protected])

In which we discuss what an intelligent agent does, how it is related to its environment, how it is evolved, and how we might go about building one.

Page 2: CE-40417 An introduction to Artificial Intelligence CE-40417 Lecture 2: Intelligent Agents Ramin Halavati (halavati@ce.sharif.edu) In which we discuss

Outline

• Agents and environments…

• Rationality

• Environment types

• Agent types

Page 3: CE-40417 An introduction to Artificial Intelligence CE-40417 Lecture 2: Intelligent Agents Ramin Halavati (halavati@ce.sharif.edu) In which we discuss

Agents

• An agent is anything that can be viewed as perceiving its environment through sensors and acting upon that environment through actuators

• Human agent: eyes, ears, and other organs for sensors; hands, legs, mouth, and other body parts for actuators.

• Robotic agent: cameras and infrared range finders for sensors; various motors for actuators.

Page 4: CE-40417 An introduction to Artificial Intelligence CE-40417 Lecture 2: Intelligent Agents Ramin Halavati (halavati@ce.sharif.edu) In which we discuss

Rational Agent?

• What action makes the agent more successful.

• How to Evaluate?– Internal / External– You’ll get what you seek

• When to Evaluate?

Page 5: CE-40417 An introduction to Artificial Intelligence CE-40417 Lecture 2: Intelligent Agents Ramin Halavati (halavati@ce.sharif.edu) In which we discuss

Rational Agents

• Rational Agent: For each possible percept sequence, a rational agent should select an action that is maximizes its performance measure.

•• Omniscience vs. Rationality: What does the

agent know?

Page 6: CE-40417 An introduction to Artificial Intelligence CE-40417 Lecture 2: Intelligent Agents Ramin Halavati (halavati@ce.sharif.edu) In which we discuss

Rational Agents

• Rational Agent: For each possible percept sequence, a rational agent should select an action that is expected to maximize its performance measure, given the evidence provided by the percept sequence and whatever built-in knowledge the agent has.

• 1. Performance Measure

2. Percept Sequence

3. Environmental Knowledge

4. Possible Actions

Page 7: CE-40417 An introduction to Artificial Intelligence CE-40417 Lecture 2: Intelligent Agents Ramin Halavati (halavati@ce.sharif.edu) In which we discuss

Rational agents

• Knowledge Extraction is an ActionKnowledge Extraction is an Action

• Mapping is Mapping is not necessarilynot necessarily using a table. using a table.

function SQRT( double X )function SQRT( double X ){{

double r = 1.0 ;double r = 1.0 ;

while ( fabs( r * r - x ) > 0.00000001 )while ( fabs( r * r - x ) > 0.00000001 )r = r - ( r * r - x ) / 2r ;r = r - ( r * r - x ) / 2r ;

return r ;return r ;}}

1.01.0 1.000001.000001.11.1 1.048981.048981.21.2 1.095651.095651.31.3 1.140561.14056......

Page 8: CE-40417 An introduction to Artificial Intelligence CE-40417 Lecture 2: Intelligent Agents Ramin Halavati (halavati@ce.sharif.edu) In which we discuss

Autonomy

• An agent is autonomous if its behavior is determined by its own experience (with ability to learn and adapt)

• Autonomous: ~ not under immediate control of human

• Benefits:– Environmental Change / Training

Page 9: CE-40417 An introduction to Artificial Intelligence CE-40417 Lecture 2: Intelligent Agents Ramin Halavati (halavati@ce.sharif.edu) In which we discuss

Primary Design Notes (PAGE)

• Perceptions

• Actions

• Goals

• Environments

Page 10: CE-40417 An introduction to Artificial Intelligence CE-40417 Lecture 2: Intelligent Agents Ramin Halavati (halavati@ce.sharif.edu) In which we discuss

PAGE Samples…

• Agent: Automated taxi driver

– Perceptions: Cameras, sonar, speedometer, GPS, odometer, engine sensors, microphone

– Actions: Steering wheel, accelerator, brake, signal, horn

– Goal: Safe, fast, legal, comfortable trip, maximize profits

– Environment: Roads, other traffic, pedestrians, customers

–––

Page 11: CE-40417 An introduction to Artificial Intelligence CE-40417 Lecture 2: Intelligent Agents Ramin Halavati (halavati@ce.sharif.edu) In which we discuss

PAGE Samples…

• Agent: Medical diagnosis system

– Perceptions: Keyboard (entry of symptoms, findings, patient's answers)

– Actions: Screen display (questions, tests, diagnoses, treatments, referrals)

– Goal: Healthy patient, minimize costs, lawsuits

– Environment: Patient, hospital, staff

Page 12: CE-40417 An introduction to Artificial Intelligence CE-40417 Lecture 2: Intelligent Agents Ramin Halavati (halavati@ce.sharif.edu) In which we discuss

PAGE Samples…

• Agent: Part picking robot

– Perceptions: Camera, joint angle sensors

– Actions: Jointed arm and hand

– Goal: Percentage of parts in correct bins

– Environment: Conveyor belt with parts, bins

Page 13: CE-40417 An introduction to Artificial Intelligence CE-40417 Lecture 2: Intelligent Agents Ramin Halavati (halavati@ce.sharif.edu) In which we discuss

PAGE Samples…

• Agent: Interactive English tutor

– Perceptions: Keyboard

– Actions: Screen display (exercises, suggestions, corrections)

– Goal: Maximize student's score on test

– Environment: Set of students

Page 14: CE-40417 An introduction to Artificial Intelligence CE-40417 Lecture 2: Intelligent Agents Ramin Halavati (halavati@ce.sharif.edu) In which we discuss

Environment types

• Fully observable (vs. partially observable): An agent's sensors give it access to the complete state of the environment at each point in time.

• Deterministic (vs. stochastic): The next state of the environment is completely determined by the current state and the action executed by the agent. (If the environment is deterministic except for the actions of other agents, then the environment is strategic)

• Episodic (vs. sequential): The agent's experience is divided into atomic "episodes" (each episode consists of the agent perceiving and then performing a single action), and the choice of action in each episode depends only on the episode itself.

••

Page 15: CE-40417 An introduction to Artificial Intelligence CE-40417 Lecture 2: Intelligent Agents Ramin Halavati (halavati@ce.sharif.edu) In which we discuss

Environment types

• Static (vs. dynamic): The environment is unchanged while an agent is deliberating. (The environment is semidynamic if the environment itself does not change with the passage of time but the agent's performance score does)

• Discrete (vs. continuous): A limited number of distinct, clearly defined percepts and actions.

• Single agent (vs. multiagent): An agent operating by itself in an environment.

••

Page 16: CE-40417 An introduction to Artificial Intelligence CE-40417 Lecture 2: Intelligent Agents Ramin Halavati (halavati@ce.sharif.edu) In which we discuss

Environment types

• The environment type largely determines the agent design

• The real world is (of course) partially observable, stochastic, sequential, dynamic, continuous, multi-agent

Page 17: CE-40417 An introduction to Artificial Intelligence CE-40417 Lecture 2: Intelligent Agents Ramin Halavati (halavati@ce.sharif.edu) In which we discuss

Agent Program Types:

• Look Up Table

• Simple Reflexive

• Model-based reflex agents

• Goal-based agents

• Utility-based agents

Page 18: CE-40417 An introduction to Artificial Intelligence CE-40417 Lecture 2: Intelligent Agents Ramin Halavati (halavati@ce.sharif.edu) In which we discuss

Look Up Table Agents

– Benefits:• Easy to implement

– Drawbacks:• Huge table• Take a long time to build the table• No autonomy• Even with learning, need a long time to learn the table

entries

Page 19: CE-40417 An introduction to Artificial Intelligence CE-40417 Lecture 2: Intelligent Agents Ramin Halavati (halavati@ce.sharif.edu) In which we discuss

Simple Reflex Agents

Page 20: CE-40417 An introduction to Artificial Intelligence CE-40417 Lecture 2: Intelligent Agents Ramin Halavati (halavati@ce.sharif.edu) In which we discuss

Model-based reflex agents

Page 21: CE-40417 An introduction to Artificial Intelligence CE-40417 Lecture 2: Intelligent Agents Ramin Halavati (halavati@ce.sharif.edu) In which we discuss

Goal-based agents

Page 22: CE-40417 An introduction to Artificial Intelligence CE-40417 Lecture 2: Intelligent Agents Ramin Halavati (halavati@ce.sharif.edu) In which we discuss

Utility-based agents

Page 23: CE-40417 An introduction to Artificial Intelligence CE-40417 Lecture 2: Intelligent Agents Ramin Halavati (halavati@ce.sharif.edu) In which we discuss

Agent Program Types:

• Look Up Table

• Simple Reflexive

• Model-based reflex agents

• Goal-based agents

• Utility-based agents

Page 24: CE-40417 An introduction to Artificial Intelligence CE-40417 Lecture 2: Intelligent Agents Ramin Halavati (halavati@ce.sharif.edu) In which we discuss

Summery

• Agent

• Rational Agent / Omniscience– Percept Sequence, Knowledge, – Performance Measures, Actions

• Pre-design Notes– Perceptions/Actions/Goal/Environment

• Architecture Levels

• Environment Types