Assignment 1b-First Home PDF

Title Assignment 1b-First Home
Author Anonymous Yikes
Course Building IT Systems
Institution Queensland University of Technology
Pages 7
File Size 650.9 KB
File Type PDF
Total Downloads 44
Total Views 161

Summary

Download Assignment 1b-First Home PDF


Description

IFB104 Building IT Systems Semester 2, 2020

Assignment 1, Part B: “First Home” (5%, due 11:59pm Sunday, September 6th, end of Week 7) Overview This is the second part of a two-part assignment. This part is worth 5% of your final grade for IFB104. Part A which preceded it was worth 20%. This part is intended as a last-minute extension to the assignment, thereby testing the maintainability of your code from Part A and your ability to work under time presssure. If you have a neat, clear solution to Part A you will find completing Part B easy. For the whole assignment you will submit only one file, containing your combined solution to both Parts A and B, and you will receive one grade for the whole 25% assignment.

Motivation One of the most common tasks in “Building IT Systems” is modifying some existing code. In practice, computer programs are written only once but they are subsequently modified and extended many times during their operational lifetime. Code changes may be required in response to internal factors, such as the need to correct design flaws or coding errors, or external factors, such as changes in consumer requirements. A common situation is where some new feature must be added to an existing program. This is the scenario simulated in this part of the assignment. This task requires you to modify your solution to Part A of the assignment by adding a new capability. It tests: •

Your ability to work under time pressure; and



The quality and clarity of your code for Part A, because a well-written solution to Part A will make completing this part of the assignment easy.

Goal In Part A of this assignment you developed a program which displays visually the result of a simulated competition between multiple agents seeking to occupy a fixed territory, represented as a rectangular grid. In such situations there are often specific locations in the territory whose capture is of strategic value. Here we will assume that the middle cell of the grid, which contains the “home” coordinate [0, 0], is of special significance. To complete Part B of the assignment you must identify which of the competitors reaches this cell first, if any, and display this information on the drawing canvas.

Illustrative example Recall that to explain Part A we developed a solution with four competitors, representing the competition for space between the natural and built environments. Here we extend our solution so that it displays whichever competitor reaches the “home” cell first, if any. For many randomly-generated data sets the simulation results in no competitor reaching the centre cell, in which case we display a simple message to explain this. For example, consider the following short list of 12 moves generated in 3 rounds.

2020-08-05

1

IFB104 Building IT Systems Semester 2, 2020

In this case none of the competitors reaches the centre cell, so we indicate this with a simple message written to the right of the grid.

In longer data sets there is the possibility of one of the competitors reaching the centre cell. Consider the following case of 36 moves in 9 rounds.

In this case Competitor A makes a beeline for the centre cell (apart from a couple of disallowed upwards moves) and occupies it first. No other competitor reaches the home cell during the simulation. We therefore identify A as the first (and only) competitor to reach the centre as shown overleaf. Note that we draw Competitor A’s image in the reserved space, as a clear visual indicator of the first competitor to occupy this strategic location.

2020-08-05

2

IFB104 Building IT Systems Semester 2, 2020

In longer simulations there is the possibility that more than one competitor occupies the centre cell. In this situation we still display the first competitor to do so. Consider the following data set with 64 moves in 16 rounds.

In this case three different competitors occupy the home position at different stages of the simulation.1 The first to do so is Competitor C, but the home cell is later taken over by Competitor B and finally by Competitor A. Nonetheless, C reached “home” first, so we give the accolades to this competitor, as shown overleaf.

1

We haven’t yet encountered a data set that results in all four competitors reaching home. Can you find one?

2020-08-05

3

IFB104 Building IT Systems Semester 2, 2020

Your task in Part B is thus to extend your solution to Part A to produce an equivalent visual representation of the outcome of the race to reach the home cell.

Resources provided It’s relatively rare for the simulations generated by function random_moves to produce sequences of moves that result in a competitor occupying the “home” cell. This can be frustrating when testing this feature of your solution. Therefore, to help you debug your code, you can provide one of the following seed values as the argument to function random_moves while working on Part B. (Keep in mind, however, that your overall solution must work correctly when random_moves is called without any arguments.) • • • •

random_moves(21) - Only Competitor A reaches home random_moves(26) - Only Competitor B reaches home random_moves(24) - Only Competitor C reaches home random_moves(35) - Only Competitor D reaches home

• • • •

random_moves(52) - Only Competitor A reaches home random_moves(51) - Only Competitor B reaches home random_moves(47) - Only Competitor C reaches home random_moves(46) - Only Competitor D reaches home

• • • •

random_moves(53) - Competitor A reaches home first, followed by D random_moves(62) - Competitor B reaches home first, followed by D random_moves(81) - Competitor C reaches home first, followed by A random_moves(48) - Competitor D reaches home first, followed by A

• •

random_moves(54) - Competitor D reaches home first, followed by C and then A random_moves(98) - Competitor D reaches home first, followed by A and then B

2020-08-05

4

IFB104 Building IT Systems Semester 2, 2020 Requirements and marking guide To complete this part of the assignment you are required to extend your land_grab.py Python file so that it displays the first competitor to reach the centre cell, as explained above. Your extended solution must satisfy the following criteria. Percentage marks available are as shown. 1. Correctly identifying the first competitor to reach home (3%). Your program must correctly identify which competitor occupies the “home” cell first, if any, and must inform the user of the outcome. If no competitor reaches the home cell then this must be stated as well. If more than one competitor occupies the home cell during the simulation then only the first to do so should be identified. 2. Visually displaying the result (2%). Your program must explain the outcome on the drawing canvas (not in the shell window) in a clear and neat form. The competitor who reaches the home cell first must be drawn in the space indicated to the right of the grid, and the template instruction reserving this space should either be switched off or obscured. You must complete this part of the assignment using basic Turtle graphics, random number and maths functions only. You may not import any additional modules or files into your program other than those already included in the given land_grab.py template. In particular, you may not import any image files for use in creating your drawings.

Development hints •

It should be possible to complete this task merely by adding code to your existing solution, with little or no change to the code you have already completed.



If you are unable to complete the whole task, just submit whatever parts you can get working. You will receive partial marks for incomplete solutions. However, comment out non-working code so that your program will run when the marker tests it.

Portability An important aspect of software development is to ensure that your solution will work correctly on all computing platforms (or at least as many as possible). For this reason you must complete the assignment using standard Turtle graphics, random number and maths functions only. You may not import any additional modules or files into your program other than those already imported by the given template file. In particular, you may not import any image files to help create your drawings or use non-standard image processing modules such as Pillow.

Security warning and plagiarism notice This is an individual assessment item. All files submitted will be subjected to software plagiarism analysis using the MoSS system (http://theory.stanford.edu/~aiken/moss/). Serious violations of the university’s policies regarding plagiarism will be forwarded to the Science and Engineering Faculty’s Academic Misconduct Committee for formal prosecution. As per QUT rules, you are not permitted to copy or share solutions to individual assessment items. In serious plagiarism cases SEF’s Academic Misconduct Committee prosecutes both the copier and the original author equally. It is your responsibility to keep your solution se-

2020-08-05

5

IFB104 Building IT Systems Semester 2, 2020 cure. In particular, you must not make your solution visible online via cloud-based code development platforms such as GitHub. Note that free accounts for such platforms are usually public and are thus unsafe. If you wish to use such a resource, do so only if you are certain you have a private repository that cannot be seen by anyone else. For instance, university students can apply for a free private repository in GitHub to keep their assignments secure (https://education.github.com/pack). However, we recommend that the best way to avoid being prosecuted for plagiarism is to keep your work well away from both the Internet and your fellow students! Remember, when your best friend asks to “just have a look” at your assignment, it means they intend to submit your code with their name on it, landing you both in hot water!

Deliverable You must develop your solution by completing and submitting the provided Python 3 file land_grab.py as follows. 1. Complete the “statement” at the beginning of the Python file to confirm that this is your own individual work by inserting your name and student number in the places indicated. We will assume that submissions without a completed statement are not your own work! 2. Complete your solution by developing Python code to replace the dummy process_moves function. You must complete your solution using only the standard Python 3 modules already imported by the provided template. In particular, you must not use any Python modules that must be downloaded and installed separately because the markers will not have access to these modules. Furthermore, you may not import any image files into your solution; the entire game must be drawn using Turtle graphics drawing primitives only, as we did in our sample solution. 3. Submit a single Python file containing your solution for marking. Do not submit multiple files. Only a single file will be accepted, so you cannot accompany your solution with other code files or pre-defined images. Do not submit any other files! Submit only a single Python 3 file! Apart from working correctly your program code must be well-presented and easy to understand, thanks to (sparse) commenting that explains the purpose of significant code segments and helpful choices of variable, parameter and function names. Professional presentation of your code will be taken into account when marking this assignment. If you are unable to solve the whole problem, submit whatever parts you can get working. You will receive partial marks for incomplete solutions.

How to submit your solution A link is available on the IFB104 Blackboard site under Assessment for uploading your solution file before the deadline (11:59pm Sunday, September 6th, end of Week 7). You can submit as many drafts of your solution as you like. You are strongly encouraged to submit draft solutions before the deadline as insurance against computer or network problems near the deadline. If you are unsure whether or not you have successfully uploaded your file, upload it again! Students who encounter problems uploading their Python files to Blackboard should contact HiQ’s Technology Services (http://qut.to/ithelp; [email protected]; 3138 2000) for assis2020-08-05

6

IFB104 Building IT Systems Semester 2, 2020 tance and advice. Teaching staff will not be available to answer email queries on the evening the assignment is due, and Technology Services offers limited support outside of business hours, so ensure that you have successfully uploaded at least one draft solution by close-ofbusiness on Friday, September 4th.

2020-08-05

7...


Similar Free PDFs