##### Differences

This shows you the differences between two versions of the page.

+                                        P(observed = occupied | state = occupied) is approximated as true positive rate
+                                        P(observed = not occupied | state = occupied) is approximated as false negative rate
+
+                                        P(observed = occupied | state = not occupied) is approximated as false positive rate
+                                        P(observed = not occupied | state = not occupied) is approximated as true negative rate
+                                        ​
+
+                                        Second, you can improve the efficiency of your algorithm by noting that obstacles are made up of several occupied cells. ​ If you are clever, you can observe that the probability of a cell being occupied is pretty low if none of the cells around it are occupied, and it's pretty high if all of the cells around it are occupied. ​ Although you don't need to do this to get the lab to work, it may make your algorithm converge more quickly. ​ However, it may also take more time to implement since you will need to look at cells around a particular cell to update its posterior probability.
+
+                                        Third, you will have to start with a prior probability that makes sense to you.  I started with a high prior probability of a cell being occupied since the likelihood that I used did a better job concluding that a cell was not occupied than that a cell was occupied. ​ You should experiment with a few things to see what works for you.
+
+                                        Fourth, you should be smart in how you have your robots move in the environment so that you build up your map as quickly as possible. ​ The MATLAB code that implements the Grid Filter has the robot move in pseudo-random directions. ​ This isn't very smart and you should be able to do much better.
+
+                                        =Implementation=
+
+                                        '''​BE SURE TO UPDATE YOUR COPY OF BZRFLAG. ​ CHANGES HAVE BEEN MADE'''​
+
+                                        Visualizing this lab is incredibly helpful, so that you can see what you are doing. ​ I do not recommend using Gnuplot for visualizing this lab; you can if you want to, but other methods probably work better. ​ Those of you who have been using things besides Gnuplot to visualize may already have a decent way to visualize this lab - all you need to do is display a grid that is gray-scaled based on your belief of whether or not the cell is occupied. ​ If you know OpenGL (say from CS 455), it is very well suited this type of visualization. ​ There is some sample Python code [http://​aml.cs.byu.edu/​~kseppi/​cs470sp07files/​grid_filter_gl.py here], that should be usable even if you don't know OpenGL. ​ Just call init_window() when you first start your agent, then update_grid() and draw_grid() in turn whenever you want to update the window (every time you update the grid, I would think). ​ If you want to see what the code looks like when used properly, change runme.sh to use grid_lab_agent instead of agent2 (i.e., use blind.py to run the pre-compiled grid_lab_agent.pyc in bots/​compiled).  ​
+
+                                        It can be rather slow to request the occgrid every tick for 10 tanks, depending on your language and how you implement your code.  You can choose how many tanks you want to use for this lab - if your code can handle 10, or 20 tanks just fine without slowing down, feel free to use 20 tanks. ​ If it is more efficient for you to use 1 or 2 tanks, go ahead. ​ Remember that you will be passing off to the TA, and he probably will not be happy if he has to sit waiting for you to finish for 15 minutes (a minute or two or three is probably reasonable, given that you have to send tanks through the whole world looking for obstacles).
+
+                                        Run bzrflag with the following parameters (plus some world, and any other necessary parameters): ​
+
+                                        <​pre>​--default-true-positive=.97 --default-true-negative=.9 --occgrid-width=100 --no-report-obstacles​
+
+                                        As a reminder, see the [[BZRC Protocol]] for how to use the occgrid command.
+
+                                        =What to Turn In=
+
+                                        When you are done, you pass the lab off to the TA in person. ​ The TA will check to see that you correctly locate obstacles in a world you have never seen that you should expect to be tricky (at least one world; we reserve the right to ask for more than one).  We will know the correct locations for the corners of obstacles, and you will have to reproduce them (and you should be able to figure it out without off-by-one errors - they may lose you some points, though only at most 5).  If the obstacle is L-shaped, or something more complicated,​ it is acceptable to break it up into rectangles and report those corners, or to report the L.  When you are testing, it might be helpful for you to know that the .bzw file for the map has all of the obstacle corners (at least you can figure them out), and that is what we will be using during passoff (i.e., if you can reproduce the corners that are in the .bzw file for the worlds you test on, you should be just fine).
+
+                                        The TA will also have you show where you implemented the Grid Filter; you'll be asked to explain how you implemented the likelihoods. The lab write-up should include:
+
+                                        #the amount of time you and your partner each spent on the lab,
+                                        #a summary of what you learned,
+                                        #a discussion of how you got your tanks to search the world (how many tanks your code could handle reasonably, whether or not you did anything tricky like looking at neighboring cells in the grid, how you moved your tanks around, what you did when tanks got stuck, etc.),
+                                        #a discussion of what happens when the sensor has different parameters (ex. it has a bigger range, it returns noisier estimates, you have an incorrect model for the amount of noise it returns, it only detects moving objects, etc.) - some of this you can test by varying the parameters you pass to bzrflag, and some you may have to just speculate on (like the moving objects bit),
+                                        #a discussion of how you would apply the grid filter in the capture the flag tournament, especially given the fact that you might get shot if you spend too much time wandering around the opponent'​s territory without having a good map, and that asking for the occupancy grid costs you computation time.
+
+                                        The point breakdown for this lab will be as follows:
+                                        * 60 points for correctly passing off to the TA (getting the answers right on an unseen world)
+                                        * 40 points for your written report:
+                                        ** 10 points for your discussion of how your tanks searched the world
+                                        ** 10 points for discussing what happens as the parameters of the sensor vary
+                                        ** 10 points for your thought about how you will use the grid filter in the final tournament
+                                        ** 10 points for other