正在加载图片...
(setq joe (make-agent Agent location'A)'Right Condison-acsion rules Example Simple reflex agents 0 46 Agent types quewuoJAug percept))) ... Agent Agent Condtion-action iles What my actions do Goal-based agents Example Reflex agents with state quowuoJIAu3 quowuolaug Agent types Four basic types in order of increasing generality: – simple reflex agents – reflex agents with state – goal-based agents – utility-based agents All these can be turned into learning agents Chapter 2 19 Simple reflex agents Agent Environment Sensors should do now What action I is like now What the world Condition−action rules Actuators Chapter 2 20 Example function Reflex-Vacuum-Agent([location,status]) returns an action if status = Dirty then return Suck else if location = A then return Right else if location = B then return Left (setq joe (make-agent :name ’joe :body (make-agent-body) :program (make-reflex-vacuum-agent-program))) (defun make-reflex-vacuum-agent-program () #’(lambda (percept) (let ((location (first percept)) (status (second percept))) (cond ((eq status ’dirty) ’Suck) ((eq location ’A) ’Right) ((eq location ’B) ’Left))))) Chapter 2 21 Reflex agents with state Agent Environment Sensors should do now What action I State How the world evolves What my actions do Condition−action rules Actuators is like now What the world Chapter 2 22 Example function Reflex-Vacuum-Agent([location,status]) returns an action static: last A, last B, numbers, initially ∞ if status = Dirty then . . . (defun make-reflex-vacuum-agent-with-state-program () (let ((last-A infinity) (last-B infinity)) #’(lambda (percept) (let ((location (first percept)) (status (second percept))) (incf last-A) (incf last-B) (cond ((eq status ’dirty) (if (eq location ’A) (setq last-A 0) (setq last-B 0)) ’Suck) ((eq location ’A) (if (> last-B 3) ’Right ’NoOp)) ((eq location ’B) (if (> last-A 3) ’Left ’NoOp))))))) Chapter 2 23 Goal-based agents Agent Environment Sensors if I do action A What it will be like should do now What action I State How the world evolves What my actions do Goals Actuators is like now What the world Chapter 2 24
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有