reset password
Author Message
msargent
Posts: 519
Posted 19:31 Dec 03, 2014 |

1. You only need to keep track of the moves for the first layer of children. That is, just put them in a list, and store the move that produces them in a corresponding list (you could use a dictionary as well). Then go through the list and compute the value of that node using the appropriate search algorithm, without worrying about returning moves. Choose the child in this list with the the highest value and return the corresponding move. 

2. Don't use instance variables (self.variable) for alpha or beta in alpha-beta pruning. 

3. Stick to the algorithms given in the slides as much as you can: don't go off on your own!! Only depart from it if you need to (as in the Expectimax problem. You will also have to adjust for multiple min agents)). 

4. In alpha-beta pruning, keep track of which sub method to call in the dispatch method: don't do it in minValue. Use modulus to keep track of whether the agent is Pacman or a ghost. In psuedocode it will be something like: if agentNumber == 0: you have Pacman, else you have a ghost. If you have Pacman call maxValue, else call minValue. When passing in the agentNumber into your functions (you will need to), don't forget to take the modulus (agentNumber % totalNumberOfAgents) after you increment but before you pass it.  

5. In expectimax, the min nodes are replaced by chance nodes. Each move is equally probable, so just return the average value of all the moves (don't use max(~~~), just add up the values and divide by the number of moves). This is one place where you will need to depart from the slide pseudocode. 

I hope this helps. See you on Saturday!

Last edited by msargent at 07:21 Dec 04, 2014.