public:t-622-arti-15-1:lab_2_-_hashing_states
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
public:t-622-arti-15-1:lab_2_-_hashing_states [2015/01/19 14:53] – stephan | public:t-622-arti-15-1:lab_2_-_hashing_states [2024/04/29 13:33] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 2: | Line 2: | ||
- | **Note:** For this lab, you can work together in teams of up to 4 students. You can use [[https:// | + | **Note:** For this lab, you can work together in teams of up to 4 students. However, this is not a necessity. The assignment is small enough to do it alone in which case you may get more experience. You can use [[https:// |
- | You will need a Java Development Kit (JDK) and a Java IDE (a text editor should do as well). | + | You will need a Java Development Kit (JDK) and a Java IDE (any text editor should do as well). |
===== Tasks ===== | ===== Tasks ===== | ||
Many environments have the property that there are several paths that lead to the same state. | Many environments have the property that there are several paths that lead to the same state. | ||
- | - Which of the search algorithms that we covered in class (breadth-first, | + | - Which of the search algorithms that we covered in class (breadth-first, |
- Which data structure is typically used for detecting repeated states and why? | - Which data structure is typically used for detecting repeated states and why? | ||
- Download the material below, implement a hash function for State objects that passes all the tests. | - Download the material below, implement a hash function for State objects that passes all the tests. | ||
- | - Report and comment on the results you get. Are they good or bad? How would they influence the efficiency and effectiveness of detecting repeated states if your hash function was used? | + | - Report and comment on the results you get. How many hash collisions and bucket index collisions do you get? Is this good or bad? (If the results are bad try to improve your hash function. If you only get very few collisions, increase the number of states that are generated in Main.java to 10000 or 100000 and see what happens.) |
- | - If the results are bad try to improve your hash function. If you only get very few collisions, increase the number of states that are generated in Main.java to 10000 or 100000 and see what happens. | + | - Why is it important to have few hash collisions if hashing is used to detect repeated states? |
===== Material ===== | ===== Material ===== | ||
- | * {{: | + | The Java project for the lab can be found on Skel. See, instructions below on how to get it. |
The project contains a State class that could be thought of implementing a state of some robot. The state consists of a position, an orientation and a boolean holding the information of whether or not the robot is turned on. The project also contains code to test how good the hashCode() method of the State class is. To run the tests simply run the Main class or use "ant run" on the terminal. | The project contains a State class that could be thought of implementing a state of some robot. The state consists of a position, an orientation and a boolean holding the information of whether or not the robot is turned on. The project also contains code to test how good the hashCode() method of the State class is. To run the tests simply run the Main class or use "ant run" on the terminal. | ||
Line 27: | Line 27: | ||
===== Handing In ===== | ===== Handing In ===== | ||
- | Hand in a zip file containing: | + | |
- | * the answers | + | Connect |
- | * your source | + | < |
- | To create | + | [student14@skel ~]$ tar xvf / |
+ | [student14@skel ~]$ cd arti15/lab2 | ||
+ | [student14@skel hw1]$ ls | ||
+ | answers build.xml dist Makefile questions src | ||
+ | </code> | ||
+ | |||
+ | You can copy the code to your own machine for development by using any SCP or SFTP client | ||
+ | |||
+ | To answer | ||
+ | Single answers will be put into files called '' | ||
+ | |||
+ | Finally, to hand in your answers run '' | ||
+ | This should produce a file ``/ | ||
/var/www/cadia.ru.is/wiki/data/attic/public/t-622-arti-15-1/lab_2_-_hashing_states.1421679215.txt.gz · Last modified: 2024/04/29 13:32 (external edit)