Professional Documents
Culture Documents
Nature of Environments
Structure of Agents
Agents
An agent is anything that can be viewed as
perceiving its environment through sensors
and acting upon that environment through
actuators
Human agent:
sensors- eyes, ears, and other organs
actuators- hands, legs, mouth, and
other body parts
Robotic agent:
Sensors - cameras and infrared range
finders
Actuators - motors
an agent perceives its environment through
sensors
⚫ the complete set of inputs at a given time is
called a percept
⚫ the current percept, or a sequence of
percepts may influence the actions of an
agent –percept sequence
The agent function maps from percept histories to
actions:[f: P* → A].The agent function is an
abstract mathematical description.
The agent function will be implemented by an agent
program.The agent program is a concrete
implementation running on the agent
architecture .
Vacuum-cleaner world
Percepts:
Location and status,
e.g., [A,Dirty]
Actions:
Left, Right, Suck, NoOp
Function Table-Driven-Agent(percept)
Static: percepts, a sequence, initially empty
table, a table of actions, indexed by percept
sequences, initially fully specified
The table agent program is invoked for each new percept and returns an action
each time. It keeps track of percept sequences using its own private data structure.
Table-lookup agent
Drawbacks:
⚫ Huge table
⚫ Take a long time to build the table
⚫ No autonomy
⚫ Even with learning, need a long time to learn
the table entries.
Example : let P be the set of possible percepts and T be the
lifetime of the agent (the total number of percepts it will receive)
then the lookup table will contain PT entries.
The table of the vacuum agent (VA) will contain more than 4T
entries (VA has 4 possible percepts).
Four basic kinds of agent program are
⚫ Simple reflex agents
⚫ Model-based reflex agents
⚫ Goal-based agents
⚫ Utility-based agents
return action
A simple reflex agent. It acts according to rule whose condition matches the
current state, as defined by the percept.
Schematic diagram of a Simple
reflex agentcurrent state of decision process
Limited Intelligence
Fails if environment
is partially observable
State<-Update-State(oldInternalState,LastAction,percept)
rule<- Rule-Match(State, rules)
action <- Rule-Action[rule]
return action
A model-based reflex agent. It keep track of the current state of the world using
an internal model. It then chooses an action in the same way as the reflect agent.
Goal-based agents
• knowing state and environment? Enough?
– Taxi can go left, right, straight
• Have a goal
⚫ A destination to get to
Uses knowledge about a goal to guide its
actions
⚫ E.g., Search, planning
Goal-based Agents are much more flexible in
responding to a changing environment;
accepting different goals.
45 Artificial Intelligence a modern approach
Goal-based agents
Goals provide reason to prefer one action over the other.
We need to predict the future: we need to plan & search
• Reflex agent breaks when it sees brake lights. Goal based agent
reasons
– Brake light -> car in front is stopping -> I should stop -> I should use brake
Evaluates
current
world
state
changes
action
rules
“old agent”
model world
and
suggests decide on
explorations actions to be
taken
Learning Agents can be divided into 4 conceptual
components:
1. Learning elements are responsible for
improvements
2. Performance elements are responsible for
selecting external actions (previous knowledge)
3. Critic tells the learning elements how well the
agent is doing with respect to a fixed performance
standard.
4. Problem generator is responsible for suggesting
actions that will lead to new and informative
experience.
Example :Automated Taxi driving
•The performance element consists of whatever collection of knowledge and
procedures the TA has for selecting its driving actions.
•The critic observes the world and passes information along to the learning
element. For example after the taxi makes a quick left turn across three lanes
the critic observes the shocking language used by other drivers. From this
experience the learning element is able to formulate a rule saying this was a
bad action, and the performance element is modified by installing this new rule.
•The learning element can make change in any Knowledge of previous agent
types : observation between two states (how the world evolves), observation of
results of actions (what my action do). (learn from what happens when
52
strong brake is applied on a wet road …)
Problem Formulation
Problem Solving agents
Example problems
Searching for solutions
53
Problem Solving agents:
Initial
State
Formulate goal:
⚫ be in Bucharest
(Romania)
Formulate problem: Goal
⚫ action: drive between State
pair of connected
cities (direct road)
⚫ state: be in a city
(20 world states)
57
Toy problems:
Simple Vacuum World
states
⚫ two locations
⚫ dirty, clean
initial state
⚫ any legitimate state
successor function (operators)
⚫ left, right, suck
goal test
⚫ all squares clean
path cost
⚫ one unit per action
Added to tree.
69
states vs. nodes
A state is a (representation of) a physical configuration
A node is a data structure with 5 components state, parent node, action,
path cost,depth
70
General Tree Search Algorithm
function TREE-SEARCH(problem, fringe) returns solution
fringe := INSERT(MAKE-NODE(INITIAL-STATE[problem]), fringe)
loop do
if EMPTY?(fringe) then return failure
node := REMOVE-FIRST(fringe)
if GOAL-TEST[problem] applied to STATE[node] succeeds
then return SOLUTION(node)
fringe := INSERT-ALL(EXPAND(node, problem), fringe)