CS3760-Artificial Intelligence- Project 3 Solved

30.00 $

Category:
Click Category Button to View Your Next Assignment | Homework

You'll get a download link with a: zip solution files instantly, after Payment

Securely Powered by: Secure Checkout

Description

5/5 - (1 vote)

 

Overview

The goal is to help Pacman navigate a game board and survive the ghosts. The game is a little different then the arcade version:

  • There is a fixed amount of time your agent has to decide on its move.
  • The ghosts always move closer to you (except when they’re scared)
  • You get 10 points for eating each food pellet
  • Every turn you lose 1 point, so you need to be efficient
  • Eating a blue power up gives you 40 turns where the ghosts are scared. You get 200 points for each on you catch. During this time they move away from you at half speed.
  • If you clear all of the food pellets you get 500 points and the game ends
  • If a ghost catches you, then you lose 500 points and the game ends.

If you have cs1graphics, you can watch everything happen using a graphics screen. Otherwise, you can see the game board in text form.

Files: The files are available in the class git repo (and also on Moodle). The the course page for instructions on access the git server. The name of this assignment is project3. You should only edit MyPlayer.py and description.txt.

Grading:      Each assignment will be graded as follows:

50% Performance on final version relative to reference implementation
30% Code quality: correctness, use of AI methods, clarity, etc. this will be based on both the initial and final version
20% Description of algorithm used, why it is effective and the steps to took to improve it
up to 5% bonus Performance relative to your classmates

 

What to change in MyPlayer.py

You should carefully go through the code in MyPlayer, you don’t have to worry about the code in the other files. You will be implementing the findMove methods. You can add any helper functions you want and make additions to the constructor.

Running your program

In either the Python shell or Idle run Run.py. It will ask you to enter a few parameters and then will run.

Useful methods

Player class (which MyPlayer inherits from):

  • timeRemaining() return True or False depending on whether there is time remaining to determine your move
  • setMove(move) sets the move you want to use. You can call this multiple times as you find better move options. If time is up, this does nothing.

State class:

  • getScaredTurnsLeft() returns how many turns are left for the ghosts being scared. 0 if they are not.
  • getPlayerPosition() returns (row,col) for the position of the players
  • getGhostPositions() return a list of (row,col) positions for all of the ghosts
  • getPellets() returns a set of the locations (row,col) of all of the pellets
  • getPowerUps() returns a set of the locations (row,col) of all of the power ups
  • gameOver() returns true if the game is over
  • getScore() returns the score
  • getTurn() the current turn of the game
  • actions() return a list of the possible actions the player can make from it’s current positions. Possibilities are ’Stay’, ’Left’, ’Right’, ’Up’, ’Down’.
  • result(action) returns a new state that is the result of the player taking the given action
  • ghostResultDistribution() return a list of (state, probability) pairs. These include all possibilities of where the ghosts may have moved.
  • project3-hh0bqk.zip