CS5940 Model Map ⌂ Modules
Deliberative agentWeek 35 techniques

The BDI control loop

BDI turned into an algorithm: perceive, update beliefs, pick intentions, plan, act. Then four refinements, each fixing a way the previous loop goes wrong when the world changes mid-plan.

Kind: deliberative agent (BDI).
Week: 3 (slides 5 to 11).
Book: Wooldridge 4.3 Implementing a practical reasoning agent (pp. 75 to 77).
Techniques on this page: the basic loop, splitting deliberation into options and filter, commitment strategies, commitment to means (replanning with sound), commitment to ends (succeeded and impossible).

The problem it solves

Last week’s BDI said what a BDI agent has in its head. This page says how it runs.

The trouble is time. Deliberating and planning take a while, and the world keeps changing. A loop that plans and then executes blindly is the deductive agent’s calculative rationality all over again: a plan that was right when it started may be wrong when it’s carried out. Each cycle on this page fixes one more way that can go wrong. Cycle 5, with controlled reconsideration, is on the next page.

Words you’ll hear

Word or symbol Plain meaning
\(B, D, I\) the agent’s current beliefs, desires and intentions
\(\rho\) the latest percept (here, not the deductive agent’s rules)
\(brf\) belief revision: update beliefs with a new percept
\(options\) generate desires (what could I aim for?) from beliefs and current intentions
\(filter\) choose which desires to commit to: these become intentions
\(plan\) means-ends reasoning: a plan \(\pi\) for the intentions
\(sound(\pi, I, B)\) “given what I now believe, this plan will still achieve \(I\)”
\(succeeded(I, B)\), \(impossible(I, B)\) the intentions are already achieved / can no longer be achieved
\(\wp(X)\) “sets of \(X\)”

Technique 1: the basic loop, cycle (1)

Problem it solves: a first runnable version of BDI.

1. B := B0;                   /* initial beliefs */
2. while true do
3.     get next percept ρ;
4.     B := brf(B, ρ);        /* belief revision */
5.     I := deliberate(B);
6.     π := plan(B, I);
7.     execute(π)
8. end-while

The flaw (slide 6): if deliberation starts at \(t_0\) and the plan is executed up to \(t_2\), the plan was right for the world at \(t_0\). That’s calculative rationality.

Technique 2: deliberation = options + filter, cycle (2)

Problem it solves: separates “what could I do?” from “what will I commit to?”.

Function Type Output
\(brf\) \(\wp(Bel) \times Per \to \wp(Bel)\) new beliefs
\(options\) \(\wp(Bel) \times \wp(Int) \to \wp(Des)\) desires
\(filter\) \(\wp(Bel) \times \wp(Des) \times \wp(Int) \to \wp(Int)\) intentions
\(plan\) \(\wp(Bel) \times \wp(Int) \to Plan\) a plan (STRIPS search or a library)

\(options\) takes the current intentions as input: what you’ve already committed to shapes what you’ll consider (“intentions filter options”).

1. B := B0;  2. I := I0;
3. while true do
4.     get next percept ρ;    5. B := brf(B, ρ);
6.     D := options(B, I);    7. I := filter(B, D, I);
8.     π := plan(B, I);       9. execute(π)
10. end-while

Worked example: the delivery robot, run on cycle (2). Five rooms:

   lab ─── hall ─── office
    │                 │
  garden ─── yard ────┘

The robot is in the lab with a package for the office. \(D = I = \{deliver(package, office)\}\), and \(plan\) gives the shortest route \([go(hall), go(office), drop(package)]\).

The hall–office door closes just after the robot reaches the hall. Cycle (2) executes the whole plan without looking: \(go(office)\) fails, \(drop\) in the hall fails. Only then does it perceive and plan the long way: \([go(lab), go(garden), go(yard), go(office), drop]\).

Total: 8 actions, 2 of them wasted.

Technique 3: commitment strategies

Problem it solves: “how long should an intention last?”

The book’s story (p. 76): Willie the household robot. Asked for a beer, the first Willie does something else (under-committed). The fixed Willie fetches the beer even after being told “never mind” (over-committed). The final Willie smashes the last bottle on the way: its rules let it drop commitments that became impossible, and it made this one impossible itself.

Strategy Keeps the intention until it believes…
Blind (fanatical) …it has been achieved
Single-minded …it has been achieved, or it’s no longer possible
Open-minded (book only) …it is no longer possible (originally: while it’s still desired)

Commitment applies to two things (slide 10): the ends (the intention) and the means (the plan). Cycle (2) is over-committed to both.

Technique 4: commitment to means, cycle (3)

Problem it solves: notices a broken plan and fixes it, without changing the goal.

Execute one action at a time and look after each:

9.  while not empty(π) do
10.     α := head(π);  11. execute(α);  12. π := tail(π);
13.     get next percept ρ;  14. B := brf(B, ρ);
15.     if not sound(π, I, B) then
16.         π := plan(B, I);
17.     end-if
18. end-while

Worked example: the delivery robot on cycle (3). After \(go(hall)\) it sees the door is shut. \(sound([go(office), drop], I, B)\) is false, so it replans from the hall: \([go(lab), go(garden), go(yard), go(office), drop]\).

Total: 6 actions, none wasted, against cycle (2)’s 8.

Technique 5: commitment to ends, cycle (4)

Problem it solves: stops working on a goal that’s already done or can never be done.

Cycle (4) changes only line 9:

9.  while not (empty(π) or succeeded(I, B) or impossible(I, B)) do

Worked example. A colleague delivers the package while the robot is in the garden.

  • Cycle (3) carries on to the office and tries to drop a package that’s already been delivered: it only checks whether the plan is sound.
  • Cycle (4) notices \(succeeded(I, B)\) in the garden and stops.

If every route to the office were blocked, cycle (3) would replan forever; cycle (4) exits on \(impossible(I, B)\).

Cycle Looks during execution? Fixes a broken plan? Stops when done or impossible? Slide’s label
(2) no no no blindly committed
(3) yes, after every action yes (\(sound\)) no “single-minded” (see below)
(4) yes yes yes single-minded (3 + 4 together)

Slide labels, slightly off. Slide 9 calls cycle (3) single-minded, but single-minded commitment needs the “achieved or impossible” test, which only cycle (4) adds. Slide 11 sorts it out: cycles (3) and (4) together are single-minded, matching the book’s Figure 4.3. Slide 9 also calls cycle (2) “blindly committed”: read it as blindly committed to the plan, since it doesn’t even check whether the goal is achieved.

What to read in the book

Section Read? Why
4.3, pp. 75 to 77 Read The control loop (Figure 4.3 = slide 13’s final cycle), the Willie story, commitment strategies
4.3, pp. 77 to 79 Read Reconsideration: see the next page
4.4 PRS Read See AgentSpeak

The book lists three commitment strategies; the slides only use blind and single-minded. Page numbers are the book’s; in the scanned PDF add 21.

Practice prompt

I'm studying CS5940 Intelligent Agents (Wooldridge, An Introduction to MultiAgent Systems, 2nd ed., 4.3). I want practice on THE BDI CONTROL LOOP, cycles (1) to (4):
- the basic loop (perceive, brf, deliberate, plan, execute) and why it suffers from calculative rationality
- the types and roles of brf, options, filter and plan, and why options takes the current intentions
- blind, single-minded and open-minded commitment; the Willie robot story
- commitment to means (cycle 3: execute one step, perceive, replan if not sound) vs commitment to ends (cycle 4: stop on succeeded or impossible)
- tracing a robot through a small map of rooms when a door closes or someone else achieves the goal: count actions and wasted actions for each cycle
- why the slides' labels for cycles (2) and (3) are a little loose

Please:
1. Use plain, everyday language and explain any symbol in one short sentence.
2. Give me ONE question at a time, easy first, then harder; describe maps and events precisely.
3. Wait for my answer, then mark it and show the full trace or model answer.
4. If I get it wrong, explain the mistake and give me a similar question.
5. Every 5 questions, summarise my strengths and what to practise.