代做FIT5047 Assignment 1: Search代做Python编程

FIT5047

Assignment 1: Search

Introduction

In the arcade game of Pac-Man, an eponymously-named agent accumulates points by collecting food dots while avoiding ghosts along the way. In the original version of the game, Pac-Man is controlled by a human player and ghosts are controlled by the environment. In this assignment, we will create a computer controller to play Pac-Man as efficiently as possible. We will consider different variations of the classic game to study different topics involving state-space search.

There are four parts to this assignment:

•  Part 1 is about programming single-agent search.  You will tackle a number of different maze navi- gation challenges that ask you to collect dots as efficiently as possible.

•  Part 2 is about programming adversarial search. You need to program a computer controller that plays a real game of Pac-Man, ghosts and all!

•  Part 3 involves writing a technical report where you explain your solution to the programming tasks in question 1c and question 2.

•  Part 4 is a face-to-face interview conducted during week 7  lab time. Failing to attend the interview will result in a score of 0. If you fail to answer the interview questions, your assignment mark will be significantly impacted.

This assignment is worth 35% of your marks for this unit. Please check the marking rubric provided on Moodle for more details. You will be evaluated based on:

1. The performance of your controller on the various game challenges.

2. The quality of your report, which describes and justifies your implemented techniques.

The due date for this assignment is September 5th, 2025 at  11:55pm (Melbourne local time).

SUBMISSION INSTRUCTIONS for this assignment are described on the last page of this document. Please follow these instructions carefully to avoid disappointment.

Pac-Man Overview

We will use a simulated version of the Pac-Man game, written entirely in Python and developed at the University of California, Berkeley. Instructions for how to download and install this software can be found in our Installation Guide, available on Moodle.  Descriptions of the software and tips for how to tackle the assignment can be found in our Getting Started Guide, again available on Moodle.

In broad strokes:

1.  The state of the game is tracked and advanced by a Pac-Man game simulator.

2.  The simulator divides games into a sequence of discrete iterations or timesteps.

3. In each iteration, a controller object must specify valid actions for each agent in the game.  The possible actions are: Up, Down, Left, Right and Stop.

4.  Every action has a cost of 1.

5.  Given a valid action, the game simulator updates the position of each agent and, if necessary, updates the score (invalid actions have no effect).

6.  The  game  simulator  continues  iterating  until  one  of the  following  termination  conditions  are reached:

•  The game board has been cleared of all food dots (i.e., the problem is solved).

•  Pac-Man is caught by a ghost (i.e., the game is over since Pac-Man only has a single “life”).

  Time runs out.

You will implement a several Pac-Man controllers, each one solving a different kind of problem.  Solution quality is measured in terms of  path  length  (shorter  is better).   Each time you  solve a problem, the corresponding plan (i.e., the sequence of actions computed by you) is printed to the terminal (stdout).

Support

If you have questions about any part of this assignment specification, the starter code or its supporting doc- umentation, please reach out to the teaching team.  We suggest Ed as a first stop, followed by consultations and then email. We will do our best to respond to your questions as effectively as possible.

Submission

PAY CAREFUL ATTENTION TO THE INSTRUCTIONS IN THIS SPECIFICATION

  Remember to submit all required files and documents.

  Do not modify any code that we do not ask you to.

  Each submission must be your own original work.

Failure to comply with these instructions may result in your attempt receiving an overall score of ZERO. Don’t get caught out! Check and double check your attempt!

Part 1:  Single Agent Search

In this part of the assignment, we will develop an AI controller to play Pac-Man:  Collect the Dots, a single- agent variant of Pac-Man. In this game, you must navigate a series of maze layouts, collecting as many dots as possible to maximise your score. There are no ghosts.

Question 1(a)

In this question, Pac-Man must find a path through the maze to collect a single dot:

1. Define the problem (i.e., game state, etc.) in the q1a problem class.

2. Implement the  A* algorithm using the Manhattan distance heuristic in the q1a solver class. Please only use the default Python modules, numpy and scipy. We will not be providing any others.

The command below shows how you can test your algorithm.  Modify the -l parameter to try different maze layouts, which can be found at layouts/q1a *.

> python pacman.py -l layouts/q1a_tinyMaze.lay -p SearchAgent -a fn=q1a_solver,prob=q1a_problem --timeout=1

Marking

Your q1a solver will be evaluated on 4 instances with a timeout of 1 second.  Timing out on any instance will result in 0 marks for that instance.

When your solver returns a plan for each instance, the game simulator will execute the actions one-by-one. The game finishes when there are no more actions to execute.  If your Pac-Man agent fails to collect the dot, you will receive a score of 0 for this instance.  If your Pac-Man successfully collects the dot, you will receive a mark of

for that instance, where Cis the cost of your solution and C*  is the minimum possible cost. We compute these minimum costs using a simple implementation of an A* algorithm using the Manhattan distance heuristic.  The mark for each instance is in the range [0,1], allowing  a maximum of 4 marks out of 100 for this question. Full marks should be achievable.

Question 1(b)

This question is similar to Q1(a) but there are now multiple dots in the maze.  Your Pac-Man needs to collect one dot (you decide which) while minimising the total number of node expansions.  Watch out for dots that are inaccessible!

1.  Define the problem (i.e., game state, etc.) in the q1b problem class.

2.  Modify your A* algorithm from Q1(a) in the q1b solver class.  Define an efficient heuristic to compute a plan and guide the agent to the chosen dot.

You can run your code using the command below. Modify the -l parameter to try your solver on different maze layouts with the prefix q1b   .

> python pacman.py -l layouts/q1b_tinyCorners.lay -p SearchAgent -a fn=q1b_solver,prob=q1b_problem --timeout=5

Marking

This task will be evaluated on 6 instances with a time limit of 5 seconds.  If Pac-Man fails to collect any dot, you will receive 0 marks for that instance. Otherwise, you will be evaluated on the number of node expansions in your A* implementation. You mark will be calculated as:

min 

where Eis the number of node expansions in your algorithm andE(ˆ)represents the number of node expansions

in a simple baseline that we implemented.   Your  mark  for  each  instance ranges from 0 to  1,  giving  a maximum of 6 marks out of 100 for this question.

Question 1(c)

This question is similar to Q1(b) but now you want to collect ’em all!  Collect as many dots as possible to maximise your score but consider that some dots might be so far apart that they’re not worth collecting! You will need to strategically balance the amount of search against the solution quality.

1.  Define the problem (i.e., game state, etc.) in the q1c problem class.

2.  Implement any algorithm to solve this problem in the q1c solver class.

The command below shows how you can test your implementation.  Modify the -l parameter to try your solver on different maps with the prefix q1c ).

> python pacman.py -l layouts/q1c_tinySearch.lay -p SearchAgent -a fn=q1c_solver,prob=q1c_problem --timeout=10

Marking

There are 10 out of 100 marks for your computational results. Your q1c solver will be run on 10 evaluation instances. Each run has a timeout of 10 secondsTiming out on any of these instances will result in 0 marks for this instance.  Otherwise, we will calculate your mark based on the score shown in the game GUI, measured relative to the score achieved by an existing benchmark algorithm.  This algorithm is reasonably strong, but obtaining a good score for this question should be achievable.

If you match or beat the score achieved by this algorithm on an instance, then you will receive 1 (full) mark for that instance. Otherwise, you will receive a percentage based on the following formula:

min (max 

where S(ˆ)is the score of the algorithm and Sis your score.  This formula restricts your grade to the range

[0,1].

Part 2: Adversarial Search

In this part of the assignment, you will develop a controller that plays an actual game of Pac-Man.  You must collect dots for points but now there are ghosts to avoid.

Question 2

There are multiple dots throughout the maze and between 1-4 ghosts.  The ghosts are controlled by the game environment. 

Implement the alpha-beta algorithm in the getAction function in the class Q2 Agent.  During each iteration of the game, the getAction function will receive the current game state and perform an adversarial search. Pac-Man is the maximiser agent (i.e., alpha) and each ghost is a minimiser agent (i.e., beta).  Once your search is finished, you should return the most promising action for Pac-Man to execute.  You are free to customise your algorithm, provided that you base it on alpha-beta search.

You can use the command below to run your code. Modify the -l parameter to try different maze layouts located at layouts/q2 *.

> python pacman.py -l layouts/q2_testClassic.lay -p Q2_Agent --timeout=30

Marking

There are 35 out of 100 marks for your computational results.  Your Q2 Agent will be evaluated on multiple instances, each with a time limit of 30 seconds.  This question is marked using the same criteria as question 1(c).  Your mark for each instance is your score as a percentage of the score achieved by an existing benchmark algorithm but capped to the range [0 ,1].  This algorithm is strong, so obtaining full marks will be challenging. The top three agents in this question will receive fame, glory and a certificate to document their superior skills at this game.

Part 3: Report

You must write a report of no more than 6 pages  (excluding references) outlining your approach to question 1c and question 2. This is an opportunity for you to demonstrate and explain your understanding of the problem and justify your solution.  You should discuss what you learned, what you tried, and what did and didn’t work.  We want to see that you have discovered and learnt something for yourself.  If you tried different algorithms, this is the place to discuss them. You could also discuss and analyse the impact of the small scale, granular design choices in your implementation, such as data structures and tie breaking (if any).


You should split the report into two parts, one dedicated to your approach to question 1c, and another dedicated to your approach to question 2.

Each part should be structured in the style of a scientific report, and should therefore contain:

  An introduction, where you introduce the problem to be solved, and any relevant background material.

  A method section, where you give a clear and detailed explanation of your approach.

•  A results section, where you present the performance of your approach, and any relevant experiments you did to compare different variants of your approach.

  A discussion section, where you interpret and explain the significance of your results.

•  A short conclusion, to summarise your work.

While writing your report, you should keep the following suggestions in mind:

• You should explain your algorithmic approach in such a way that another student with unit knowledge in FIT5047 could replicate your solution, including writing their own code.  This doesn’t mean you should tell us how you wrote the code, but you should clearly explain the high level algorithmic steps. You don’t need to explain how algorithms that we cover in the unit work, but if you make changes to these algorithms then you should explain the changes. If appropriate, you should include pseudocode (not images of actual code!) to support your description.

•  Justify your approach and design choices from a theoretical perspective, e.g.  time and space complex- ity analysis, a practical perspective based on your understanding of the problem to be solved, and empirical evidence, e.g. numerical experiments in your results section.

•  Present all the information and discussion through the lens of your unique personal experience solving the assignment.   We want to understand what you  discovered and learnt,  and how your personal experiences and insights motivated your design choices.

You will likely find the page limit quite tight, so be succinct and focus on the most interesting and insightful aspects of your approach. The report is worth 45 out of 100 marks.

Hints and Tips

•  Read the accompanying Getting Started Guide, a gentle introduction to the Pac-Man environment and tips for how to approach the assignment tasks.

•  Lecture slides and tutorial exercises are good starting points for ideas.   Check  the  recommended readings and optional resources for more ideas.

•  Alternative text-books and related research papers (e.g., that you may find on Google Scholar) can provide you with further sources of inspiration.

  Remember to justify your ideas in your report and to cite all your sources.

• If you implement your stubs carefully ,you may be able to re-use them to solve later search problems or to solve subproblems.




热门主题

课程名

mktg2509 csci 2600 38170 lng302 csse3010 phas3226 77938 arch1162 engn4536/engn6536 acx5903 comp151101 phl245 cse12 comp9312 stat3016/6016 phas0038 comp2140 6qqmb312 xjco3011 rest0005 ematm0051 5qqmn219 lubs5062m eee8155 cege0100 eap033 artd1109 mat246 etc3430 ecmm462 mis102 inft6800 ddes9903 comp6521 comp9517 comp3331/9331 comp4337 comp6008 comp9414 bu.231.790.81 man00150m csb352h math1041 eengm4100 isys1002 08 6057cem mktg3504 mthm036 mtrx1701 mth3241 eeee3086 cmp-7038b cmp-7000a ints4010 econ2151 infs5710 fins5516 fin3309 fins5510 gsoe9340 math2007 math2036 soee5010 mark3088 infs3605 elec9714 comp2271 ma214 comp2211 infs3604 600426 sit254 acct3091 bbt405 msin0116 com107/com113 mark5826 sit120 comp9021 eco2101 eeen40700 cs253 ece3114 ecmm447 chns3000 math377 itd102 comp9444 comp(2041|9044) econ0060 econ7230 mgt001371 ecs-323 cs6250 mgdi60012 mdia2012 comm221001 comm5000 ma1008 engl642 econ241 com333 math367 mis201 nbs-7041x meek16104 econ2003 comm1190 mbas902 comp-1027 dpst1091 comp7315 eppd1033 m06 ee3025 msci231 bb113/bbs1063 fc709 comp3425 comp9417 econ42915 cb9101 math1102e chme0017 fc307 mkt60104 5522usst litr1-uc6201.200 ee1102 cosc2803 math39512 omp9727 int2067/int5051 bsb151 mgt253 fc021 babs2202 mis2002s phya21 18-213 cege0012 mdia1002 math38032 mech5125 07 cisc102 mgx3110 cs240 11175 fin3020s eco3420 ictten622 comp9727 cpt111 de114102d mgm320h5s bafi1019 math21112 efim20036 mn-3503 fins5568 110.807 bcpm000028 info6030 bma0092 bcpm0054 math20212 ce335 cs365 cenv6141 ftec5580 math2010 ec3450 comm1170 ecmt1010 csci-ua.0480-003 econ12-200 ib3960 ectb60h3f cs247—assignment tk3163 ics3u ib3j80 comp20008 comp9334 eppd1063 acct2343 cct109 isys1055/3412 math350-real math2014 eec180 stat141b econ2101 msinm014/msing014/msing014b fit2004 comp643 bu1002 cm2030
联系我们
EMail: 99515681@qq.com
QQ: 99515681
留学生作业帮-留学生的知心伴侣!
工作时间:08:00-21:00
python代写
微信客服:codinghelp
站长地图