Title: Chapter 2 Stimulus-Response Agents
1Chapter 2 Stimulus-Response Agents
- Xiu-jun GONG (Ph. D)
- School of Computer Science and Technology,
Tianjin University - gongxj_at_tju.edu.cn
- http//cs.tju.edu.cn/faculties/gongxj/course/ai/
2Outline
- What is the S-R agent
- Perception and Action
- Perception
- Action
- Boolean Algebra
- Clauses and Forms of Boolean Functions
- How to design a S-R agent
- Production Systems
- Networks
- The Subsumption Architecture
3What is an agent
- End user perspective-An agent is a program that
- assists people and acts on their behalf.
- functions by allowing people to delegate work to
them - System perspective An agent is a software object
that - is situated within an execution environment
- possesses the following mandatory properties
- Reactive, Autonomous, Goal driven
- may possess any of the following orthogonal
properties - Communicative, Mobile, Learning ,Believable
4A Robot in a 2D Grid World
- Environment
- Enclosed by boundaries
- Contains unmovable objects
- No tight spaces
- Spaces between objects and boundaries that are
only one cell wide - Task
- Go to a cell adjacent to a boundary or object and
then follow that boundary along its perimeter
5The definition
- Stimulus-Response Agents (reactive agents)
- Machines that have no internal state and that
simply react to immediate stimuli in their
environments - Based on motor response to rather simple
functions of immediate sensory inputs - Hypothesis
- Most activity isnt planned out it is just
reaction - Complex behaviors are just combinations of simple
behaviors - Can get further with this bottom-up approach
than with the classical approach
6The robot example cont.
Action east/ south/ west/ north
Sensory Input
Action computation selects an action based on
feature vector
Perceptual processing produces feature
vector
7Perception processing
- For the robot task, there are four binary-valued
features of the sensory values that are useful
for computing an appropriate action - Perceptual processing might occasionally give
erroneous, ambiguous, or incomplete information
about the robots environment - Such errors might evoke inappropriate actions
- For robots with more complex sensors and tasks,
designing appropriate perceptual processing can
be challenging
Xi1lt-gtat lease one of its adjacent shadow
parts equals 1
8Action function (rule)
- Specifying a function that selects the
appropriate boundary-following action
None of the features has value 1, the robot can
move in any direction until it encounters a
boundary
9Boolean Algebra
- Boolean algebra is a convenient notation for
representing Boolean functions - Rules for Boolean algebra
- Commutative
- Associative
- DeMorgans law
- Distributive law
10Clauses and Forms of Boolean Func
- A conjunction of literals or a monomial
- The conjunction itself is called a term
- Bound of the number of monomials of size k or
less - A clause or a disjunction of literals
- Terms and clauses are duals of each other
- Disjunctive normal form (DNF) disjunction of
terms - K-term DNF disjunction of k terms
- Conjunctive normal form (CNF) conjunction of
clauses - K-clause CNF the size of its largest clause is k
11Perception and Action
S1 S2 S3
S8 S4
S7 S6 S5
Perception Processing
X1S2S3 X2S4S5 X3S6S7 X4S8S9
Action Rules
x1x2?east x2x3?south x3x4?west x4x1?north
if x11 and x20, move east if x21 and
x30, move south if x41 and x40, move
west if x41 and x10, move north
If none of the features has value 1, the robot
will move north until it encounters a boundary
12Implementation of S-R agent
- Production systems
- Networks
- The Subsumption Architecture
13Production system
- Production system comprises an ordered list of
rules called production rules or productions - ci ?ai, where ci is the condition part and ai is
the action part - Production system consists of a list of such
rules - Condition part
- Can be any binary-valued function of the features
- Often a monomial
- Action part
- Primitive action, a call to another productive
system, or a set of actions to be executed
simultaneously
14Production system cont. (1)
- Production system representation for the boundary
following routine (b-f) - An example of a durative systems (system that
never ends)
15Production Systems cont. (2)
- Corner Detector
- Teleo-reactive (T-R) programs
- Each properly executed action in the ordering
works toward achieving a condition higher in the
list - goal-achieving production system This kind of
task requires acting only until some specific
goal condition is achieved and then ceasing
activity. - Usually easy to write Quite robust Recursive
use
16Networks
- Threshold logic unit (TLU)
- Circuit consists of networks of threshold
elements or other elements that compute a
nonlinear function of a weighted sum of their
inputs
17Linearly separable function
- The boolean functions implementable by a TLU
- Exclusive-or function of two variables is an
example of not linearly separable
18An implementation of the BF rule
? east
19A network of TISA units
A simple network structure with repeated
combination of inverters and AND gates can be
used to implement any T-R program
SquelchTest Inhibit
20Characters of TISA unit
- The Test input 1 only if the condition
corresponding to this rule is satisfied - The Inhibit input 1 when any one of the rules
above has a true condition - The Squelch output1 when either the Test input
or the Inhibit input is 1 - The Act output 1 when the Test input 1 and the
Inhibit input0
21TISA units of boundary following function
x1x2 ?east x2x3?south x3x4?west x4x1?north 1 ?
north
west
north
east
1
22Subsumption architecture
- Proposed by Rodney Brooks
- The general idea An agents behavior is
controlled by a number of behavior modules
23Subsumption architecture cont.
- If the sensory inputs satisfy a precondition
specific to that module, then a certain behavior
program, also specific to that module, is
executed - One behavior module can subsume another
- Complex behaviors can emerge from the interaction
of a relatively simple reactive machine with
complex environment
24Behaviour-based AI
- We can distinguish two approaches to AI
- Classic AI
- Symbolic representations
- Good Old Fashioned AI (GOFAI)
- Behaviour-based AI
- Representation-free
- Nouvelle AI
25Classical AI
- Classical models are deliberative. They involve
what we recognize as thinking. - Sense-Plan-Act
- Sense the world and ?gure out where we are
- Generate a plan to get where we want to go
- Translate plan into actions
- Iterate until goals are achieved
- Need some kind of world model, notion of goal etc
26Nouvelle AI
When you think on the field, youve automatically
lost that down. The time you should be thinking
is during the course of the week in practice.
Thats when the light should go on. When you get
in the game, its all about reacting to what you
see.
--Albert Lewis
27Summary
- What is the S-R agent
- How to design a S-R agent
- Production system
- Network
- Subsume framework
- Suppl. Documents17 tips
- Behavior-based approach