Agents CPSC 386 Artificial Intelligence Ellen Walker Hiram College.

19
Agents CPSC 386 Artificial Intelligence Ellen Walker Hiram College

Transcript of Agents CPSC 386 Artificial Intelligence Ellen Walker Hiram College.

Page 1: Agents CPSC 386 Artificial Intelligence Ellen Walker Hiram College.

Agents

CPSC 386 Artificial IntelligenceEllen WalkerHiram College

Page 2: Agents CPSC 386 Artificial Intelligence Ellen Walker Hiram College.

Agents

• An agent perceives its environment through sensors, and acts upon it through actuators.

• The agent’s percepts are its impression of the sensor input.

• (The agent doesn’t necessarily know everything in its environment)

• Agents may have knowledge and/or memory

Page 3: Agents CPSC 386 Artificial Intelligence Ellen Walker Hiram College.

A Simple Vacuum Cleaner Agent

• 2 Locations, A and B• Dirt sensor (current location only)• Agent knows where it is• Actions: left, right, suck

• “Knowledge” represented by percept, action pairs(e.g. [A, dirty] -> (suck))

Page 4: Agents CPSC 386 Artificial Intelligence Ellen Walker Hiram College.

Agent Function vs. Agent Program

• Agent function:– Mathematical abstraction f(percepts) = action

– Externally observable (behavior)

• Agent program:– Concrete implementation of an algorithm that decides what the agent will do

– Runs within a “physical system”– Not externally observable (thought)

Page 5: Agents CPSC 386 Artificial Intelligence Ellen Walker Hiram College.

Rational Agents

• Rational Agents “do the right thing” based on– Performance measure that defines criterion of success

– The agent’s prior knowledge of the environment

– Actions that the agent can perform– Agent’s percept sequence to date

• Rationality is not omniscience; it optimizes expected performance, based on (necessarily) incomplete information.

Page 6: Agents CPSC 386 Artificial Intelligence Ellen Walker Hiram College.

Program for an Agent

• Repeat forever1. Record latest percept from sensors

into memory2. Choose best action based on memory3. Record action in memory4. Perform action (observe results)

• Almost all of AI elaborates this!

Page 7: Agents CPSC 386 Artificial Intelligence Ellen Walker Hiram College.

A Reasonable Vacuum Program

• [A, dirty] -> suck• [B, dirty] -> suck• [A, clean] -> right• [B, clean] -> left

• What goals will this program satisfy?• What are pitfalls, if any?• Does a longer history of percepts help?

Page 8: Agents CPSC 386 Artificial Intelligence Ellen Walker Hiram College.

Aspects of Agent Behavior

• Information gathering - actions that modify future percepts

• Learning - modifying the program based on actions and perceived results

• Autonomy - agent’s behavior depends on its own percepts, rather than designer’s programming (a priori knowledge)

Page 9: Agents CPSC 386 Artificial Intelligence Ellen Walker Hiram College.

Specifying Task Environment

• Performance measure• Environment (real world or “artificial”)• Actuators• Sensors

• Examples:– Pilot– Rat in a maze– Surgeon– Search engine

Page 10: Agents CPSC 386 Artificial Intelligence Ellen Walker Hiram College.

Properties of Environments

• Fully vs. partially observable (e.g. map?)

• Single-agent vs. multi-agent– Adversaries (competitive)– Teammates (cooperative)

• Deterministic vs. stochastic – May appear stochastic if only partially observable (e.g. card game)

– Strategic: deterministic except for other agents

• (Uncertain = not fully observable, or nondeterministic)

Page 11: Agents CPSC 386 Artificial Intelligence Ellen Walker Hiram College.

Properties (cont)

• Episodic vs. Sequential – Do we need to know history?

• Static vs. Dynamic – Does environment change while agent is thinking?

• Discrete vs. Continuous– Time, space, actions

• Known vs. Unknown– Does the agent know the “rules” or “laws of physics”?

Page 12: Agents CPSC 386 Artificial Intelligence Ellen Walker Hiram College.

Examples

• Solitaire• Driving• Conversation• Chess• Internet search• Lawn mowing

Page 13: Agents CPSC 386 Artificial Intelligence Ellen Walker Hiram College.

Agent Types

• Reflex• Model-based Reflex• Goal based• Utility based

Page 14: Agents CPSC 386 Artificial Intelligence Ellen Walker Hiram College.

Reflex Agent

AgentEnviron-

mentsensors

effectors

world now

action now

rules

Page 15: Agents CPSC 386 Artificial Intelligence Ellen Walker Hiram College.

Model-Based Reflex Agent

AgentEnviron-

mentsensors

effectors

world now

action now

rules

state

how world evolves

what actions do

Page 16: Agents CPSC 386 Artificial Intelligence Ellen Walker Hiram College.

Goal Based

AgentEnviron-

mentsensors

effectors

world now

action now

goals

state

how world evolves

what actions do future world

Page 17: Agents CPSC 386 Artificial Intelligence Ellen Walker Hiram College.

Utility Based

AgentEnviron-

mentsensors

effectors

world now

action now

utility

state

how world evolves

what actions do future world

"happiness"

Page 18: Agents CPSC 386 Artificial Intelligence Ellen Walker Hiram College.

Learning Agent

PerformanceElement

(was agent)

Environment

Critic

LearningElement

Problem Generator

L. Goals

Feedback

Sensors

Effectors

changes

know-ledge

Page 19: Agents CPSC 386 Artificial Intelligence Ellen Walker Hiram College.

Classes of Representations

• Atomic– State is indivisible

• Factored– State consists of attributes and values

• Structured– State consists of objects (which have attributes and relate to other objects)