Start here: the Wumpus World and task environments

Every lab on this site uses the same small world. This page explains how that world works and where it sits among the kinds of task environments an agent can face (AIMA §2.3). The rest of the book is largely about how the right technique depends on the kind of environment.

1 Agents and environments

An agent perceives its environment through sensors and acts on it through actuators. At every time step it receives a percept, and its agent program maps the percept history to an action. A performance measure scores the resulting sequence of environment states. The agent is rational if it chooses actions expected to maximize that measure, given what it has perceived and what it knows (§2.2).

Agent sensors → agent program → actuators Environment the cave: pits, wumpus, gold, walls percept percept = [Stench, Breeze, Glitter, Bump, Scream] action action ∈ {Forward, TurnLeft, TurnRight, Grab, Shoot, Climb}

2 How the Wumpus World works (§7.2)

The cave click any square to see what the agent would perceive there

Percept at [1,1]

The caveA grid of rooms (4×4 in the book). The agent starts in [1,1], the bottom-left corner, facing east (right). Walls surround the grid.
PitsEach room except [1,1] has a pit with probability 0.2. Falling in kills the agent.
The wumpusOne wumpus, placed uniformly at random among the rooms other than [1,1]. Entering its room while it lives is fatal. It never moves (except in Chapter 6).
GoldOne heap of gold, placed uniformly at random among the rooms other than [1,1]. It may sit in a pit or under the wumpus, so some worlds can't be won.
ArrowThe agent has exactly one arrow. It flies straight in the direction the agent faces until it hits the wumpus (killing it) or a wall.

Percepts (sensors)

Stenchin the wumpus's room and the rooms directly (not diagonally) next to it. A dead wumpus still smells.
Breezein rooms directly next to a pit
Glitterin the room where the gold is
Bumpafter walking into a wall
Screamafter the arrow kills the wumpus, heard anywhere in the cave

The percept is a 5-tuple, e.g. [Stench, Breeze, None, None, None]. The agent never senses its own position: it must keep track of that itself.

Actions and performance measure

Forwardmove one room ahead (or Bump into a wall)
TurnLeft / TurnRightrotate 90°
Grabpick up the gold if it is in this room
Shootfire the arrow straight ahead (once)
Climbleave the cave. Only works in [1,1], and ends the episode

Score: +1000 for climbing out with the gold, −1000 for dying, −1 per action, −10 for using the arrow. The episode ends when the agent dies or climbs out.

Try it you see only what the agent perceives

Keyboard: ↑ ← → G S C. Squares you've visited show what you perceived there (B, S, G). What you conclude is up to you. Chapter 7 turns exactly this reasoning into logic.

3 Types of task environments (§2.3)

Before choosing a technique, characterize the task environment. First write its PEAS description (Performance, Environment, Actuators, Sensors). Then place it along the seven dimensions below. The harder side of each dimension (partially observable, multiagent, nondeterministic, sequential, dynamic, continuous, unknown) calls for more machinery. Test yourself: for each dimension, decide where the classic Wumpus World belongs before reading the answer.

Change one assumption, get a different problem

Most chapters on this site change the Wumpus World along one of these dimensions, and that change is what calls for the chapter's technique. Highlighted cells differ from the classic world.

Where to go next