Menu

[ IVLE ]

[ Overview ]
[ Syllabus ]
[ Grading ]
[ Homework ]
  [ HW 1 ]
  [ >HW 2T ]
  [ HW 2I ]
[ Misc. ]

Homework #2T: NXT generation Wumpus World

This homework assignment is over. See below for the details of the assignment, right after the pictures of the students who went through this tough assignment.

Hoang Nguyen Nhat Tao
Tran Bin Nguyen
Poh Wei Sheng
Ng Li Ying
Benson
Ha Thuy Ngoc
Le Xuan Bach
Missing
Alicia Lee Jiayi
Jessica Low
Zhao Danni
He Xi
Wang Nana
Zhang Han
Ma Zhencai
Benson Lim
A.Sanju Shree
Sneha Girish Tilak
Amrita Geevar
Cai Quo Wei Christopher
Teo Chang Chiew Simon
Missing
Leong See Shuen
Tan Wei Liang
Chen Zhejin Mark
Neo Qiyang
Zhou Kang Xiang
Missing
Xu Xiaojiang
Fan Qi
Cao Fan
Khek Ren Yong Kenny
Koh Ngiap Soon Jeremy
Tan Shi Jia
Afternoon
Christopher
Aditya Nugraha
Kong Choong Yee
Wu Shu Jun
Travis Ho
Do Anh Quang
Nguyen Chi Dat
Du Linxiang
Qiao Zheng Yuan
Reifferscheid Johannes
Koenig Alexander
Chadin Anuwattanaporn
Goh Jing Ying
Tay Hwee Shan
Hanyenkno Afi
Liew Hui Sun
Tan Ping Yang
Saw Woei Yuh
Tan Ser Kheng

By now, all of you should be very familiar with the sights (gold!) and smell (eewww!) of the Wumpus world. In this homework, you will have the opportunity to build an embodied agent to play the game. This is very useful to put what we have learnt to good practical use, and see how the theories bear out in the real world.

The game will play as described in the textbook, but to make it more challenging we will not restrict ourselves to a square world. The Wumpus world will be a irregular-shaped world divided into grid squares. Each grid square will measure 20 cm by 20 cm. The objective of the game is to find the gold that is stashed in one of these grid squares. As in the textbook, there's a blinding glitter in the square where the gold is found.

Of course all is not calm and peaceful in the Wumpus world. There are pits into which you can fall (that would mean breaking up into a lot of pieces), and the Wumpus is always ready to eat you up. In squares adjacent to pits, you will be able to feel a breeze. In squares adjacent to the Wumpus, you can smell its horrible stench. There can be a few pits in the world, but always just one Wumpus. Being no kung-fu expert, the Wumpus is always located in squares without a pit.

Since it is a dangerous world, you won't visit it empty-handed. You have with you a bow and arrow, which you can use to kill the Wumpus with. If the Wumpus is dead you can safely thread on its dead body. The arrow can't help you with the pits though, you'd need a kung-fu expert for that. When you fire the arrow, it will fly straight ahead until it hits the edges of the game world. If the Wumpus is along the flight path of the arrow, it will die, with a loud horrible squeak/scream/yell.

You want to get out of the Wumpus world with the gold from where you entered.

Technical Description

Lego markets a line of programmable "robots" which comes with various sensors and actuators. We will play this game with these "Nxt" robots.




The Nxt Robot

Input - Sensors

The robots have several sensors as can be seen from the picture above. Those that we will use in this homework include the:

  1. light sensor
  2. sound sensor

Output - Actuators

The robots also have the following actuators:

  1. motor
  2. speaker
  3. LCD monitor

It is hard for us to design a truly immersive environment for this homework due to resource and time constraints, but we'd be doing what we can.

The game grid will be composed primarily of WHITE squares laid out on the floor. It's unfortunate that we are not able to get smell/wind sensors, thus to detect the stench of the Wumpus and the breezes from pits, we will use grey squares of varying shades. The light sensor of the robot will be used to measure the intensity of the shades of grey.

At the start of the game, the robot will go through a calibration process where it will be shown each shade that is used in a fixed sequence. The light sensor can be calibrated to recognise the varying shades. A sample of the various shades used is shown here. An extract of the code that does this is found (here).



Example of different shades used for calibrating light sensor. (high resolution)

During the game if the robot manages to hit the wumpus with the bow-and-arrow, the Wumpus dies and it's yell (above 80dB) can be detected by the sound sensor.

The robot will move around the world with its motors. These new generation robots are actually reasonably precise, so given the dimensions of the grid squares, the robots should be able to navigate around the grid without more help. If you so prefer, diagonal moves are allowed to. The short video clip below shows the robot in action. If the robot strays from its course, you will be allowed to help correct its placement and location with a small penalty.



We think it will be splendid to equip the robot with a real bow and arrow to shoot the Wumpus with, and robot arms to pick up real gold stashed in the game. However due to the simplicity of the robot, and the lack of budget to supply real gold to play the game with, we will instead be using the speaker and LCD as the man actuators of the robot. The robot can make self-defined sounds to signify actions such as shooting the bow-and-arrow, and picking up any gold found on the floor. The arrow can shot in any direction (diagonal or along the X-Y axis), and the robot can only pick up gold if it is in the same grid square as the gold.

Tricks and Tips

  1. The robots can be programmed in a variety of languages. Languages you are more familiar with could include Java and C. You can find instructions on how to work the robot with these languages easily on the Internet. Some of the Java resources can be found at the bottom of this page.If you have to flash the firmware of the robots so that you can program them in the language of your choice, do note that you need to flash the robots back to the original Nxt firmware before returning the robots!
  2. Be creative with your robots! Interesting projects by Nxt fans around the world are listed here.
  3. It will be up to you how you want your robot to "think" in the Wumpus world. Think about the different types of agents we have learnt, such as a simple-reflex agent for example, and decide which is more suitable for your agent. Consider also strategies like state-space searching, or logic resolution.

Grading and submission formatting

Grading of the project is done in two parts. The first part examines how well your robot performs in the real-world. The date of this grading will be announced subsequently.

We will set up the grid square of the Wumpus world on the floor, and your robot will be given the chance to make a dash for gold. An example of such a grid is shown below. Do note that the grid we set up need not regularly shaped such as a square or rectangle. You have to come for the evaluation with your own laptops and compile and load your code into the robot on the spot. This is to ensure that the code you used in the robot is the same one you submitted. Every robot will be given 5 minutes for this.

Each robot will be given 2 attempts in the Wumpus world, and the best score of either try will be recorded. Points will be allocated for the various events that can happen. It will work as follows:

  1. Exit Wumpus World empty-handed: -100
  2. Exit Wumpus World With Gold: 200
  3. Fall into pit: -80 (game over)
  4. Get eaten up by the Wumpus: -80 (game over)
  5. Kill Wumpus: 60
  6. Shoot arrow: -10 (it's an expensive iArrow)
  7. Every 10 seconds from the start of the game: -3
  8. Every time robot needs help to stay on course: -15 (capped at -60)



Example of real-world Wumpus world setup. Note that edges of the game world is denoted by black squares.

The following submission guidelines is very similar to the HW1 guidelines. For us to grade this assignment accordingly, we need you to adhere strictly to the following submission guidelines. They will help us grade the assignment in an appropriate manner. You will be penalized if you do not follow these instructions. Your matric number in all of the following statements should not have any spaces and any letters should be in CAPITALS. You are to turn in the following files:

These files will need to be suitably zipped in a single file called submission-<matric number>.zip. Please use a zip archive and not tar.gz, bzip, rar or cab files. Make sure when the archive unzips that all of the necessary files are found in the current directory (please do not nest your files in internal folders). Upload the resulting zip file to the IVLE workbin by the due date: 2010 November 4, 11:59:59 pm SGT. There absolutely will be no extensions to the deadline of this assignment. Read the late policy if you're not sure about grade penalties for lateness.

Important Links

NXT links:

  1. Lego Mindstorms: http://mindstorms.lego.com/en-us/Default.aspx
  2. Mindstorm driver for PC: http://mindstorms.lego.com/en-us/support/files/default.aspx
  3. Java for NXT: http://lejos.sourceforge.net/nxt/nxj/api/index.html
  4. Other unofficial guides: [ Java NXT Eclipse Tutorial ] [ Lejos Tutorial ]

Wumpus World links:

  1. As long as our textbook has been around, there have been students and faculty coding software wumpus worlds. You can see some videos of these agents in action on Youtube.
  2. And there is solution code to the original Wumpus world (you may look, but code the solution on your own) working in many software languages. You may find them helpful. Please do remember to give credit (cite) to those people whose solution informed your agent's construction.

Min-Yen Kan <kanmy@comp.nus.edu.sg> Tue Oct 05 15:30:00 2010 | Version: 1.0 | Last modified: Tue Oct 05 15:30:00 2010