The Wumpus world is a classic AI problem where an agent navigates a cave to find gold while avoiding pits and a deadly Wumpus. The agent uses senses to perceive its environment and must make decisions to maximize rewards and minimize penalties. The environment is partially observable, deterministic, sequential, static, discrete, and single-agent.
The Wumpus world is a classic example used in artificial intelligence to demonstrate the capabilities of knowledge-based agents and the principles of knowledge representation. It draws inspiration from the 1973 video game "Hunt the Wumpus" by Gregory Yob.
In the Wumpus world, we have a cave consisting of 4x4 rooms interconnected by passageways, totaling 16 rooms. The cave is inhabited by a dangerous beast known as the Wumpus, which will devour anyone who enters its room. The agent, our knowledge-based entity, must navigate this perilous environment. The cave also contains bottomless pits, and falling into one means the agent is trapped forever. Amidst this danger, one room holds a precious heap of gold.
The agent's objective is to find the gold and safely exit the cave without encountering the Wumpus or falling into a pit. Shooting the Wumpus is possible, but the agent has only one arrow. Successfully retrieving the gold and leaving the cave results in a reward, while being eaten by the Wumpus or falling into a pit incurs a penalty.
The diagram below illustrates a sample representation of the Wumpus world. It depicts various rooms with pits, one room containing the Wumpus, and the agent positioned at the (1, 1) square location within the world.
The cave's environment provides several cues to aid the agent in its exploration:
We have given PEAS description as below to explain the Wumpus world:
The agent's performance is measured by its ability to maximize rewards and minimize penalties. It receives a positive reward for successfully retrieving the gold and safely exiting the cave. It incurs a negative penalty for falling into pits or being eaten by the Wumpus.
The Wumpus world is a complex cave system consisting of interconnected rooms. Each room can either be safe, contain a bottomless pit, house the Wumpus, or hold a glittering pile of gold. The agent must explore this environment, using its senses and intelligence to navigate safely.
The agent can perform various actions in the environment. It can move to adjacent rooms, shoot an arrow in a straight line to potentially kill the Wumpus, grab gold in the current room, and climb out of the cave to exit.
The agent relies on its sensors to perceive the environment. It can detect a stench in adjacent rooms (indicating the presence of the Wumpus), a breeze in adjacent rooms (indicating a pit), glitter in the current room (indicating gold), and the Wumpus's scream (indicating a successful elimination if the Wumpus is shot).
These percepts can be represented as a five-element list, with different indicators for each sensor. For example, if the agent perceives a stench and a breeze, but no glitter, bump, or scream, it can be represented as: [Stench, Breeze, None, None, None].
Initially, the agent is in the first room or on the square [1,1], and we already know that this room is safe for the agent, so to represent on the below diagram (a) that room is safe we will add symbol OK. Symbol A is used to represent agent, symbol B for the breeze, G for glitter or gold, V for the visited room, P for pits, W for Wumpus.
At Room [1,1] agent does not feel any breeze or any stench which means the adjacent squares are also OK.
After deciding to move forward, the agent has two options: either move to [1, 2] or [2, 1]. Let's assume the agent chooses to move to [2, 1]. In this room, the agent detects a breeze, indicating the presence of a pit nearby. The pit could be in [3, 1] or [2, 2]. To indicate uncertainty, we add the symbol P? to these squares.
Upon sensing the breeze, the agent stops and considers its options, avoiding any potentially harmful moves. It decides to backtrack to the [1, 1] room. Both [1, 1] and [2, 1] are marked as visited using the symbol V.
At the third step, the agent moves to the room [1,2], which is OK. In this room, the agent perceives a stench, indicating the presence of a Wumpus nearby. However, the Wumpus cannot be in [1,1] (according to the rules of the game) and also not in [2,2] (since the agent did not detect any stench when it was at [2,1]). Therefore, the agent infers that the Wumpus is in the room [1,3].
In the current state, there is no breeze, which means there is no pit in [2,2] and no Wumpus. So, [2,2] is marked as safe (OK), and the agent moves further to [2,2].
At room [2,2], there are no stenches or breezes present. Let's suppose the agent decides to move to [2,3]. In room [2,3], the agent perceives glitter, indicating the presence of gold. The agent should grab the gold and climb out of the cave.