AI-Intelligent Agents: Dr. Azhar Mahmood
AI-Intelligent Agents: Dr. Azhar Mahmood
Sensors
Percept (Observations)
Agent Function
Agent
Actuator
Action
Environment Environment
E.g., vacuum-cleaner world
Agent / Robot
iRobot Corporation
•
Characterizing a Task Environment
–
•
Agent Types and their PEAS
Tic-Tac-Toe Game ??
Poker game ??
Types- Task Environments
2) Deterministic vs Stochastic
– An environment is deterministic if the next state of the
environment is completely determined by the current state of
the environment and the action of the agent;
– In a stochastic environment, there are multiple, unpredictable
outcomes. (If the environment is deterministic except for the
actions of other agents, then the environment is strategic).
In a fully observable, deterministic environment, the agent need
not to deal with uncertainty.
3) Episodic vs Sequential
– In an episodic environment, the agent’s experience is divided into
atomic
episodes. Each episode consists of the agent perceiving and then
performing a single action.
– Subsequent episodes do not depend on what actions occurred in
previous
episodes. Choice of action in each episode depends only on the
episode itself.
For example, an agent that has to spot defective parts on an assembly
line bases each decision on the current part, regardless of previous
decisions;
(classifying images)
– In a sequential environment, the agent engages in a series of connected
episodes. Current decision can affect future decisions. (E.g., chess and driving)
Types- Task Environments
4) Static vs Dynamic (Time Based)
–A static environment does not change while the agent is
thinking. The passage of time as an agent deliberates is irrelevant.
Taxi driving is clearly dynamic: the other cars and the taxi itself
keep moving while the driving algorithm think about what to do next.
Chess, when played with a clock, is semi-dynamic. Crossword
puzzles are static.
Types- Task Environments
5) Discrete / Continuous
– If the number of distinct percepts and actions is limited, the
environment is discrete, otherwise it is continuous.
Job of AI is to Design an agent program assuming an architecture that will make the percepts from
the sensors available to the program.
Other Agents types
• Table-lookup driven Agents
• Learning Agents
Types of Agent
Drawbacks:
– Huge table (often simply too large)
– Takes a long time to build/learn the table
Toy example: Vacuum world.
Percepts: robot senses it’s location and “cleanliness.”
So, location and contents, e.g., [A, Dirty], [B, Clean].
With 2 locations, we get 4 different possible sensor inputs.
Actions: Left, Right, Suck, NoOp
Table lookup
• Action sequence of length K, gives 4^K different possible sequences.
• At least many entries are needed in the table.
• So, even in this very toy world, with K = 20, you need a table with over 4^20
> 10^12 entries.
• In more real-world scenarios, one would have many more different percepts
(eg many more locations), e.g., >=100.
• There will therefore be 100^K different possible sequences of length K. For
K = 20, this would require a table with over 100^20 = 10^40 entries.
Infeasible to even store.
RULES:
(1) If small moving object,
then activate SNAP
(2) If large moving object,
then activate AVOID and inhibit SNAP
ELSE (not moving) then NOOP
needed for
completeness Action: SNAP or AVOID or NOOP
III) --- Model-based Reflex Agents
• Key difference (wrt simple reflex agents):
– Agents have internal state, which is used to keep
track of past states of the world.
• That depends on the percept history
• Reflecting some of the unobserved aspects
• E.g., driving a car and changing lane
– Agents have the ability to represent change in the
World.
• How the world evolves independently of the agent
• How the agent’s actions affect the world
Model-based Reflex Agents
Logical Agents
Knowledge Representation and Reasoning:
later in the course
“Infers potentially
dangerous driver
in front.”
start
Actions: left, right, straight, open-door
Rules:
1. If open(left) & open(right) and open(straight) then
choose randomly between right and left
2. If wall(left) and open(right) and open(straight) then straight
3. If wall(right) and open(left) and open(straight) then straight
4. If wall(right) and open(left) and wall(straight) then left
5. If wall(left) and open(right) and wall(straight) then right
6. If wall(left) and door(right) and wall(straight) then open-door
7. If wall(right) and wall(left) and open(straight) then straight.
8. (Default) Move randomly
IV) --- Goal-based agents
• Key difference wrt Model-Based Agents:
– In addition to state information, have goal information that
– describes desirable situations to be achieved.
Considers
“Clean “future”
kitchen”
Agent keeps track of the world state as well as set of goals it’s trying to achieve: chooses
actions that will (eventually) lead to the goal(s).
More flexible than reflex agents may involve search and planning
V) --- Utility-based agents
• When there are multiple possible alternatives, how to decide which one is
best?
• Goals are qualitative: A goal specifies a crude distinction between a happy and
unhappy state, but often need a more general performance measure that describes “degree
of happiness.”
• In AI,
⁻ Once an agent is done
⁻ We teach it by giving it a set of examples
⁻ Test it by using another set of examples
• We then say the agent learns
⁻ A learning agent
Learning Agents
• Four conceptual components
⁻ Learning element
• Making improvement
⁻ Performance element
• Selecting external actions
⁻ Critic
• Tells the Learning element how well the agent is doing
with respect to fixed performance standard.
• (Feedback from user or examples, good or not?)
⁻ Problem generator
• Suggest actions that will lead to new and informative
experiences.
Learning Agents
More complicated when agent needs to learn utility
information: Reinforcement learning (based on action
payoff)