january 11, 2006ai: chapter 2: intelligent agents1 artificial intelligence chapter 2: intelligent...

21
January 11, 2006 AI: Chapter 2: Intelligen t Agents 1 Artificial Intelligence Chapter 2: Intelligent Agents Michael Scherger Department of Computer Science Kent State University

Upload: dylan-poole

Post on 18-Dec-2015

219 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: January 11, 2006AI: Chapter 2: Intelligent Agents1 Artificial Intelligence Chapter 2: Intelligent Agents Michael Scherger Department of Computer Science

January 11, 2006 AI: Chapter 2: Intelligent Agents

1

Artificial IntelligenceChapter 2: Intelligent

AgentsMichael Scherger

Department of Computer Science

Kent State University

Page 2: January 11, 2006AI: Chapter 2: Intelligent Agents1 Artificial Intelligence Chapter 2: Intelligent Agents Michael Scherger Department of Computer Science

January 11, 2006 AI: Chapter 2: Intelligent Agents

2

Agents and Environments

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

Agent

Enviro

nm

ent

Percepts

Actions

?

Sensors

Actuators

Page 3: January 11, 2006AI: Chapter 2: Intelligent Agents1 Artificial Intelligence Chapter 2: Intelligent Agents Michael Scherger Department of Computer Science

January 11, 2006 AI: Chapter 2: Intelligent Agents

3

Agents and Environments

• Percept – the agent’s perceptual inputs– percept sequence is a sequence of everything

the agent has ever perceived

• Agent Function – describes the agent’s behavior– Maps any given percept sequence to an action– f : P* -> A

• Agent Program – an implementation of an agent function for an artificial agent

Page 4: January 11, 2006AI: Chapter 2: Intelligent Agents1 Artificial Intelligence Chapter 2: Intelligent Agents Michael Scherger Department of Computer Science

January 11, 2006 AI: Chapter 2: Intelligent Agents

4

Agents and Environments

• Example: Vacuum Cleaner World– Two locations: squares A

and B– Perceives what square it is

in– Perceives if there is dirt in

the current square– Actions

• move left• move right• suck up the dirt• do nothing

A B

Page 5: January 11, 2006AI: Chapter 2: Intelligent Agents1 Artificial Intelligence Chapter 2: Intelligent Agents Michael Scherger Department of Computer Science

January 11, 2006 AI: Chapter 2: Intelligent Agents

5

Agents and Environments

• Agent Function: Vacuum Cleaner World– If the current

square is dirty, then suck, otherwise move to the other square

Percept Sequence Action

[A, Clean] Right

[A, Dirty] Suck

[B, Clean] Left

[B, Dirty] Suck

[A, Clean], [A, Clean] Right

[A, Clean], [A, Dirty] Suck

Page 6: January 11, 2006AI: Chapter 2: Intelligent Agents1 Artificial Intelligence Chapter 2: Intelligent Agents Michael Scherger Department of Computer Science

January 11, 2006 AI: Chapter 2: Intelligent Agents

6

Agents and Environments

• But what is the right way to fill out the table?– is the agent

• good or bad• intelligent or stupid

– can it be implemented in a small program?

Function Reflex-Vacuum-Agent([location, status]) return an action

if status == Dirty then return Suck

else if location = A then return Right

else if location = B then return Left

Page 7: January 11, 2006AI: Chapter 2: Intelligent Agents1 Artificial Intelligence Chapter 2: Intelligent Agents Michael Scherger Department of Computer Science

January 11, 2006 AI: Chapter 2: Intelligent Agents

7

Good Behavior and Rationality

• Rational Agent – an agent that does the “right” thing– Every entry in the table for the agent

function is filled out correctly– Doing the right thing is better than

doing the wrong thing• What does it mean to do the right thing?

Page 8: January 11, 2006AI: Chapter 2: Intelligent Agents1 Artificial Intelligence Chapter 2: Intelligent Agents Michael Scherger Department of Computer Science

January 11, 2006 AI: Chapter 2: Intelligent Agents

8

Good Behavior and Rationality

• Performance Measure– A scoring function for evaluating the

environment space

• 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 what ever built-in knowledge the agent has.

Page 9: January 11, 2006AI: Chapter 2: Intelligent Agents1 Artificial Intelligence Chapter 2: Intelligent Agents Michael Scherger Department of Computer Science

January 11, 2006 AI: Chapter 2: Intelligent Agents

9

Good Behavior and Rationality

• Rational != omniscient• Rational != clairvoyant• Rational != successful

• Rational -> exploration, learning, autonomy

Page 10: January 11, 2006AI: Chapter 2: Intelligent Agents1 Artificial Intelligence Chapter 2: Intelligent Agents Michael Scherger Department of Computer Science

January 11, 2006 AI: Chapter 2: Intelligent Agents

10

The Nature of Environments

• Task environments– The “problems” to which a rational

agent is the “solution”

• PEAS– Performance– Environment– Actuators– Sensors

Page 11: January 11, 2006AI: Chapter 2: Intelligent Agents1 Artificial Intelligence Chapter 2: Intelligent Agents Michael Scherger Department of Computer Science

January 11, 2006 AI: Chapter 2: Intelligent Agents

11

The Nature of Environments

• Properties of task environments– Fully Observable vs. Partially Observable– Deterministic vs. Stochastic– Episodic vs. Sequential– Static vs. Dynamic– Discrete vs. Continuous– Single agent vs. Multi-agent

• The real world is partially observable, stochastic, sequential, dynamic, continuous, multi-agent

Page 12: January 11, 2006AI: Chapter 2: Intelligent Agents1 Artificial Intelligence Chapter 2: Intelligent Agents Michael Scherger Department of Computer Science

January 11, 2006 AI: Chapter 2: Intelligent Agents

12

The Nature of Environments

• Examples– Solitaire– Backgammon– Automated Taxi– Mars Rover

Page 13: January 11, 2006AI: Chapter 2: Intelligent Agents1 Artificial Intelligence Chapter 2: Intelligent Agents Michael Scherger Department of Computer Science

January 11, 2006 AI: Chapter 2: Intelligent Agents

13

The Structure of Agents

• Agent = Architecture + Program

• 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

• Most AI programs are a variation of this theme

Page 14: January 11, 2006AI: Chapter 2: Intelligent Agents1 Artificial Intelligence Chapter 2: Intelligent Agents Michael Scherger Department of Computer Science

January 11, 2006 AI: Chapter 2: Intelligent Agents

14

The Structure of Agents

• Table Driven Agent

function Table-Driven-Agent (percept) return action

static: percepts, a sequence, initially empty

table, a table of actions, indexed by percept sequences, initially fully specified

append percept to the end of the table

action <- LOOKUP( percept, table )

return action

Page 15: January 11, 2006AI: Chapter 2: Intelligent Agents1 Artificial Intelligence Chapter 2: Intelligent Agents Michael Scherger Department of Computer Science

January 11, 2006 AI: Chapter 2: Intelligent Agents

15

The Structure of Agents

Simple Reflex Agent

Enviro

nm

ent

Percepts

Actions

What the world is like now

Sensors

ActuatorsWhat action I should do now

Condition-ActionRules

Page 16: January 11, 2006AI: Chapter 2: Intelligent Agents1 Artificial Intelligence Chapter 2: Intelligent Agents Michael Scherger Department of Computer Science

January 11, 2006 AI: Chapter 2: Intelligent Agents

16

The Structure of Agents

• Simple Reflex Agent

function Simple-Reflex-Agent (percept) return action

static: rules, a set of condition-action rules

state <- INTERPRET-INPUT( percept )

rule <- RULE-MATCH( state, rules )

action <- RULE-ACTION[ rule ]

return action

Page 17: January 11, 2006AI: Chapter 2: Intelligent Agents1 Artificial Intelligence Chapter 2: Intelligent Agents Michael Scherger Department of Computer Science

January 11, 2006 AI: Chapter 2: Intelligent Agents

17

The Structure of Agents

Reflex Agent With State

Enviro

nm

ent

Percepts

Actions

What the world is like now

Sensors

ActuatorsWhat action I should do now

Condition-ActionRules

State

How the world evolves

What my actions do

Page 18: January 11, 2006AI: Chapter 2: Intelligent Agents1 Artificial Intelligence Chapter 2: Intelligent Agents Michael Scherger Department of Computer Science

January 11, 2006 AI: Chapter 2: Intelligent Agents

18

The Structure of Agents

• Reflex Agent With State

function Reflex-Agent-With-State (percept) return action

static: state, a description of the current world state

rules, a set of condition-action rules

action, the most recent action, initially none

state <- UPDATE-STATE( state, action, percept )

rule <- RULE-MATCH( state, rules )

action <- RULE-ACTION[ rule ]

return action

Page 19: January 11, 2006AI: Chapter 2: Intelligent Agents1 Artificial Intelligence Chapter 2: Intelligent Agents Michael Scherger Department of Computer Science

January 11, 2006 AI: Chapter 2: Intelligent Agents

19

The Structure of Agents

Goal Based Agent

Enviro

nm

ent

Percepts

Actions

What the world is like now

Sensors

ActuatorsWhat action I should do now

Goals

State

How the world evolves

What my actions doWhat it will be like

if I do action A

Page 20: January 11, 2006AI: Chapter 2: Intelligent Agents1 Artificial Intelligence Chapter 2: Intelligent Agents Michael Scherger Department of Computer Science

January 11, 2006 AI: Chapter 2: Intelligent Agents

20

The Structure of Agents

Utility Based Agent

Enviro

nm

ent

Percepts

Actions

What the world is like now

Sensors

ActuatorsWhat action I should do now

Utility

State

How the world evolves

What my actions doWhat it will be like

if I do action A

How happy I will be in such a state

Page 21: January 11, 2006AI: Chapter 2: Intelligent Agents1 Artificial Intelligence Chapter 2: Intelligent Agents Michael Scherger Department of Computer Science

January 11, 2006 AI: Chapter 2: Intelligent Agents

21

The Structure of Agents

Learning Based Agent

Enviro

nm

ent

Percepts

Actions

Critic(external

performance standard)

Sensors

Actuators

PerformanceElement

LearningElement

ProblemGenerator

changes

knowledge

feedback

learning goals