Introduction
As announced assignment # 1 consist of 3 parts: a self-explorartory on-line task, some paper and pencil work, and some programming. The total credit is 100 points for the whole assignment. Points are given in brackets.
Due date: Di 24.4.2007
Part 1: Self Exploration
Please go to
(page protected with the usual username & password)
alternatively go to:
http://www.cs.ubc.ca/labs/lci/CIspace/Version4/search/index.html
and try out all the search algorithms. Ask yourself whether you can find all the differences between the algorithms addressed in class.
Part 2: Paper and Pencil: STRIPS (20)
Part 2a:Formulate the "Sussman anomaly" with STRIPS language(10)
The following figure shows a blocks-world problem known as the Sussman anomaly. Formulate it in STRIPS language.
Part 2b: Solving a problem with CSP (10)
Please note:
We found that the current version of applet only has limited number of predefined constraints, which make it unsuitable for our sudoku puzzle. Please feel free to skip Part 2b (c). Sorry for inconvenience.
Contact us if you have further questions.
Consider the sudoku puzzle below. If you don't know sudoku read this.
Formulate the problem in terms of variables, domains, and constraints.You may want to enter the problem into the applet that can be found and downloaded here.
Using the applet is not mandatory because it's quite time-consuming. If you hand in a correct solution of the problem(screen-dump/output of the applet) you'll get 5 bonus points.
Please note: If you choose the applet, you might NOT want to use any string-set domains (but integers), as the number of constraint types is too limited with strings!
What to hand in:
b) A textual definition of the problem (domains, variables, etc.) Handing in the textual definition of the problem (without solution) is mandatory and worth the 10 points.
c) A screen-dump/output of the applet if you want 5 extra points....
Part 3: Programming a "Settlers"-Player (80)
Implementation Notes:
A small application providing seven classes has been written to provide an appropriate environment that allows a direct implementation of your heuristic function at the setvillage method in the player class. The Java source code of the application can be downloaded as SettlerAssignment1.zip. First unpack the zip file into a directory. If you have not installed Java on your system go to Sun's Java web page and download the appropriate Java package for your machine. Follow the instruction on the page to install Java on your machine.
Just a few remarks about the code:
We have coded the fields and village positions according to the following figure.
We list the public methods in the Board class that you could use to access the game board information.
- int VillageOwner(int Village_ID).
This method check if the given village location is being occupied and is being occupied by which player. - int fieldResource(int Field_ID).
This method returns the resource type of given field location. - int fieldNum(int Field_ID).
This method return the number which is associated with the given field location. - int buildVillage(int Village_ID, int Player_ID).
This method update the game board by building a new village on a given village location by given player. - int[] NeighbouredField(int Village_ID).
This method return all the field locations which is neighboring to the given village location.
What to hand in:
- Part2a) A textual description of the answer
- Part2b) A textual description of the answer, and a screen dump of the applet for extra credits.
- Part3) A modified player.java file, which contains the extended setVillage method and a short (less than half a page) explanation about the design of your player.
Please do not hesitate to contact Jiwen Li if you have questions or remarks of any kind.