Wumpus World
- Recall from last time we discussed:
- The definition of an agent.
- The interaction between agent design and the
environment that the agent must operate in.
- The question of empirical validation.
- This time we consider the Wumpus World which is a
very simple computer game:
- An environment for agent design
- the environment
- the scoring function
- rules for acting
- Using the program
- location on the system
- running the code
- setting up your directory
- compiling
- Overview of the code
- Definition of Wumpus World:
An early computer game in which an agent explores a cave
consisting of rooms connected by passages. Lurking in the
cave is one or more wumpi, beasts that eat people. Some
rooms contain bottomless pits that trap those who wander in
there. Of greatest interest is the fact that somewhere in the
cave there is one or more heaps of gold. The object of the
game is to enter the cave, find the gold, and leave without
falling in a pit or getting eaten by a wumpus.
- The wumpus environment:
- Definition: A 4x4 or larger grid of squares, where
the entire grid is surrounded by walls. The
entrance is in the lower left-hand corner in a
square labeled (0,0). Each square has a coordinate
designation indicating its position in the grid.
- properties:
- accessibility
- deterministic
- episodic
- static
- discrete
- percepts:
- stench in squares adjacent to a wumpus
- breeze in squares adjacent to a pit
- glitter in the square with the gold
- bump when walking into a wall
- scream when wumpus dies
- actions:
- move forward
- turn right (90 degs)
- turn left (90 degs)
- grab the gold
- shoot an arrow
- climb out of the cave
- The agent:
- goal: find the gold and leave the cave as quickly as
possible without getting killed.
- The Board Layout:
_______________________
| | | | |
|(0,3)|(1,3)|(2,3)|(3,3)|
|_____|_____|_____|_____|
| | | | | up
|(0,2)|(1,2)|(2,2)|(3,2)|
|_____|_____|_____|_____| <--L R-->
| | | | |
|(0,1)|(1,1)|(2,1)|(3,1)| Down
|_____|_____|_____|_____|
| | | | |
|(0,0)|(1,0)|(2,0)|(3,0)|
|_____|_____|_____|_____|
(courtesy of Richard Preston)
Evaluation, the scoring function:
- One point penalty for each action
- 10,000 point penalty for getting killed (the simulation
applies only a 1000 point penalty)
- 1000 point award for finding the gold and leaving
the cave alive
- scores can be averaged over multiple trails (games)
in a single configuration.
Using the program
- Location: /usr/local/csci/373/players
- Player choices:
- HumanPlayer
- RandomPlayer
- CheatingPlayer
- Running the program
- change to the directory of the desired player
and enter program name followed by 2
optional arguments specifying the number of
trials and the size of the environment
- e.g.: HumanPlayer 2 4 To run 2 trials of the
human player in a 4x4 grid
- you receive scores for each trial and a
summary score for all trails in the same
environment
Setting up your directory
- Within your Computer Science home directory
create a protected subdirectory for this course by
typing the following commands:
- cd
- mkdir -p csci/373/wumpus
- chmod go-rx csci/373/wumpus
- Now copy the HumanPlayer directory into this
directory by typing the following commands:
- cd csci/373/wumpus
- cp -r
/usr/local/csci/373/players/alpha/HumanPlayer .
- This should copy the HumanPlayer directory
into your directory.
- Compiling new code:
- In your directory, remove the executable code. In
the HumanPlayer directory, the executable code is in the files
"HumanPlayer" and "HumanPlayer.o". A
simple way to remove these files would be to give the
command "make clean".
- To compile the files HumanPlayer.cc and
HumanPlayer.hh and link them with the
supporting code in the wumpus library, simply
give the command "make". This causes the
Makefile in that directory to be executed.
- Later in this course when you write your own
player, you will need to create a new directory for
that player and copy the Makefile from:
"/usr/local/csci/373/players/alpha/HumanPlayer" into the new directory. Once you
have copied the Makefile to the new directory, exit
the Makefile and change the name of the Target to
correspond to the name of the new Player.
- Organization of the code:
- agent vs. library
- you write the agent code. Examples of agents
are HumanPlayer, RandomPlayer and
CheatingPlayer under directory:
/usr/local/csci/373/players
- you are provided with a wumpus simulation
library that contains all of the simulation code
including a main function. The library code is
in the subdirectory "lib" under the
appropriate machine sub-directory under:
/usr/local/csci/373/wumpus