Docsity

Agents in Artificial intelligence, Lecture notes of Artificial Intelligence

Partial preview of the text

Download Agents in Artificial intelligence and more Lecture notes Artificial Intelligence in PDF only on Docsity!

CS 401

Artificial Intelligence

Lecture # 02 1 February 2019 Spring 2019 FAST – NUCES, Faisalabad Campus

Zain Iqbal

[email protected]

Today’sTopics  Rational agent  Agents and environments  Nature of environments ◦ PEAS ◦ Properties

  • Agent Types

Agents and Environments  An agent is an entity that perceives its environment through sensors and acts upon it through actuators.

Agents and Environments Sou rc e: (^) S. (^) Ru ss ell (^) & (^) P. (^) No rvig

An agent together with its environment is called a world.

Few terminologies  Percept: agent’s perceptual input at any given stage  Percept sequence: complete history of everything the agent has ever perceived  Agent function: describes agent’s behavior

Agent Function & Agent Program  Abstractly, an agent is a function from percept histories to actions: f : P ***** → A

◦ Usually represented by tabulation

 Agent program is a concrete implementation of agent function

  • Agent = architecture + program

7

Rational agents

  • An agent should^ strive to^ "do the right thing", based^ on^ what^ it can perceive and the actions it can perform.
  • (^) The right action is the one that will cause the agent to be most successful
  • (^) Performance measure: An objective criterion for success of an agent's behavior
  • E.g., performance measure of a vacuum-cleaner agent could be amount of dirt cleaned up, amount of time taken, amount of electricity consumed, amount of noise generated, etc. As a general rule, it is better to design performance measures according to what one actually wants in the environment. Rather than according to how one thinks the agent should behave (amount of dirt cleaned vs a clean floor)
  • (^) A more suitable measure would reward the agent for having a clean floor

Rational Agent  An agent which does the right thing.  Performance measure evaluates the behavior of an agent in the environment.  Rational agent acts to maximize the expected value of performance measure.

Rational Agent  For each possible percept sequence, a rational agent should select an action that is expected to maximize its performance measure, given the evidence provided by the percept sequence and whatever built-in knowledge the agent has.

Vacuum cleaner agent

  • Let’s assume the following - - - - The performance measure awards one point for each clean square at each time step, over a lifetime of 1000 time steps The geography of the environment is known a "priori" but the dirt distribution and the initial location of the agent are not. Clean squares stay clean and the sucking cleans the current square. The Left and Right actions move the agent left and right except when this would take the agent outside the environment, in which case the agent remains where it is The only available actions are Left, Right, Suck and NoOp The agent correctly perceives its location and whether that location contains dirt

Under these circumstances the agent is rational:its

expected performance is at least as high as any

other agent’s

Vacuum cleaner agent

  • (^) Same agent would be irrational under different circumstances

once all dirt is cleaned up it will oscillate needlessly back and forth.
If the performance measure includes a penalty of one point for
each movement left or right, the agent will fare poorly.
A better agent for this case would do nothing once it is sure that all
the squares are clean.
If the clean squares can become dirty again, the agent should
occasionally check and clean them if needed.
If the geography of the environment is unknown the agent will
need to explore it rather than stick to squares A and B

Few terminologies  Information gathering/Exploration: doing actions in order to modify future percepts  Omniscience: knowing the actual outcome of action(s)  Learning: not restricting the agent for information gathering only but to make it learn as much as possible from what it perceives  Autonomy: ability to learn & adapt something (based on its own experience) other than prior knowledge

Task Environments  These are essentially the “problems” to which rational agents are the“solutions” In designing an agent, the first step must always be to specify the task environment (PEAS) as fully as possible

Task Environments PEAS  Performance  Environment  Actuators  Sensors