MODULE 1 chapter02
MODULE 1 chapter02
Environment
perceiving its
environment ?
through sensors
and acting upon
that environment Actuators Actions
through actuators
Environment
that the agent
interacts with. ?
• It includes all the
conditions, objects,
and information Actuators Actions
Percept
Agent’s perceptual inputs at any given
instant
Percept sequence
Complete history of everything that the
agent has ever perceived.
Agent function & program
Agent’s behavior is mathematically
described by
Agent function
A function mapping any given percept
sequence to an action
– f : P* -> A
Practically it is described by
An agent program
The real implementation
Agents and Environments
• Example: Vacuum
Cleaner World
– Two locations: squares A
and B A B
– Perceives what square it is
in
– Perceives if there is dirt in
the current square
– Actions
• move left
• move right
• suck up the dirt
• do nothing
AI: Chapter 2: Intelligent 7
Agents
Agents and Environments
• Agent Function: Percept Sequence Action
success.
Performance measure
Performance measure
An objective function that determines
How the agent does successfully
E.g., 90% or 30% ?
behave
E.g., in vacuum-cleaner world
We want the floor clean, no matter how
the agent behave
We don’t restrict how the agent behaves
Rationality
(environment)
The actions that the agent can perform
(accurators)
The agents’s percept sequence (sensor)
Rational agent
For each possible percept sequence,
an rational agent should select
anaction expected to maximize its
performance measure, given the evidence
provided by the percept sequence and
whatever built-in knowledge the agent has
E.g., an exam
Maximize marks, based on
the questions on the paper & your
knowledge
Example of a rational
agent
Performance measure
Awards one point for each clean square
at each time step
Percept sequences
Where is the agent?
Whether the location contains dirt?
An omniscient agent
Knows the actual outcome of its
actions in advance
No other possible outcomes
An example
crossing
a street but died of the fallen
cargo door from 33,000ft irrational?
Learning
Does a rational agent depend on
only current percept?
No, the past percept sequence should
also be used
This is called learning
agent
should adjust its behaviors to perform
better for the same job next time.
Autonomy
environments
Those agents working in these
(environment)
The actions that the agent can perform
(accurators)
The agents’s percept sequence (sensor)
Task environments
Task environments are the problems
While the rational agents are the solutions
Actuators
Sensors
Traffic
lights, other vehicles,
pedestrians, stray animals, road works,
police cars, etc.
Stochastic Environment
In a stochastic environment, there is uncertainty in the outcome of
actions. Even if the agent performs the same action in the same
state multiple times, the results may differ due to random factors.
Sequential Environment:
In a sequential environment, each action taken by the agent affects
future actions. The outcome of one action influences the next state or
scenario the agent faces.
Dynamic Environment:
A dynamic environment is constantly changing, even if the
agent is not actively doing anything. The environment evolves
independently of the agent's actions.
Example:
Self-Driving Cars: The environment (roads, traffic,
pedestrians) changes continuously even when the car is not
moving.
Properties of task
environments
Discrete Environment:
In a discrete environment, there are a finite number of distinct,
clearly defined states. The actions and changes between states
happen in specific, quantifiable steps.
Examples:
Chess or Board Games: The pieces have a set number of
positions, and each move occurs in a defined step-by-step manner.
Continuous Environment:
In a continuous environment, the state space is infinite, and actions
and changes happen smoothly over a continuous range. The
transitions are not step-based but gradual.
Examples:
Self-Driving Cars: The car's position on the road, speed, and
distance to objects can vary continuously.
Properties of task
environments
Single-Agent Environment:
In a single-agent environment, there is only one agent interacting
with the environment. The agent is responsible for making decisions
and taking actions without competition or cooperation from other
agents.
Examples:
Chess against a computer: The AI operates alone, solving the
problem based on input from the human player.
Multi-Agent Environment:
In a multi-agent environment, multiple agents interact with each
other within the same environment. These interactions can be
competitive, cooperative, or neutral depending on the situation.
Examples:
Self-driving cars on a road: Multiple autonomous cars interacting
with each other.
Properties of task
environments
• Known Environment:
• In a known environment, the agent has complete information about
the environment's structure, rules, and the consequences of its
actions. It knows the model of the environment and can plan its
actions accordingly.
• Examples:
– Chess: The agent knows all the rules, moves, and states of the board.
• Unknown Environment:
• In an unknown environment, the agent does not have prior
knowledge about how the environment works. It needs to explore,
learn from feedback, and adapt to make decisions.
• Examples:
– Robotics in an unfamiliar environment: The robot might not know
the layout of a room and must navigate by trial and error.
Examples of task
environments
Structure of agents
Structure of agents
Agent = architecture +
program
Architecture= some sort of
computing device (sensors +
actuators)
(Agent) Program = some function that
entries
Agent programs
Despite of huge size, look up table
does what we want.
The key challenge of AI
Findout how to write programs that, to
the extent possible, produce rational
behavior
From a small amount of code
Rather than a large amount of table entries
Types of agent programs
Four types
Simple reflex agents
Model-based reflex agents
Goal-based agents
Utility-based agents
Simple reflex agents
They choose action only based on current situation
ignoring history of perception
Perform action only based on simple situation
They work only if environment is fully observable.
The agent is based on condition action rule. ie “if
condition then action”
This can be done using predetermined rules that are
there in knowledge base
Eg. Chess is fully observable because the agent can
see the entire chessboard and know all the positions
of the pieces.
The Structure of Agents
Simple Reflex Agent
Environment
Condition-Action What action I
Rules should do now Actuators Actions
Environment
How the world evolves
What my actions do
Environment
How the world evolves
What my actions do
What it will be like
if I do action A
What action I
Goals Actuators
should do now Actions
Environment
How the world evolves
What it will be like
What my actions do if I do action A
What action I
should do now Actuators Actions