Python Question Please read the instructions before submitting the offer sumbit via .py files

Pacman Agent Assignment

Download the code pacmanAgentGame.rar from canvas week 11 Lecture slides and videos. Unrar the program, it will create a folder pacmanAgentGame, study the code; specifically minimax.py and gameplay.py.

Answer the following questions:

Make the following maze:

  1. Run the program on smallMaze1.txt

  1. Record pacman score and the time required to complete the execution

    1. Pacman score: __________

    2. Execution time: _________

  2. Print the legal action list when pacman is at the location shown in the above picture (initial state)

  3. Print the scores of every pacman action in the minimax function.

    1. Write the scores: _______________________

  4. What is the strategy of search for monster blue in the code? ____________________

  5. Add another monster, just add 'M' in the maze above, run the code:

    1. Did pacman managed to get all foods? If so, what is the score and execution time?

    2. What is the color of the new monster added?

    3. What is the track strategy of new monster added?

Make a new copy of all the code to a new folder called execptimax. Then implement Expectimax algorithm to the code in the expectimax folder where the min player returns the average of the states' scores generated. Implement it on the smallMaze.txt (not smallMaze1.txt)

You need to remove the alpha and beta parameters and the code associated with it. Then you need to write the code in the minValue function where you return the average of the v variable. The video about pacman agent game on canvas week 11 shows you all the update.

Answer the following questions:

  1. What is the score and execution time for depth =2?

    1. Score: _________________

    2. Execution time: _________

  2. Change the maze to smallMaze1.txt, and use only one monster.

    1. Make the monster move random, watch the video pacman Agent Game to see how to do that:

      1. Add in problemConfiguration to the variable monsterType: 'random' as the first item in the list.

    2. Did pacman managed to collect all foods? If so, what is the score and execution time?

    3. Use minimax with alpha-beta pruning algorithm to see if pacman will collect all the food? If so, what is the score and execution time?

What to submit:

  1. You minimax code updated with the expectimax algorithm.

  2. This document filled with your answers?