Deductive Systems in Wumpus World Game

This is a c++ implementation of the well known game, wumpus world, and an intelligent agent that play the game by its own to win it. Description about the game and the implementation plan is provided below.

Intelligent Agent Description

source

Definitions

  • Intelligent Agent: an agent that perceives and acts in the environment it lives in.
  • Agent function: a procedure that maps a perception to an action.
  • Agent program: actual implementation of the agent function.
  • Perception history: chronologically ordered list of the history that the agent perceived.

Types of Agents:

  • Simple reflex agent: percept and sends corresponding action. For every perception, it has an action mapped to it.

  • Model-based (knowledge-based) reflex agent

    • Model: the general knowledge of things and rules in an environment (world).
    • Agent’s internal state: representation of the current state based on perception history and previous actions.
    • Deductive system: the agent function must contain a deductive mechanizable procedure. It is the system that uses the model and the agent’s internal state
  • Learning agent: an agent that can extract knowledge or model from an environment. It can find a new axiom from the environment.

Wumpus World Game

According to this article, the Wumpus world is a simple world example to illustrate the worth of a knowledge-based agent and to represent knowledge representation. It was inspired by a video game Hunt the Wumpus by Gregory Yob in 1973.

The Wumpus world is a cave which has 4X4 rooms connected with passageways. So there are total of 16 rooms which are connected with each other. We have a knowledge-based agent who will go forward in this world. The cave has a room with a beast which is called Wumpus, who eats anyone who enters the room. The Wumpus can be shot by the agent, but the agent has a single arrow. In the Wumpus world, there are 3 Pits, rooms which are bottomless, and if agent falls in Pits, then he will be stuck there forever. The exciting thing with this cave is that in one room there is a possibility of finding a heap of gold. So the agent goal is to find the gold and climb out of the cave without fallen into Pits or eaten by Wumpus. The agent will get a reward if he comes out with gold, and he will get a penalty if eaten by Wumpus or falls in to a pit.

The World will be governed based on the following rules:

  • Rooms adjacent to wumpus stench.
  • Rooms adjacent to pits breeze.
  • Rooms with Gold glitter.
  • The agent has one arrow.
  • If the agent shoots an arrow into the room the wumpus is in, then the Wumpus dies.
  • If wumpus and agent are in the same room wumpus will kill the agent.
  • There is one wumpus, 3 pits and 1 gold kept at randomly choosen rooms. The rooms at grid location of (0,1) and (1, 0) are initialy empty and the agent is in the room at grid location (0,0).

here you can find the implemention plan.

Build and Install

The project can be built using the comands below. The built executable runs only the test until the whole program is implemented.

Note: The instructions below will be updated as the development proceeds.

Perform the following steps at the shell prompt:

cd /to/project/root_dir

mkdir build

cd build

cmake ..

make

sudo make install # install in /usr/local

make DESTDIR=/installation/path/ install # install in user defined directory. e.g: ~/Desktop/wumpus

wumpusTest # run the unit test (if it is installed in /usr/local)

~/Desktop/wumpus/usr/local/bin/wumpusTest # run the unit test (if it is installed in ~/Desktop/wumpus/usr/local)

If the project is successfuly built and installed, then you will obtain such output:

Running cxxtest tests (n tests).....OK!

where n is the number of tests performed.