chapter02thad/6601-gradai-fall2015/chapter02.pdf · title: chapter02.dvi

27
Intelligent Agents Chapter 2 Chapter 2 1

Upload: others

Post on 27-Sep-2020

14 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: chapter02thad/6601-gradAI-fall2015/chapter02.pdf · Title: chapter02.dvi

IntelligentAgents

Chapter2

Chapter21

Page 2: chapter02thad/6601-gradAI-fall2015/chapter02.pdf · Title: chapter02.dvi

Reminders

Assignment0(lisprefresher)due1/28

Lisp/emacs/AIMAtutorial:11-1todayandMonday,271Soda

Chapter22

Page 3: chapter02thad/6601-gradAI-fall2015/chapter02.pdf · Title: chapter02.dvi

Outline

♦Agentsandenvironments

♦Rationality

♦PEAS(Performancemeasure,Environment,Actuators,Sensors)

♦Environmenttypes

♦Agenttypes

Chapter23

Page 4: chapter02thad/6601-gradAI-fall2015/chapter02.pdf · Title: chapter02.dvi

Agentsandenvironments

?

agent

percepts

sensors

actions

environment

actuators

Agentsincludehumans,robots,softbots,thermostats,etc.

Theagentfunctionmapsfrompercepthistoriestoactions:

f:P∗→A

Theagentprogramrunsonthephysicalarchitecturetoproducef

Chapter24

Page 5: chapter02thad/6601-gradAI-fall2015/chapter02.pdf · Title: chapter02.dvi

Vacuum-cleanerworld

AB

Percepts:locationandcontents,e.g.,[A,Dirty]

Actions:Left,Right,Suck,NoOp

Chapter25

Page 6: chapter02thad/6601-gradAI-fall2015/chapter02.pdf · Title: chapter02.dvi

Avacuum-cleaneragent

PerceptsequenceAction[A,Clean]Right

[A,Dirty]Suck

[B,Clean]Left

[B,Dirty]Suck

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

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

functionReflex-Vacuum-Agent([location,status])returnsanaction

ifstatus=DirtythenreturnSuck

elseiflocation=AthenreturnRight

elseiflocation=BthenreturnLeft

Whatistherightfunction?Canitbeimplementedinasmallagentprogram?

Chapter26

Page 7: chapter02thad/6601-gradAI-fall2015/chapter02.pdf · Title: chapter02.dvi

Rationality

Fixedperformancemeasureevaluatestheenvironmentsequence–onepointpersquarecleanedupintimeT?–onepointpercleansquarepertimestep,minusonepermove?–penalizefor>kdirtysquares?

Arationalagentchooseswhicheveractionmaximizestheexpectedvalueoftheperformancemeasuregiventheperceptsequencetodate

Rational6=omniscient–perceptsmaynotsupplyallrelevantinformation

Rational6=clairvoyant–actionoutcomesmaynotbeasexpected

Hence,rational6=successful

Rational⇒exploration,learning,autonomy

Chapter27

Page 8: chapter02thad/6601-gradAI-fall2015/chapter02.pdf · Title: chapter02.dvi

PEAS

Todesignarationalagent,wemustspecifythetaskenvironment

Consider,e.g.,thetaskofdesigninganautomatedtaxi:

Performancemeasure??

Environment??

Actuators??

Sensors??

Chapter28

Page 9: chapter02thad/6601-gradAI-fall2015/chapter02.pdf · Title: chapter02.dvi

PEAS

Todesignarationalagent,wemustspecifythetaskenvironment

Consider,e.g.,thetaskofdesigninganautomatedtaxi:

Performancemeasure??safety,destination,profits,legality,comfort,...

Environment??USstreets/freeways,traffic,pedestrians,weather,...

Actuators??steering,accelerator,brake,horn,speaker/display,...

Sensors??video,accelerometers,gauges,enginesensors,keyboard,GPS,...

Chapter29

Page 10: chapter02thad/6601-gradAI-fall2015/chapter02.pdf · Title: chapter02.dvi

Internetshoppingagent

Performancemeasure??

Environment??

Actuators??

Sensors??

Chapter210

Page 11: chapter02thad/6601-gradAI-fall2015/chapter02.pdf · Title: chapter02.dvi

Internetshoppingagent

Performancemeasure??price,quality,appropriateness,efficiency

Environment??currentandfutureWWWsites,vendors,shippers

Actuators??displaytouser,followURL,fillinform

Sensors??HTMLpages(text,graphics,scripts)

Chapter211

Page 12: chapter02thad/6601-gradAI-fall2015/chapter02.pdf · Title: chapter02.dvi

Environmenttypes

SolitaireBackgammonInternetshoppingTaxiObservable??Deterministic??Episodic??Static??Discrete??Single-agent??

Chapter212

Page 13: chapter02thad/6601-gradAI-fall2015/chapter02.pdf · Title: chapter02.dvi

Environmenttypes

SolitaireBackgammonInternetshoppingTaxiObservable??YesYesNoNoDeterministic??Episodic??Static??Discrete??Single-agent??

Chapter213

Page 14: chapter02thad/6601-gradAI-fall2015/chapter02.pdf · Title: chapter02.dvi

Environmenttypes

SolitaireBackgammonInternetshoppingTaxiObservable??YesYesNoNoDeterministic??YesNoPartlyNoEpisodic??Static??Discrete??Single-agent??

Chapter214

Page 15: chapter02thad/6601-gradAI-fall2015/chapter02.pdf · Title: chapter02.dvi

Environmenttypes

SolitaireBackgammonInternetshoppingTaxiObservable??YesYesNoNoDeterministic??YesNoPartlyNoEpisodic??NoNoNoNoStatic??Discrete??Single-agent??

Chapter215

Page 16: chapter02thad/6601-gradAI-fall2015/chapter02.pdf · Title: chapter02.dvi

Environmenttypes

SolitaireBackgammonInternetshoppingTaxiObservable??YesYesNoNoDeterministic??YesNoPartlyNoEpisodic??NoNoNoNoStatic??YesSemiSemiNoDiscrete??Single-agent??

Chapter216

Page 17: chapter02thad/6601-gradAI-fall2015/chapter02.pdf · Title: chapter02.dvi

Environmenttypes

SolitaireBackgammonInternetshoppingTaxiObservable??YesYesNoNoDeterministic??YesNoPartlyNoEpisodic??NoNoNoNoStatic??YesSemiSemiNoDiscrete??YesYesYesNoSingle-agent??

Chapter217

Page 18: chapter02thad/6601-gradAI-fall2015/chapter02.pdf · Title: chapter02.dvi

Environmenttypes

SolitaireBackgammonInternetshoppingTaxiObservable??YesYesNoNoDeterministic??YesNoPartlyNoEpisodic??NoNoNoNoStatic??YesSemiSemiNoDiscrete??YesYesYesNoSingle-agent??YesNoYes(exceptauctions)No

Theenvironmenttypelargelydeterminestheagentdesign

Therealworldis(ofcourse)partiallyobservable,stochastic,sequential,dynamic,continuous,multi-agent

Chapter218

Page 19: chapter02thad/6601-gradAI-fall2015/chapter02.pdf · Title: chapter02.dvi

Agenttypes

Fourbasictypesinorderofincreasinggenerality:–simplereflexagents–reflexagentswithstate–goal-basedagents–utility-basedagents

Allthesecanbeturnedintolearningagents

Chapter219

Page 20: chapter02thad/6601-gradAI-fall2015/chapter02.pdf · Title: chapter02.dvi

Simplereflexagents

AgentE

nvi

ron

men

tSensors

What the worldis like now

What action Ishould do now Condition−action rules

Actuators

Chapter220

Page 21: chapter02thad/6601-gradAI-fall2015/chapter02.pdf · Title: chapter02.dvi

Example

functionReflex-Vacuum-Agent([location,status])returnsanaction

ifstatus=DirtythenreturnSuck

elseiflocation=AthenreturnRight

elseiflocation=BthenreturnLeft

(setqjoe(make-agent:name’joe:body(make-agent-body)

:program(make-reflex-vacuum-agent-program)))

(defunmake-reflex-vacuum-agent-program()

#’(lambda(percept)

(let((location(firstpercept))(status(secondpercept)))

(cond((eqstatus’dirty)’Suck)

((eqlocation’A)’Right)

((eqlocation’B)’Left)))))

Chapter221

Page 22: chapter02thad/6601-gradAI-fall2015/chapter02.pdf · Title: chapter02.dvi

Reflexagentswithstate

Agent

En

viro

nm

ent

Sensors

What action Ishould do now

State

How the world evolves

What my actions do

Condition−action rules

Actuators

What the worldis like now

Chapter222

Page 23: chapter02thad/6601-gradAI-fall2015/chapter02.pdf · Title: chapter02.dvi

Example

functionReflex-Vacuum-Agent([location,status])returnsanaction

static:lastA,lastB,numbers,initially∞

ifstatus=Dirtythen...

(defunmake-reflex-vacuum-agent-with-state-program()

(let((last-Ainfinity)(last-Binfinity))

#’(lambda(percept)

(let((location(firstpercept))(status(secondpercept)))

(incflast-A)(incflast-B)

(cond

((eqstatus’dirty)

(if(eqlocation’A)(setqlast-A0)(setqlast-B0))

’Suck)

((eqlocation’A)(if(>last-B3)’Right’NoOp))

((eqlocation’B)(if(>last-A3)’Left’NoOp)))))))

Chapter223

Page 24: chapter02thad/6601-gradAI-fall2015/chapter02.pdf · Title: chapter02.dvi

Goal-basedagents

Agent

En

viro

nm

ent

Sensors

What it will be like if I do action A

What action Ishould do now

State

How the world evolves

What my actions do

Goals

Actuators

What the worldis like now

Chapter224

Page 25: chapter02thad/6601-gradAI-fall2015/chapter02.pdf · Title: chapter02.dvi

Utility-basedagents

Agent

En

viro

nm

ent

Sensors

What it will be like if I do action A

How happy I will be in such a state

What action Ishould do now

State

How the world evolves

What my actions do

Utility

Actuators

What the worldis like now

Chapter225

Page 26: chapter02thad/6601-gradAI-fall2015/chapter02.pdf · Title: chapter02.dvi

Learningagents

Performance standard

Agent

En

viro

nm

ent

Sensors

Performance element

changes

knowledgelearning goals

Problem generator

feedback

Learning element

Critic

Actuators

Chapter226

Page 27: chapter02thad/6601-gradAI-fall2015/chapter02.pdf · Title: chapter02.dvi

Summary

Agentsinteractwithenvironmentsthroughactuatorsandsensors

Theagentfunctiondescribeswhattheagentdoesinallcircumstances

Theperformancemeasureevaluatestheenvironmentsequence

Aperfectlyrationalagentmaximizesexpectedperformance

Agentprogramsimplement(some)agentfunctions

PEASdescriptionsdefinetaskenvironments

Environmentsarecategorizedalongseveraldimensions:observable?deterministic?episodic?static?discrete?single-agent?

Severalbasicagentarchitecturesexist:reflex,reflexwithstate,goal-based,utility-based

Chapter227