Artificial Intelligence 简明教程
AI - Agents & Environments
人工智能系统由一个代理及其环境组成。代理在自身环境中行为。该环境中可能包含其他代理。
An AI system is composed of an agent and its environment. The agents act in their environment. The environment may contain other agents.
What are Agent and Environment?
agent 是能够通过 sensors 感知自身环境并通过 effectors. 对自身环境执行操作的任何事物。
An agent is anything that can perceive its environment through sensors and acts upon that environment through effectors.
-
A human agent has sensory organs such as eyes, ears, nose, tongue and skin parallel to the sensors, and other organs such as hands, legs, mouth, for effectors.
-
A robotic agent replaces cameras and infrared range finders for the sensors, and various motors and actuators for effectors.
-
A software agent has encoded bit strings as its programs and actions.

Agent Terminology
-
Performance Measure of Agent − It is the criteria, which determines how successful an agent is.
-
Behavior of Agent − It is the action that agent performs after any given sequence of percepts.
-
Percept − It is agent’s perceptual inputs at a given instance.
-
Percept Sequence − It is the history of all that an agent has perceived till date.
-
Agent Function − It is a map from the precept sequence to an action.
Rationality
理性的状态便是合理的、明智的,并且具有良好的判断力。
Rationality is nothing but status of being reasonable, sensible, and having good sense of judgment.
理性涉及预期行为和结果,具体取决于代理感知的内容。执行操作以获取有用信息是理性行为的重要组成部分。
Rationality is concerned with expected actions and results depending upon what the agent has perceived. Performing actions with the aim of obtaining useful information is an important part of rationality.
What is Ideal Rational Agent?
理想理性代理能够执行预期行为以根据以下内容最大程度地提升其绩效衡量:
An ideal rational agent is the one, which is capable of doing expected actions to maximize its performance measure, on the basis of −
-
Its percept sequence
-
Its built-in knowledge base
代理的理性性取决于以下因素:
Rationality of an agent depends on the following −
-
The performance measures, which determine the degree of success.
-
Agent’s Percept Sequence till now.
-
The agent’s prior knowledge about the environment.
-
The actions that the agent can carry out.
理性代理始终执行正确操作,其中正确操作意味着代理在给定的感知序列中取得最大成功率的操作。代理解决的问题以绩效衡量、环境、执行器和传感器 (PEAS) 为特征。
A rational agent always performs right action, where the right action means the action that causes the agent to be most successful in the given percept sequence. The problem the agent solves is characterized by Performance Measure, Environment, Actuators, and Sensors (PEAS).
The Structure of Intelligent Agents
代理的结构可视为:
Agent’s structure can be viewed as −
-
Agent = Architecture + Agent Program
-
Architecture = the machinery that an agent executes on.
-
Agent Program = an implementation of an agent function.
Simple Reflex Agents
-
They choose actions only based on the current percept.
-
They are rational only if a correct decision is made only on the basis of current precept.
-
Their environment is completely observable.
Condition-Action Rule - 这是将状态(条件)映射到操作的规则。
Condition-Action Rule − It is a rule that maps a state (condition) to an action.

Model Based Reflex Agents
他们运用世界模型来选择自己的行为。他们维持一个内部状态。
They use a model of the world to choose their actions. They maintain an internal state.
Model −关于“世界上事情发生方式”的知识。
Model − knowledge about “how the things happen in the world”.
Internal State −它是当前状态中不可观察方面的表示形式,取决于概念历史。
Internal State − It is a representation of unobserved aspects of current state depending on percept history.
Updating the state requires the information about −
Updating the state requires the information about −
-
How the world evolves.
-
How the agent’s actions affect the world.

Goal Based Agents
他们选择行为以便实现目标。基于目标的方法比反射代理更灵活,因为支持决策的知识建模明确,因此允许修改。
They choose their actions in order to achieve goals. Goal-based approach is more flexible than reflex agent since the knowledge supporting a decision is explicitly modeled, thereby allowing for modifications.
Goal −它是预期情况的描述。
Goal − It is the description of desirable situations.

Utility Based Agents
他们基于每个状态的偏好(效用)选择行为。
They choose actions based on a preference (utility) for each state.
目标不充分,何时 −
Goals are inadequate when −
-
There are conflicting goals, out of which only few can be achieved.
-
Goals have some uncertainty of being achieved and you need to weigh likelihood of success against the importance of a goal.

The Nature of Environments
一些程序完全在 artificial environment 运行,限于键盘输入、数据库、计算机文件系统和屏幕上的字符输出。
Some programs operate in the entirely artificial environment confined to keyboard input, database, computer file systems and character output on a screen.
相反,一些软件代理(软件机器人或软机器人)存在于丰富、无限的软机器人域中。模拟器具有 very detailed, complex environment 。软件代理需要实时从一系列长动作中进行选择。一个软机器人设计用于扫描客户的在线偏好,向客户展示有趣物品,它在 real 和 artificial 环境中工作。
In contrast, some software agents (software robots or softbots) exist in rich, unlimited softbots domains. The simulator has a very detailed, complex environment. The software agent needs to choose from a long array of actions in real time. A softbot designed to scan the online preferences of the customer and show interesting items to the customer works in the real as well as an artificial environment.
最著名的 artificial environment 是 Turing Test environment ,其中一个真实代理和一个人工智能代理在平等的条件下被测试。这是一个非常具有挑战性的环境,因为软件代理很难像人类一样表现出色。
The most famous artificial environment is the Turing Test environment, in which one real and other artificial agents are tested on equal ground. This is a very challenging environment as it is highly difficult for a software agent to perform as well as a human.
Turing Test
系统智能行为的成功可以用图灵测试来衡量。
The success of an intelligent behavior of a system can be measured with Turing Test.
两名人员和一台待评估的机器参加测试。在这两个人中,一个人扮演测试者。他们每个人都坐在不同的房间里。测试人员不知道谁是机器,谁是人类。他通过输入问题并将其发送给这两个智能体来进行询问,然后他接收输入的响应。
Two persons and a machine to be evaluated participate in the test. Out of the two persons, one plays the role of the tester. Each of them sits in different rooms. The tester is unaware of who is machine and who is a human. He interrogates the questions by typing and sending them to both intelligences, to which he receives typed responses.
此测试旨在愚弄测试人员。如果测试人员无法根据人类响应来确定机器的响应,则认为该机器是智能的。
This test aims at fooling the tester. If the tester fails to determine machine’s response from the human response, then the machine is said to be intelligent.
Properties of Environment
环境具有多重属性−
The environment has multifold properties −
-
Discrete / Continuous − If there are a limited number of distinct, clearly defined, states of the environment, the environment is discrete (For example, chess); otherwise it is continuous (For example, driving).
-
Observable / Partially Observable − If it is possible to determine the complete state of the environment at each time point from the percepts it is observable; otherwise it is only partially observable.
-
Static / Dynamic − If the environment does not change while an agent is acting, then it is static; otherwise it is dynamic.
-
Single agent / Multiple agents − The environment may contain other agents which may be of the same or different kind as that of the agent.
-
Accessible / Inaccessible − If the agent’s sensory apparatus can have access to the complete state of the environment, then the environment is accessible to that agent.
-
Deterministic / Non-deterministic − If the next state of the environment is completely determined by the current state and the actions of the agent, then the environment is deterministic; otherwise it is non-deterministic.
-
Episodic / Non-episodic − In an episodic environment, each episode consists of the agent perceiving and then acting. The quality of its action depends just on the episode itself. Subsequent episodes do not depend on the actions in the previous episodes. Episodic environments are much simpler because the agent does not need to think ahead.