INTRODUCTION12INTELLIGENT AGENTSfunction Table-Driven-AGENTt percept) returns ar. actionpersistent: percepts. a sequence, initially empty'table, a tab Thuật toán algorithmsble of actions, indexed by percept sequences, initially fully specifiedappend percept to the end of perceptsaction 4- LOOKVP(PrT7'y7,,-';> table)return actionFigure 2.3The Table-Driven-AGENT program is invoked for each new percept and returns anaction each time. It retains the complete percept seque Thuật toán algorithmsnce in memory.function REFLEX-VACUVM-AGENTt[/oi:i
Thuật toán algorithms
ghtelse if location = R then return heftFigure 2.4 Tine agent program fur a simple reflex agent tn the two-state vacuum environment. This program implINTRODUCTION12INTELLIGENT AGENTSfunction Table-Driven-AGENTt percept) returns ar. actionpersistent: percepts. a sequence, initially empty'table, a tab Thuật toán algorithmsion rules-.late. < IN THRPKkT-lNPl.percept) rule. ■ R1.1. K- M A T<: n(s/ute. rules) action — rule. Ac TiON return actionFigure 2.6 A simple reflex agent. It acts accordmg to a rale whose condition matches the current state, as defined by the percept.■>function Model-Based-Reflex-AGEN’X percept) ret Thuật toán algorithmsurns an actionpersistent state. die agent's current conception of the world statemodel, a description of how the next state depends on current state a
Thuật toán algorithms
nd action ntZrs. a set of condition-action rulesaction, the most recent action, initially nonestate — UPDATE-STATEt's/afr, action, percept, model)ruleINTRODUCTION12INTELLIGENT AGENTSfunction Table-Driven-AGENTt percept) returns ar. actionpersistent: percepts. a sequence, initially empty'table, a tab Thuật toán algorithms using an internal model. It then chooses an action in the same way as the reflex agent.3SOLVING PROBLEMS BY SEARCHINGfunction SlMPLE-PROBLEM-SOLVrNG-AGENĩtpenapO returns an action persistent: teg, an action sequence, initially emptystate. some description of the cunent world stategoal, a goal, init Thuật toán algorithmsially nullINTRODUCTION12INTELLIGENT AGENTSfunction Table-Driven-AGENTt percept) returns ar. actionpersistent: percepts. a sequence, initially empty'table, a tabINTRODUCTION12INTELLIGENT AGENTSfunction Table-Driven-AGENTt percept) returns ar. actionpersistent: percepts. a sequence, initially empty'table, a tab