人工智能基础——智能体(Agent)概述

人工智能基础——智能体(Agent)概述

在人工智能(AI)的学习过程中,智能体(Agent)是一个核心概念。本篇博客将基于Lecture 2的PPT内容,详细介绍智能体的定义、类型及其在人工智能中的作用。

什么是智能体(Agent)?

智能体是一种可以感知环境并对其做出反应的系统。它通过**传感器(Sensors)感知周围环境,并利用执行器(Actuators)**进行操作和决策。智能体的核心在于其具备一定的智能,能够基于输入做出合理的输出。

智能体的三大类别:

  1. 人类智能体(Human Agent)

    • 传感器:眼睛、耳朵、皮肤等感官器官
    • 执行器:手、腿、声带等
  2. 硬件智能体(Hardware Agent)

    • 传感器:摄像头、红外测距仪等
    • 执行器:马达、机械臂等
  3. 软件智能体(Software Agent)

    • 传感器:键盘输入、网络数据包、文件内容
    • 执行器:屏幕显示、写入文件、发送网络请求

智能体的工作原理

智能体的核心处理过程可以抽象为一个黑箱:

  • 输入(Percepts):从环境获取数据
  • 处理(Processing):根据智能算法进行计算
  • 输出(Actions):通过执行器影响环境

典型的智能体实例

  • 人类:用眼睛观察、用嘴巴说话、用手写字
  • 计算机程序:处理数据、输出计算结果
  • 机器人:接收传感器信息,控制机械动作

物联网中的智能体

物联网(Internet of Things, IoT)是智能体概念的重要应用之一。智能体可以在物联网环境中通过传感器收集数据,并通过执行器执行相应的操作。例如:

  • 智能家居:智能温控器、智能灯光等
  • 自动驾驶:汽车中的智能系统感知路况并自动驾驶
  • 工业自动化:工厂中的机器人自动检测生产情况并调整操作

如何设计智能体?

设计智能体需要明确其输入、处理过程和输出:

  1. 传感器(Sensors):用于感知环境,如摄像头、麦克风、温度传感器等。
  2. 智能体(Agent):核心计算部分,处理输入并做出决策。
  3. 执行器(Actuators):用于采取行动,如机械臂、扬声器、屏幕显示等。

真空吸尘器世界(Vacuum-Cleaner World)

一个典型的智能体模型是“真空吸尘器世界”,该模型包含:

  • 感知输入(Percepts):当前位置(A/B)和当前状态(干净/脏)。
  • 动作(Actions):左移、右移、吸尘、保持不动。

这种智能体可以通过查找表(Lookup Table)或更复杂的**智能体程序(Agent Program)**实现。

结论

智能体是人工智能系统的核心,它们可以是人类、硬件机器人,或是软件程序。理解智能体的基本概念,有助于更好地学习AI相关技术。


English Blog: Fundamentals of AI - Overview of Agents

In the study of Artificial Intelligence (AI), the concept of an agent is fundamental. This blog post, based on Lecture 2, explains the definition, types, and role of agents in AI.

What is an Agent?

An agent is a system that perceives its environment and takes actions accordingly. It interacts with the world through sensors (for perception) and actuators (for actions). The intelligence of an agent lies in its ability to process inputs and produce rational outputs.

Three Main Categories of Agents:

  1. Human Agents

    • Sensors: Eyes, ears, skin, etc.
    • Actuators: Hands, legs, vocal cords, etc.
  2. Hardware Agents

    • Sensors: Cameras, infrared range finders
    • Actuators: Motors, robotic arms
  3. Software Agents

    • Sensors: Keyboard inputs, network packets, file contents
    • Actuators: Displaying information, writing files, sending network packets

How Agents Work

The agent’s process can be abstracted into a black box model:

  • Input (Percepts): Data received from the environment
  • Processing: Intelligence-based computation
  • Output (Actions): Affecting the environment through actuators

Agents in the Internet of Things (IoT)

  • Smart Homes: Thermostats, smart lights, and security systems
  • Autonomous Vehicles: Self-driving cars using AI to perceive and navigate
  • Industrial Automation: Robots adjusting operations based on sensor data

How to Design an Intelligent Agent?

  • Sensors: Gather information (e.g., cameras, microphones)
  • Agent Processing: Computes actions based on percepts
  • Actuators: Take action (e.g., robotic arms, speakers, displays)

Vacuum-Cleaner World Example

  • Percepts: Current location (A/B), Clean/Dirty state
  • Actions: Move left, move right, suck, or do nothing

Instead of a lookup table, which is infeasible, an agent program is used to implement decision-making.

Conclusion

Agents form the foundation of AI systems. They can be humans, hardware robots, or software programs. Understanding agents is crucial for further AI studies.


英文考试笔记(Exam Notes)

Key Concepts:

  • Definition of an Agent: An entity that perceives the environment through sensors and acts using actuators.
  • Types of Agents:
    1. Human Agents: Use biological sensors (eyes, ears) and actuators (hands, legs).
    2. Hardware Agents: Use electronic sensors (cameras, infrared) and actuators (motors, arms).
    3. Software Agents: Process digital inputs (keystrokes, files) and generate outputs (display, network packets).
  • Agent Function: A mapping from percepts to actions (f: P→A).
  • IoT Applications: Smart homes, autonomous vehicles, industrial robots.
  • Vacuum-Cleaner World Example: A simplified model of agent-based decision-making.
  • Implementation: Instead of a lookup table, agents use agent programs for processing and decision-making.

Lecture 2: Intelligent Agents (智能体)


📌 中文博客:智能体(Intelligent Agents)概述

1. 什么是智能体 (Agent)?

智能体(Agent)是一个能够感知(perceive)环境并且对其作出行动(act)的实体。智能体可以是人类、机器人,或者软件程序

智能体的核心特性
  • 传感器(Sensors): 负责获取外界环境的信息,例如人类的眼睛、耳朵,机器人的摄像头、传感器等。
  • 执行器(Actuators): 负责与环境交互,例如人类的手脚,机器人的机械臂、马达等。
智能体的类型
  1. 人类智能体(Human Agents):

    • 传感器:眼睛、耳朵等感官器官
    • 执行器:手、腿、嘴等行动器官
  2. 硬件智能体(Hardware Agents):

    • 传感器:摄像头、红外测距仪等
    • 执行器:电机、机械臂等
  3. 软件智能体(Software Agents):

    • 传感器:键盘输入、网络数据
    • 执行器:屏幕显示、文件存储、网络传输

2. 智能体的环境 (Agent and Its Environment)

智能体通常在**环境(Environment)**中运行,环境可以是物理世界(如机器人)或虚拟环境(如计算机系统)。

智能体与环境的交互过程
  1. 智能体通过传感器感知环境 (Perception)
  2. 智能体进行处理 (Processing)
  3. 智能体通过执行器对环境做出反应 (Action)

示例:

  • 自动驾驶汽车:摄像头和传感器感知道路情况,计算机系统进行决策,然后通过电机控制汽车转向或刹车。
  • 扫地机器人:红外传感器检测障碍物,智能程序计算路径,然后控制轮子移动。

3. 智能体的实现 (Implementing an Agent)

智能体的决策过程由Agent Program(智能体程序)决定,它的核心是输入-处理-输出模式:

  1. 输入(Input):智能体感知到的环境信息
  2. 处理(Processing):智能体的计算和决策过程
  3. 输出(Output):智能体的行为
智能体的决策方式
  1. 查找表 (Lookup Table): 通过查找预先设定的规则来决定行为,但难以扩展。
  2. 基于规则的决策 (Rule-Based System): 通过一系列“如果-那么”(IF-THEN)规则来控制智能体。
  3. 机器学习 (Machine Learning): 通过数据训练,使智能体自主学习最佳策略。

4. 真空吸尘器世界 (Vacuum Cleaner World)

一个简单的智能体示例是真空吸尘器世界

  • 输入(Percepts):

    1. 当前位置(A 或 B)
    2. 当前位置是否干净
  • 可能的动作(Actions):

    1. 左移
    2. 右移
    3. 吸尘
    4. 不动

问题:

  • 如果使用查找表,会因为状态数太多而难以实现,因此更好的方法是使用**智能体程序(Agent Program)**来自动决策。

5. 设计智能体时需要考虑的因素

  1. 理性概念 (Rationality): 智能体应该如何做出最佳决策?
  2. 任务环境 (Task Environment): 智能体在哪种环境下运行?
  3. 性能衡量 (Performance Measure): 如何衡量智能体的表现?

📌 英文博客:Overview of Intelligent Agents

1. What is an Agent?

An agent is an entity that can perceive its environment through sensors and act upon it using actuators.

Key Characteristics of an Agent
  • Sensors: Devices used for perceiving the environment (e.g., human eyes, robot cameras).
  • Actuators: Mechanisms for interacting with the environment (e.g., human hands, robot motors).
Types of Agents
  1. Human Agents:

    • Sensors: Eyes, ears, etc.
    • Actuators: Hands, legs, etc.
  2. Hardware Agents:

    • Sensors: Cameras, infrared sensors.
    • Actuators: Motors, robotic arms.
  3. Software Agents:

    • Sensors: Keyboard inputs, network data.
    • Actuators: Display output, file operations.

2. Agents and Their Environments

An agent operates in an environment, which could be physical (like robots) or virtual (like software systems).

Agent-Environment Interaction
  1. Perception: The agent perceives the environment via sensors.
  2. Processing: The agent decides what action to take.
  3. Action: The agent interacts with the environment using actuators.

Examples:

  • Self-driving cars: Cameras detect roads, AI processes data, motors control movement.
  • Vacuum robots: Sensors detect dirt, AI decides movement, motors control wheels.

3. Implementing an Agent

The agent’s decision-making process follows an Input-Processing-Output model:

  1. Input: Perceptions from the environment.
  2. Processing: Decision-making process.
  3. Output: Actions performed by the agent.
Agent Decision-Making Methods
  1. Lookup Table: A predefined table for decision-making (not scalable).
  2. Rule-Based System: Uses IF-THEN rules to decide actions.
  3. Machine Learning: AI learns optimal actions from experience.

4. Vacuum Cleaner World

A simple example is the Vacuum Cleaner World:

  • Percepts:

    • Current location (A or B).
    • Clean or Dirty status.
  • Actions:

    • Move left
    • Move right
    • Suck dirt
    • Do nothing

Using a lookup table is impractical due to too many states, so an agent program is a better approach.


5. Key Considerations in Agent Design

  1. Rationality: How should an agent make optimal decisions?
  2. Task Environment: What environment does the agent operate in?
  3. Performance Measure: How do we evaluate the agent's success?

📌 英文考试笔记

Key Definitions

  • Agent: An entity that perceives the environment and takes actions.
  • Sensors: Devices used for perception.
  • Actuators: Mechanisms for interaction.

Types of Agents

  • Human Agents: Use eyes and ears as sensors, hands and legs as actuators.
  • Hardware Agents: Use cameras and sensors, act via motors.
  • Software Agents: Perceive keystrokes and files, act via display and networks.

Agent-Environment Interaction

  1. Sensors → Perception
  2. Agent Program → Processing
  3. Actuators → Action

Agent Implementation

  • Lookup Table: Simple but impractical.
  • Rule-Based System: Uses logical rules.
  • Machine Learning: Learns from data.

Vacuum Cleaner World

  • Percepts: Location (A/B), Clean/Dirty.
  • Actions: Move left/right, Suck, Do nothing.
  • Challenge: Lookup table is too large → Agent program is needed.

Key Design Factors

  1. Rationality: How to make optimal decisions?
  2. Task Environment: What conditions does the agent face?
  3. Performance Measure: How to evaluate success?

Lecture 2: Task Environment (任务环境)


📌 中文博客:任务环境(Task Environment)概述

1. 什么是任务环境?

任务环境指的是**智能体(Agent)**运行的环境,决定了智能体需要执行的任务和面对的挑战。一个理性的智能体(Rational Agent)被设计来适应不同的环境,因此理解和定义环境是关键。

为了描述任务环境,我们使用 P.E.A.S. 框架:

  • P(Performance Measure): 绩效度量,衡量智能体的成功标准。
  • E(Environment): 环境,即智能体所在的物理或虚拟世界。
  • A(Actuators): 执行器,使智能体能与环境交互。
  • S(Sensors): 传感器,使智能体能感知环境。

2. 以自动驾驶出租车为例

P.E.A.S. 描述
智能体类型P(绩效度量)E(环境)A(执行器)S(传感器)
自动驾驶出租车安全、快速、合法、舒适、最大化收益道路、交通、行人、乘客方向盘、油门、刹车、信号灯、喇叭、显示屏摄像头、声呐、速度计、GPS、里程表、加速度计、引擎传感器、键盘

3. 任务环境的关键因素

(1)绩效度量(Performance Measure)

评价自动驾驶汽车的标准包括:

  • 是否能正确到达目的地
  • 是否最小化燃油消耗
  • 是否最小化行程时间和成本
  • 是否遵守交通规则
  • 是否最大化安全性和舒适度
(2)环境(Environment)

自动驾驶出租车需要适应各种复杂的环境:

  • 不同的道路类型(高速公路、城市道路、乡村小路等)。
  • 复杂的交通状况(红绿灯、行人、其他车辆、流浪动物、道路施工、警车等)。
  • 多样化的乘客需求(不同语言、特殊需求等)。
(3)执行器(Actuators)

自动驾驶汽车的执行器负责控制其行动:

  • 控制 油门(加速)、方向盘(转向)、刹车(制动)。
  • 通过 显示屏 与乘客交流。
(4)传感器(Sensors)

传感器用于收集环境信息:

  • 检测 其他车辆和道路情况。
  • GPS 进行定位,确定车辆所在位置。
  • 与乘客互动 以理解需求。
  • 其他传感器,如加速度计、声呐、摄像头等。

4. 任务环境的其他示例

智能体类型P(绩效度量)E(环境)A(执行器)S(传感器)
医疗诊断系统病人健康、减少成本、避免医疗事故病人、医院显示问题、测试、诊断、治疗建议键盘输入病人信息
在线英语辅导提高学生测试成绩学生群体、考试机构显示练习题、提供反馈文字输入
卫星图像分析图像分类准确度轨道卫星显示分类结果颜色像素阵列
炼油厂控制系统最大化纯度、产量和安全炼油厂、操作员阀门、泵、加热器、显示器温度、压力、化学传感器

📌 英文博客:Overview of Task Environment

1. What is a Task Environment?

A task environment refers to the surroundings in which an intelligent agent operates. Since a rational agent is designed to work efficiently in different environments, it is crucial to understand and define them properly.

To describe task environments, we use the P.E.A.S. framework:

  • P (Performance Measure): How success is measured.
  • E (Environment): The world where the agent operates.
  • A (Actuators): Devices that allow the agent to act.
  • S (Sensors): Devices that help the agent perceive the environment.

2. Example: Automated Taxi Driver

P.E.A.S. Description
Agent TypeP (Performance Measure)E (Environment)A (Actuators)S (Sensors)
Automated TaxiSafe, fast, legal, comfortable, maximize profitsRoads, traffic, pedestrians, passengersSteering, accelerator, brake, signal, horn, displayCameras, sonar, speedometer, GPS, odometer, accelerometer, engine sensors, keyboard

3. Key Factors in Task Environment

(1) Performance Measure

How do we evaluate an automated driver?

  • Reaching the correct destination.
  • Minimizing fuel consumption.
  • Minimizing trip time and cost.
  • Following traffic laws.
  • Maximizing safety and comfort.
(2) Environment

An automated taxi must handle various real-world conditions:

  • Different road types (highways, urban streets, rural roads).
  • Complex traffic situations (traffic lights, pedestrians, road construction, police cars).
  • Diverse customer needs (language differences, special requests).
(3) Actuators

An automated taxi uses actuators to control its movements:

  • Steering, accelerator, and brakes to navigate roads.
  • Displays to communicate with passengers.
(4) Sensors

To perceive its surroundings, an automated taxi relies on:

  • Cameras and sonar to detect other vehicles and road conditions.
  • GPS to determine location.
  • Customer interaction systems to understand user needs.

4. Other Examples of Task Environments

Agent TypeP (Performance Measure)E (Environment)A (Actuators)S (Sensors)
Medical Diagnosis SystemHealthy patient, minimize costs, avoid lawsuitsPatients, hospitalsDisplay diagnoses, treatments, and referralsKeyboard inputs of symptoms
Interactive English TutorMaximize students' test scoresStudents, testing agenciesDisplay exercises, suggestions, and correctionsTyped word inputs
Satellite Image AnalysisCorrect categorizationDownlink from orbiting satellitesDisplay classified imagesColor pixel arrays
Refinery ControllerMaximize purity, yield, and safetyRefinery, operatorsValves, pumps, heaters, displaysTemperature, pressure, chemical sensors

Lecture 2: Properties of Environments(环境属性)


📌 中文博客:环境属性(Properties of Environments)概述

1. 环境的七对属性(14种类型)

环境的不同特性会影响智能体(Agent)的行为,我们可以用七对(14种)环境属性来分类:

  1. 完全可观察(Fully Observable) vs. 部分可观察(Partially Observable)
  2. 单智能体(Single Agent) vs. 多智能体(Multi-Agent)
  3. 确定性(Deterministic) vs. 随机性(Stochastic)
  4. 独立事件(Episodic) vs. 顺序决策(Sequential)
  5. 静态(Static) vs. 动态(Dynamic)
  6. 离散(Discrete) vs. 连续(Continuous)
  7. 已知(Known) vs. 未知(Unknown)

2. 详细解析七对环境属性

(1) 完全可观察 vs. 部分可观察
  • 完全可观察(Fully Observable)
    • 传感器可以获取环境的完整状态
    • 例如:棋类游戏(国际象棋),玩家可以看到所有棋子的位置。
  • 部分可观察(Partially Observable)
    • 传感器无法获取完整的信息。
    • 例如:扫地机器人只能检测当前位置的清洁度,但无法知道远处是否有灰尘。

(2) 单智能体 vs. 多智能体
  • 单智能体(Single Agent)

    • 仅有一个智能体在环境中执行任务,不需要考虑其他智能体的影响。
    • 例如:解填字游戏(Crossword Puzzle)
  • 多智能体(Multi-Agent)

    • 环境中有多个智能体,可能是竞争关系或合作关系。
    • 竞争环境(Competitive):国际象棋、围棋等对抗游戏。
    • 合作环境(Cooperative):自动驾驶汽车需要与其他车辆合作避免碰撞。

(3) 确定性 vs. 随机性
  • 确定性环境(Deterministic)

    • 下一个状态完全由当前状态和智能体的行为决定,没有随机性。
    • 例如:国际象棋,玩家的动作决定棋局的状态。
  • 随机性环境(Stochastic)

    • 由于环境的不可控因素,智能体无法完全预测下一步的状态。
    • 例如:自动驾驶,因为行人、天气等因素的影响,下一秒的环境可能会变化。

(4) 独立事件 vs. 顺序决策
  • 独立事件(Episodic)

    • 每个决策(Episode)相互独立,不会影响未来。
    • 例如:垃圾分类机器人,每次捡垃圾都不会影响下一次任务。
  • 顺序决策(Sequential)

    • 之前的决策会影响未来的决策。
    • 例如:国际象棋,每一步棋都会影响整个棋局的走向。

(5) 静态 vs. 动态
  • 静态环境(Static)

    • 在智能体决策过程中,环境不会改变。
    • 例如:解数独游戏,游戏状态不会随时间变化。
  • 动态环境(Dynamic)

    • 环境会随着时间推移而变化,智能体需要快速适应。
    • 例如:自动驾驶,行人、交通信号灯都会变化。

(6) 离散 vs. 连续
  • 离散环境(Discrete)

    • 任务的状态、动作、感知信息都是离散值。
    • 例如:国际象棋,棋盘上有限个位置和固定规则。
  • 连续环境(Continuous)

    • 任务的状态、动作是连续的,可以无限变化。
    • 例如:自动驾驶,车辆的方向盘角度、车速都是连续的。

(7) 已知 vs. 未知
  • 已知环境(Known)

    • 智能体知道环境的全部规则和模型,可以预先规划最佳策略。
    • 例如:国际象棋,游戏规则是固定的。
  • 未知环境(Unknown)

    • 智能体不了解环境的规则,需要探索学习
    • 例如:自动驾驶,需要不断学习新的驾驶场景和交通规则。

📌 英文博客:Overview of Environment Properties

1. 7 Pairs of Environment Properties

Environments for intelligent agents can be classified into 7 pairs (14 types) of properties:

  1. Fully observable vs. Partially observable
  2. Single agent vs. Multi-agent
  3. Deterministic vs. Stochastic
  4. Episodic vs. Sequential
  5. Static vs. Dynamic
  6. Discrete vs. Continuous
  7. Known vs. Unknown

2. Detailed Explanation

(1) Fully Observable vs. Partially Observable
  • Fully Observable:

    • Sensors provide complete state information.
    • Example: Chess, where all pieces are visible to both players.
  • Partially Observable:

    • Sensors cannot capture full information.
    • Example: Vacuum cleaner, which can only detect local dirt but not other areas.

(2) Single Agent vs. Multi-Agent
  • Single Agent:

    • The agent does not need to consider the presence of other agents.
    • Example: Crossword puzzle.
  • Multi-Agent:

    • Multiple agents exist in the environment, either competitive or cooperative.
    • Competitive: Chess.
    • Cooperative: Autonomous driving (avoiding collisions).

(3) Deterministic vs. Stochastic
  • Deterministic:

    • The next state is fully determined by the current state and the agent’s action.
    • Example: Chess, where moves are predictable.
  • Stochastic:

    • The environment has random elements.
    • Example: Autonomous driving, where pedestrians and traffic conditions introduce uncertainty.

(4) Episodic vs. Sequential
  • Episodic:

    • Every action is independent and does not affect future decisions.
    • Example: Garbage sorting robot.
  • Sequential:

    • Previous decisions influence future ones.
    • Example: Chess, where each move affects the entire game.

(5) Static vs. Dynamic
  • Static:

    • The environment does not change during decision-making.
    • Example: Sudoku.
  • Dynamic:

    • The environment changes over time.
    • Example: Autonomous driving, where traffic lights and pedestrians move.

(6) Discrete vs. Continuous
  • Discrete:

    • States and actions are countable.
    • Example: Chess, with a finite set of moves.
  • Continuous:

    • States and actions are infinite.
    • Example: Autonomous driving, where speed and angles change continuously.

(7) Known vs. Unknown
  • Known:

    • The agent has full knowledge of the environment’s rules.
    • Example: Chess, where rules are predefined.
  • Unknown:

    • The agent learns about the environment over time.
    • Example: Autonomous driving, which requires learning new driving conditions.

Lecture 2: Agent Programs(智能体程序)


📌 中文博客:智能体程序(Agent Programs)概述

1. 什么是智能体程序?

智能体程序(Agent Programs)是控制智能体(Agent)决策和行动的核心。不同类型的智能体程序决定了智能体如何感知环境、处理信息并采取行动。


2. 四种基本智能体程序

智能体程序可以分为四种基本类型:

  1. 简单反射型智能体(Simple Reflex Agents)
  2. 基于模型的反射智能体(Model-based Reflex Agents)
  3. 基于目标的智能体(Goal-based Agents)
  4. 基于效用的智能体(Utility-based Agents)

所有这些智能体都可以扩展为学习型智能体(Learning Agents),能够通过学习改进自身决策能力。


3. 详细解析四种智能体程序

(1) 简单反射型智能体(Simple Reflex Agents)
  • 采用 条件-动作(Condition-Action)规则
  • 规则格式:if(感知条件)→ then(执行某个动作)
  • 适用于完全可观察的环境,但难以应对复杂情况。
  • 示例
    • 青蛙的运动
      • 看到小物体移动 → SNAP(捕食)
      • 看到大物体移动 → AVOID(躲避)
    • 吸尘器智能体
      • 如果当前位置 ,则 吸尘
      • 如果当前位置 干净,则 向右移动

(2) 基于模型的反射智能体(Model-based Reflex Agents)
  • 适用于 部分可观察环境
  • 维护一个 内部状态(Internal State),记录过去的感知信息。
  • 依靠 世界模型(World Model) 预测环境状态变化。
  • 示例
    • 自动驾驶出租车
      • 记录过去的交通状况,选择最佳路线避免拥堵。

(3) 基于目标的智能体(Goal-based Agents)
  • 不仅关注当前状态,还考虑 目标(Goal)
  • 通过 搜索和规划(Search & Planning) 选择最佳动作。
  • 示例
    • 国际象棋智能体
      • 目标:将对手将死(Checkmate)。
      • 计算可能的未来走法,选择最优策略。

(4) 基于效用的智能体(Utility-based Agents)
  • 在多个可能的 目标 之间,选择最优解
  • 使用 效用函数(Utility Function) 评估不同选项的好坏
  • 示例
    • 自动驾驶
      • 目标1:尽快到达目的地。
      • 目标2:减少燃油消耗。
      • 目标3:最大化安全性和舒适度。

📌 英文博客:Overview of Agent Programs

1. What is an Agent Program?

An Agent Program is the core logic that controls an agent’s decision-making process. It determines how an agent perceives the environment, processes information, and takes action.


2. Four Basic Types of Agent Programs

There are four main types of agent programs:

  1. Simple Reflex Agents
  2. Model-based Reflex Agents
  3. Goal-based Agents
  4. Utility-based Agents

All these can be extended into Learning Agents, which can improve their performance over time.


3. Detailed Explanation of Agent Types

(1) Simple Reflex Agents
  • Based on Condition-Action Rules.
  • Rule format: if (percept) → then (action).
  • Only works in fully observable environments.
  • Examples:
    • Frog Motion:
      • If a small object moves, then SNAP (catch it).
      • If a large object moves, then AVOID (escape).
    • Vacuum Cleaner:
      • If location is dirty, then suck.
      • If location is clean, then move right.

(2) Model-based Reflex Agents
  • Used in partially observable environments.
  • Maintains an internal state that remembers past percepts.
  • Uses a World Model to predict environmental changes.
  • Example:
    • Automated Taxi Driver:
      • Stores traffic history to avoid traffic jams.

(3) Goal-based Agents
  • Uses goals to determine the best action.
  • Applies search and planning techniques.
  • Example:
    • Chess-playing AI:
      • Goal: Checkmate opponent.
      • Searches future moves and picks the best strategy.

(4) Utility-based Agents
  • Chooses the best among multiple possible goals.
  • Uses a utility function to evaluate options.
  • Example:
    • Autonomous Driving:
      • Goal 1: Minimize travel time.
      • Goal 2: Reduce fuel consumption.
      • Goal 3: Maximize safety & comfort.

📌 英文考试笔记(Exam Notes)

1. Agent Programs Overview

  • Agent Program: Controls an agent’s decisions.
  • Four Basic Agent Types:
    1. Simple Reflex Agents (Condition-Action Rules)
    2. Model-based Reflex Agents (Maintains an Internal State)
    3. Goal-based Agents (Uses Goals to Guide Actions)
    4. Utility-based Agents (Chooses the Best Option)

2. Agent Types & Examples

Agent TypeKey FeatureExample
Simple Reflex AgentUses if-then rules, only works in fully observable environments.Vacuum cleaner, Frog motion
Model-based Reflex AgentMaintains an internal state, useful for partially observable environments.Autonomous taxi
Goal-based AgentUses goals to guide decision-making.Chess AI
Utility-based AgentUses utility function to pick the best action.Self-driving cars

3. Key Concepts

  • Condition-Action Rules: If (percept) → then (action).
  • Internal State: Memory of past percepts.
  • Goal-based Planning: Searches for the best action.
  • Utility Function: Evaluates the best option.

这样,你可以快速理解智能体程序的概念并复习考试重点!📖✨ 有需要补充的内容吗? 😊

Lecture 2: Agent Programs – Detailed Notes


📌 英文考试笔记(Exam Notes)

1. Four Types of Agent Programs

Agent TypeKey FeatureExample
Simple Reflex AgentUses condition-action rules (IF-THEN rules), only works in fully observable environments.Vacuum cleaner, Frog motion
Model-based Reflex AgentMaintains an internal state, useful for partially observable environments.Autonomous taxi
Goal-based AgentUses goals to guide decision-making, involves search and planning.Chess AI
Utility-based AgentUses a utility function to pick the best action based on success probability.Self-driving cars

2. Model-based Reflex Agents

  • Suitable for partially observable environments.
  • Maintains an internal state that:
    • Stores past percepts.
    • Predicts future states using a world model.
  • Function:
    function MODEL-BASED-REFLEX-AGENT(percept):
        state ← UPDATE-STATE(state, action, percept, model)
        rule ← RULE-MATCH(state, rules)
        action ← rule.ACTION
        return action
    
  • Example: Autonomous Taxi
    • During rush hour, selects routes that avoid traffic.
    • Learns from past experiences.

3. Goal-based Agents

  • Uses goals to decide the best action.
  • Considers future consequences of actions.
  • Advantages:
    • More flexible (different goals → different behaviors).
  • Disadvantages:
    • Less efficient (many checks and calculations).
  • Example: Chess AI
    • Searches possible future moves and picks the best one.

4. Utility-based Agents

  • Uses utility function to determine the best action.
  • Utility function assigns numerical scores to possible states.
  • Why Utility?
    • Goals alone are not enough.
    • Example: Choosing a canteen meal
      • Goal: Eat food.
      • Utility: How good is the food?
  • Example: Autonomous Taxi
    • Goal: Reach destination.
    • Utility: Minimize time, maximize comfort & fuel efficiency.

5. Summary Table

Agent TypeKey ConceptExample
Simple ReflexUses IF-THEN rulesVacuum cleaner
Model-based ReflexMaintains internal stateAutonomous taxi
Goal-basedUses search & planningChess AI
Utility-basedUses utility functionAutonomous driving

Lecture 2: Learning Agents & Utility-based Agents – Detailed Notes


📌 英文考试笔记(Exam Notes)

1. Utility-based Agents

  • Key Idea: Utility function evaluates how successful an action is.
  • Advantages of Utility:
    • Handles conflicting goals (e.g., choosing between cheap/unpleasant food vs. expensive/delicious food).
    • Resolves uncertainty by selecting the action with the highest expected utility.
  • Key Concept: Utility is a real-number function mapping states to happiness or success level.

2. Learning Agents

  • Why Learning?
    • Pre-programmed agents may make mistakes.
    • Agents improve through feedback from the environment.
    • Machine Learning helps the agent adjust and perform better in the future.
  • Structure of a Learning Agent:
    • Performance Element – Selects actions.
    • Critic – Evaluates if the action was good or bad.
    • Learning Element – Makes improvements.
    • Problem Generator – Tries new approaches for optimization.

3. Types of Intelligent Agents

TypeKey FeatureExample
Simple Reflex AgentUses IF-THEN rules, reacts to current state.Vacuum cleaner
Model-based Reflex AgentMaintains internal state, remembers history.Self-driving car
Goal-based AgentUses search & planning to reach goals.Chess AI
Utility-based AgentUses utility function to make decisions.Autonomous taxi
Learning AgentAdapts from experience using feedback.AI assistants (e.g., Siri, Alexa)

4. Key Takeaways

  • Utility function helps with complex decision-making.
  • Learning agents improve over time via feedback.
  • Different intelligent agents have different decision-making approaches.

Lecture 2 Summary – Review Notes


📌 英文考试笔记(Exam Notes)

1. What is an Agent?

  • An agent is anything that perceives its environment through sensors and acts upon it using actuators.
  • Examples: Humans, robots, software agents.

2. What is a Rational Agent?

  • A rational agent always chooses the best possible action based on:
    • Perceived environment
    • Available knowledge
    • Expected outcomes

3. Four Elements of a Rational Agent

P.E.A.S. Framework:

  • P: Performance Measure (Objective)
  • E: Environment (Domain knowledge)
  • A: Actuators (Actions taken)
  • S: Sensors (Input/Perception)

Example: Self-driving Car

  • P: Safe driving, fuel efficiency.
  • E: Roads, pedestrians, traffic lights.
  • A: Steering, brakes, acceleration.
  • S: Cameras, GPS, speedometer.

4. Examples of Rational Agents & Their Elements

Agent TypePerformance MeasureEnvironmentActuatorsSensors
Taxi Driver AISafe, fast drivingRoads, trafficSteering, brakeGPS, camera
Medical AIDiagnose accuratelyPatients, hospitalDisplay diagnosisPatient records
Chess AIWin the gameChessboardMove piecesBoard state

5. Agent Structure

  • Simple Reflex Agents – Condition-action rules (IF-THEN logic).
  • Model-Based Reflex Agents – Maintain an internal state.
  • Goal-Based Agents – Choose actions to achieve goals.
  • Utility-Based Agents – Optimize for best decision.
  • Learning Agents – Improve via feedback.

6. Basic Types of Agents & Features

TypeKey FeatureExample
Simple ReflexRule-based, no memoryVacuum cleaner
Model-Based ReflexStores history, reacts accordinglyAutonomous car
Goal-BasedPlans for future goalsChess AI
Utility-BasedOptimizes success levelStock trading AI
Learning AgentAdapts & learnsAI assistants

🎯 Key Takeaways

  • P.E.A.S. framework helps define task environments.
  • Rational agents always choose the best action.
  • Different agent types solve different problems.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值