dcp 1172 introduction to artificial intelligence ch.1 & ch.2 [aima] chang-sheng chen

76
DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

Upload: bertram-carter

Post on 27-Dec-2015

217 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172Introduction to Artificial Intelligence

Ch.1 & Ch.2 [AIMA]

Chang-Sheng Chen

Page 2: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

AI Study/Research Map

• Turing Test• Search-base System• Knowledge-base System• Logical Reasoning System• Neural Network• Fuzzy Network• Machine Learning• Genetic Programming

Page 3: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

Applied Areas of AI

• Game playing• Speech and language processing• Expert reasoning• Planning and scheduling• Vision• Robotics…

Page 4: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

The ArchitecturalComponents of AI Systems

• State-space search

• Knowledge representation

• Logical reasoning

• Reasoning under uncertainty

• Learning

Page 5: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

The History of AI

• The “Dark Ages”, or the birth of artificial intelligence (1943-1956)

• The rise of artificial intelligence, or the era of great expectation (1956-late 1960s)

• Unfulfilled promises, or the impact of reality ( late 1960s – early 1970s)

• The technology of expert system, or the key to success ( early 1970 – mid-1980)

• How to make machine learn, or the rebirth of neural networks ( mid-1980 – present)

• Evolutionary Computation, or learn by doing ( early 1970-present)

Page 6: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

Acting Humanly: The Turing Test

• Alan Turing's 1950 article Computing Machinery and Intelligence discussed conditions for considering a machine to be intelligent“Can machines think?” “Can machines behave intelligently?”

• The Turing test (The Imitation Game): Operational definition of intelligence.

Page 7: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

Acting Humanly: The Turing Test

• Computer needs to possess: Natural language processing, Knowledge representation, Automated reasoning, and Machine learning

• Are there any problems/limitations to the Turing Test?

Page 8: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

Some Examples

• Playing chess• Driving on the highway• Translating languages• Diagnosing diseases

• Recognizing pattern (e.g., speech, characters, etc.)

• Mowing the lawn• Internet-based

applications (e.g., spam filtering, intrusion detection/prevention, etc.)

Page 9: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

Playing Chess

• Environment?• Board

• Actions?• Legal moves

• Doing the right thing?• Moves that lead to wins

Page 10: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

Recognizing Speech

• Environment• Audio signal

• Knowledge of user

• Actions• Choosing word sequences

• Doing the right thing• Recovering the users words

Page 11: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

Translation

• Environment• Source text to be translated

• Actions• Word sequences in target language

• Doing the right thing?• Words that achieve the same effect

• Words that are faithful to the source

Page 12: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

Recognizing Pattern

• Environment• Visual Characters (e.g., OCR)

• Optical Character Recognition• Knowledge of user

• Actions• reading text from paper • translating the images into a form that the computer can

manipulate (for example, into ASCII codes). • Doing the right thing

• Recovering the users writing and/or printing words

Page 13: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

Diagnosing Diseases

• Environment• Patient information• Results of tests

• Actions• Choosing diseases• Choosing treatments

• Doing the right thing• Eliminating disease

Page 14: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

Driving

• Environment• Restricted access highway

• Actions• Accelerate, brake, turn, navigate, other controls

• Doing the right thing• Stay safe, get where you want to go, get there quickly,

don’t get a ticket

Page 15: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

Cloth Washing

• Environment• Washing machine in a washroom

• Actions• Washing (e.g., twisting, circulation, etc.) • Refueling clean water• Dumping dirty water

• Doing the right thing• Make clothes look clean in a timely manner

Page 16: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

Internet-based Application

• Pattern recognition• Anti-virus, Intrusion detection system (IDS)

• Content filtering• Anti-SPAM Mail filtering

• Network Security• Intrusion detection/prevention system

Page 17: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

Acting Humanly: The Full Turing Test

• Alan Turing's 1950 article Computing Machinery and Intelligence discussed conditions for considering a machine to be intelligent

• “Can machines think?” “Can machines behave intelligently?”

• The Turing test (The Imitation Game): Operational definition of intelligence.

• Computer needs to posses:Natural language processing, Knowledge representation, Automated reasoning, and Machine learning

• Problem: 1) Turing test is not reproducible, constructive, and amenable to mathematic analysis. 2) What about physical interaction with interrogator and environment?

• Total Turing Test: Requires physical interaction and needs perception and actuation.

Page 18: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

Acting Humanly: The Full Turing Test

• Problem: 1) Turing test is not reproducible, constructive, and amenable to mathematic analysis. 2) What about physical interaction with interrogator and environment?

Page 19: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

Acting Humanly: The Full Turing Test

Problem: 1) Turing test is not reproducible, constructive, and amenable to mathematic analysis. 2) What about physical interaction with interrogator and environment?

Trap door

Page 20: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

What would a computer need to pass the Turing test?

• Natural language processing: to communicate with examiner.

• Knowledge representation: to store and retrieve information provided before or during interrogation.

• Automated reasoning: to use the stored information to answer questions and to draw new conclusions.

• Machine learning: to adapt to new circumstances and to detect and extrapolate patterns.

Page 21: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

What would a computer need to pass the Turing test?

• Vision (for Total Turing test): to recognize the examiner’s actions and various objects presented by the examiner.

• Motor control (total test): to act upon objects as requested.

• Other senses (total test): such as audition, smell, touch, etc.

Page 22: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

Thinking Humanly: Cognitive Science

• 1960 “Cognitive Revolution”: information-processing psychology replaced behaviorism

• Cognitive science brings together theories and experimental evidence to model internal activities of the brain

• What level of abstraction? “Knowledge” or “Circuits”?

• How to validate models?• Predicting and testing behavior of human subjects (top-down)

• Direct identification from neurological data (bottom-up)

• Building computer/machine simulated models and reproduce results (simulation)

Page 23: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

Thinking Rationally: Laws of Thought

• Aristotle (~ 450 B.C.) attempted to codify “right thinking”What are correct arguments/thought processes?

• E.g., “Socrates is a man, all men are mortal; therefore Socrates is mortal”

• Several Greek schools developed various forms of logic:notation plus rules of derivation for thoughts.

Page 24: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

Thinking Rationally: Laws of Thought

• Problems: 1) Uncertainty: Not all facts are certain (e.g., the flight might

be delayed).

2) Resource limitations:- Not enough time to compute/process

- Insufficient memory/disk/etc

- Etc.

Page 25: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

Acting Rationally: The Rational Agent

• Rational behavior: Doing the right thing!

• The right thing: That which is expected to maximize the expected return

• Provides the most general view of AI because it includes: • Correct inference (“Laws of thought”)• Uncertainty handling • Resource limitation considerations (e.g., reflex vs. deliberation)• Cognitive skills (NLP, AR, knowledge representation, ML, etc.)

• Advantages:1) More general2) Its goal of rationality is well defined

Page 26: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

How to achieve AI?

• How is AI research done?

• AI research has both theoretical and experimental sides. The experimental side has both basic and applied aspects.

• There are two main lines of research:• One is biological, based on the idea that since humans are intelligent, AI

should study humans and imitate their psychology or physiology. • The other is phenomenal, based on studying and formalizing common

sense facts about the world and the problems that the world presents to the achievement of goals.

• The two approaches interact to some extent, and both should eventually succeed. It is a race, but both racers seem to be walking. [John McCarthy]

Page 27: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2Khan & McLeod, 2000

Onto

log

y

Page 28: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

The task-relevance map

Scalar topographic map, with higher values at more relevant locations

Page 29: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

More formally: how do we do it? (1)

- Use ontology to describe categories, objects and relationships:

Either with unary predicates, e.g., Human(John),

Or with reified categories, e.g., John Humans,

And with rules that express relationships or properties,

e.g., x Human(x) SinglePiece(x) Mobile(x) Deformable(x)

Page 30: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

More formally: how do we do it? (2)

- Use ontology to expand concepts to related concepts:

E.g., parsing question yields “LookFor(catching)”

Assume a category HandActions and a taxonomy defined by

catching HandActions, grasping HandActions, etc.

We can expand “LookFor(catching)” to looking for other actions in the category where catching belongs through a simple expansion rule:

a,b,c a c b c LookFor(a) LookFor(b)

Page 31: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

Last Time: Acting Humanly: The Full Turing Test

• Alan Turing's 1950 article Computing Machinery and Intelligence discussed conditions for considering a machine to be intelligent• “Can machines think?” “Can machines behave intelligently?”

• The Turing test (The Imitation Game): Operational definition of intelligence.

• Computer needs to possess: Natural language processing, Knowledge representation, Automated reasoning, and Machine learning

• Problem: 1) Turing test is not reproducible, constructive, and amenable to mathematic analysis. 2) What about physical interaction with interrogator and environment?

• Total Turing Test: Requires physical interaction and needs perception and actuation.

Page 32: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

Last time: The Turing Test

http://www.ai.mit.edu/projects/infolab/http://aimovie.warnerbros.com

Page 33: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

Last time: The Turing Test

http://www.ai.mit.edu/projects/infolab/http://aimovie.warnerbros.com

Page 34: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

Last time: The Turing Test

http://www.ai.mit.edu/projects/infolab/http://aimovie.warnerbros.com

Page 35: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

Last time: The Turing Test

http://www.ai.mit.edu/projects/infolab/http://aimovie.warnerbros.com

Page 36: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

Last time: The Turing Test

http://www.ai.mit.edu/projects/infolab/http://aimovie.warnerbros.com

Page 37: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

This time: Outline

• Intelligent Agents (IA)• Environment types• IA Behavior• IA Structure• IA Types

Page 38: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

What is an (Intelligent) Agent?

• An over-used, over-loaded, and misused term.

• Anything that can be viewed as perceiving its environment through sensors and acting upon that environment through its actuators to maximize progress towards its goals.

Page 39: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

What is an (Intelligent) Agent?

• PAGE (Percepts, Actions, Goals, Environment)

• Task-specific & specialized: well-defined goals and environment

• The notion of an agent is meant to be a tool for analyzing systems, • It is not a different hardware or new

programming languages

Page 40: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

• Example: Human mind as network of thousands or millions of agents working in parallel. To produce real artificial intelligence, this school holds, we should build computer systems that also contain many agents and systems for arbitrating among the agents' competing results.

• Distributed decision-making and control

• Challenges:• Action selection: What next action to choose• Conflict resolution

Intelligent Agents and Artificial Intelligence

sensors

actuators

Agency

Page 41: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

Agent Types

We can split agent research into two main strands:

• Distributed Artificial Intelligence (DAI) – Multi-Agent Systems (MAS) (1980 – 1990)

• Much broader notion of "agent" (1990’s – present)

• interface, reactive, mobile, information

Page 42: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

Rational Agents

EnvironmentAgent

percepts

actions

?

Sensors

Actuators

How to design this?

Page 43: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

Remember: the Beobot example

Page 44: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

A Windshield Wiper Agent

How do we design a agent that can wipe the windshields

when needed?

• Goals?

• Percepts?

• Sensors?

• Effectors?

• Actions?

• Environment?

Page 45: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

A Windshield Wiper Agent (Cont’d)

• Goals: Keep windshields clean & maintain visibility

• Percepts: Raining, Dirty

• Sensors: Camera (moist sensor)

• Effectors: Wipers (left, right, back)

• Actions: Off, Slow, Medium, Fast

• Environment: Inner city, freeways, highways, weather …

Page 46: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

Towards Autonomous Vehicles

http://iLab.usc.edu

http://beobots.org

Page 47: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

Interacting Agents

Collision Avoidance Agent (CAA)• Goals: Avoid running into obstacles• Percepts ?• Sensors?• Effectors ?• Actions ?• Environment: Freeway

Lane Keeping Agent (LKA)• Goals: Stay in current lane• Percepts ?• Sensors?• Effectors ?• Actions ?• Environment: Freeway

Page 48: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

Interacting Agents

Collision Avoidance Agent (CAA)• Goals: Avoid running into obstacles• Percepts: Obstacle distance, velocity, trajectory• Sensors: Vision, proximity sensing• Actuators: Steering Wheel, Accelerator, Brakes, Horn, Headlights• Actions: Steer, speed up, brake, blow horn, signal (headlights)• Environment: Freeway

Lane Keeping Agent (LKA)• Goals: Stay in current lane• Percepts: Lane center, lane boundaries• Sensors: Vision• Actuators: Steering Wheel, Accelerator, Brakes• Actions: Steer, speed up, brake• Environment: Freeway

Page 49: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

Conflict Resolution by Action Selection Agents

• Override: CAA overrides LKA

• Arbitrate: if Obstacle is Close then CAAelse LKA

• Compromise: Choose action that satisfies both

agents

• Any combination of the above

• Challenges: Doing the right thing

Page 50: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

The Right Thing = The Rational Action

• Rational Action: The action that maximizes the expected value of the performance measure given the percept sequence to date

• Rational = Best ?

• Rational = Optimal ?

• Rational = Omniscience ? ( 無所不知 , …)

• Rational = Clairvoyant ? (預知未來 , 和死者溝通 , ..)

• Rational = Successful ?

Page 51: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

The Right Thing = The Rational Action

• Rational Action: The action that maximizes the expected value of the performance measure given the percept sequence to date

• Rational = Best Yes, to the best of its knowledge

• Rational = Optimal Yes, to the best of its abilities (incl.

• Rational Omniscience its constraints)

• Rational Clairvoyant

• Rational Successful

Page 52: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

Behavior and performance of IAs

• Perception (sequence) to Action Mapping: f : P* A• Ideal mapping: specifies which actions an agent ought to take at any

point in time

• Description: Look-Up-Table, Closed Form, etc.

• Performance measure: a subjective measure to characterize how successful an agent is (e.g., speed, power usage, accuracy, money, etc.)

• (degree of) Autonomy: to what extent is the agent able to make decisions and take actions on its own?

Page 53: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

Look up table

agent

obstacle

sensor

Distance Action

10 No action

5 Turn left 30 degrees

2 Stop

Page 54: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

Closed form

• Output (degree of rotation) = F(distance)

• E.g., F(d) = 10/d (distance cannot be less than 1/18)

Page 55: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

How is an Agent different from other software?

• Agents are autonomous, that is, they act on behalf of the user

• Agents contain some level of intelligence, from fixed rules to learning engines that allow them to adapt to changes in the environment

• Agents don‘t only act reactively (被動地因應改變 ), but sometimes also proactively ( 主動地改變 )

Page 56: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

How is an Agent different from other software?

• Agents have social ability, that is, they communicate with the user, the system, and other agents as required

• Agents may also cooperate with other agents to carry out more complex tasks than they themselves can handle

• Agents may migrate from one system to another to access remote resources or even to meet other agents

• Example: E-mail Systems• Mail Transfer Agent ( MTA, e.g., Sendmail, Postfix, etc.)• Mail User Agent ( MUA, e.g., Outlook express, Netscape

communicator, etc.)

Page 57: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

Environment Types

• Characteristics• Fully observable vs. partially observable

• Deterministic vs. Stochastic (nondeterministic)

• Episodic vs. Sequential (nonepisodic)• Episodic(獨立事件 , 或前後沒有明顯關聯性 )

• Hostile vs. friendly

• Static vs. dynamic

• Discrete vs. continuous

• Example: anti-SPAM filtering • Filtering by regular expression (e.g., fixed pattern)

• Filtering by Bayesian Learning Network

• …

Page 58: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

Environment Types

• Characteristics• Fully observable vs. partially observable

• Sensors give access to complete state of the environment.

• Deterministic vs. Stochastic (nondeterministic)• The next state can be determined based on the current state and

the action.

• Episodic vs. Sequential (nonepisodic)• Episode: each perceive and action pairs

• The quality of action does not depend on the previous episode.

Page 59: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

Environment Types

• Characteristics• Hostile vs. friendly

• Static vs. dynamic• Dynamic if the environment changes during deliberation

• Discrete vs. continuous • Chess vs. driving

Page 60: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

Structure of Intelligent Agents

• Agent = architecture + program

• Agent program: the implementation of f : P* A, the agent’s perception-action mapping

function Skeleton-Agent(Percept) returns Actionmemory UpdateMemory(memory, Percept)Action ChooseBestAction(memory)memory UpdateMemory(memory, Action)

return Action

• Architecture: a device that can execute the agent program (e.g., general-purpose computer, specialized device, beobot, etc.)

Page 61: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

Using a look-up-table to encode f : P* A

• Example: Collision Avoidance• Sensors: 3 proximity sensors

• Effectors:Steering Wheel, Brakes

• How to generate?

• How large?

• How to select action?agent

obstacle

sensors

Page 62: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

Using a look-up-table to encode f : P* A

• Example: Collision Avoidance• Sensors: 3 proximity sensors • Effectors: Steering Wheel, Brakes

• How to generate: for each p Pl Pm Pr

generate an appropriate action, a S B

• How large: size of table = #possible percepts times # possible actions = |Pl | |Pm| |Pr| |S| |B|E.g., P = {close, medium, far}3

A = {left, straight, right} {on, off}then size of table = 27*3*2 = 162

• How to select action? Search.

agent

obstaclesensors

Page 63: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

Agent types

• Simple reflex agents• Model-base reflex agents (with internal states)• Goal-based agents• Utility-based agents

Page 64: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

Agent types

• Simple reflex agents • Reactive: No memory

• Model-based reflex agents (with internal states)• A model of the world = knowledge about “how the world

works”

• W/o previous state, may not be able to make decision • E.g. brake lights at night.

• Goal-based agents• Goal information needed to make decision

Page 65: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

Agent types

• Utility-based agents• How well can the goal be achieved (degree of happiness)

• What to do if there are conflicting goals?• Speed and safety

• Which goal should be selected if several can be achieved?

Page 66: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

Simple reflex agents

Actuators

Page 67: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

Simple reflex (reactive) agents

• Reactive agents do not have internal symbolic models. • Act by stimulus-response to the current state of the

environment. • Each reactive agent is simple and interacts with others in a basic

way. • Complex patterns of behavior emerge from their interaction.

• Benefits: robustness, fast response time • Challenges: scalability, how intelligent?

and how do you debug them?

Page 68: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

Model-based reflex agents w/ state

Actuators

Page 69: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

Goal-based agents

Actuators

Page 70: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

Utility-based agents

Actuators

Page 71: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

Mobile agents

• Programs that can migrate from one machine to another.

• Execute in a platform-independent execution environment.

• Require agent execution environment (places).

• Mobility not necessary or sufficient condition for agenthood.

• Practical but non-functional advantages: • Reduced communication cost (eg, from PDA)

• Asynchronous computing (when you are not connected)

• Two types: • One-hop mobile agents (migrate to one other place)

• Multi-hop mobile agents (roam the network from place to place)

• Applications: • Distributed information retrieval.

• Telecommunication network routing.

Page 72: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

Mobile agents

• Programs that can migrate from one machine to another.

• Execute in a platform-independent execution environment.

• Require agent execution environment (places).

• Mobility not necessary or sufficient condition for agenthood.

A mail agent

Page 73: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

Mobile agents

• Practical but non-functional advantages: • Reduced communication cost (e.g. from PDA)

• Asynchronous computing (when you are not connected)

• Two types: • One-hop mobile agents (migrate to one other place)

• Multi-hop mobile agents (roam the network from place to place)

Page 74: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

Mobile agents

• Applications: • Distributed information retrieval.

• Telecommunication network routing.

Page 75: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

Information agents

• Manage the explosive growth of information. • Manipulate or collate information from many distributed sources. • Information agents can be mobile or static.

• Examples: • BargainFinder comparison shops among Internet stores for CDs • FIDO the Shopping Doggie (out of service)• Internet Softbot infers which internet facilities (finger, ftp, gopher) to use and

when from high-level search requests.

• Challenge: ontologies for annotating Web pages • (e.g., SHOE=Simple HTML Ontology extension).

Page 76: DCP 1172 Introduction to Artificial Intelligence Ch.1 & Ch.2 [AIMA] Chang-Sheng Chen

DCP 1172, Lecture 2

Summary

• Intelligent Agents:• Anything that can be viewed as perceiving its environment

through sensors and acting upon that environment through its actuators to maximize progress towards its goals.

• PAGE (Percepts, Actions, Goals, Environment)• Described as a Perception (sequence) to Action Mapping: f : P*

A• Using look-up-table, closed form, etc.

• Agent Types: Simple reflex, model-based, goal-based, utility-based

• Rational Action: The action that maximizes the expected value of the performance measure given the percept sequence to date