COMP1005 Assignment Puppy Simulation
1. Preamble
In practicals you have implemented and learned about simulations, object-orientation and (soon) how to automate the running of multiple simulations. In this assignment, you will be making use of this knowledge to extend a given simulation to provide more functionality, complexity and allow automation. You will then report on your design and implementation, and the results generated by the simulation.
2. The Challenge
You will be simulating the behaviour and interaction of one or more puppies/dogs. The yard the dogs live in consists of grassed area, garden, fences, gates and house. We will view it from above. Your simulation will include dogs/puppies (multiple types possible), squirrels (a major distraction), humans (various types), yard/house (sectioned by surface and accessibility), toys and food sources, and senses (sight, smell and sound). This will be plotted as a top-view of the activities. The model can be assumed flat/2-D – there may be bonus marks for 3D, but not required.
We will provide some sample code to start this assignment, and additional code showing a range of approaches to assignments from previous semesters. For the assignment, you will develop code to model the dogs using objects, and to add features to the simulation (e.g. food, toys, humans and interactions). Your task is to extend the code and then showcase your simulation, varying input parameters, to show how they impact the overall simulation.
Note: You do not have to use the supplied sample code, however, any other code that you have not written (e.g. sourced from others, online or generated etc.) will not receive marks. Lecture/practical and test materials from COMP1005/5005 are exempt, however they must be referenced.
You can do a lot of the assignment planning on paper before any coding. The Feature column of the Traceability Matrix should be filled in before coding, then used as a guide and checklist as you work through the assignment.
The assessable features for snoo.py are:
Animals: Represented as objects that “know” their position, name, colour and age and can strategise on their next activity. You should have at least Dogs/Puppies and **Squirrels **
Prompts: How will you represent the animals themselves, and differentiate between them in the simulation? How will they move and decide between movement options? Will they get hungry/thirsty/lonely/bored?
Humans: Humans will have varying relationships with the Animals. Some will be owners/friends, some strangers/intruders. Humans will bring food and may play with the
Prompts: How will you differentiate the humans? How will the dog sense the types of humans? Will there be a regularity of interaction, e.g. feed/play at certain times?
Food Sources/Toys: The main food sources for the dogs are given by humans. Your animals should have a value for energy/hunger that is increased by eating and decreases over time. Food sources should deplete as they are eaten. Toys can be played with and moved from place to place. Items may be buried, then found via smell.
Prompts: How will the animals find and respond to food sources? How will you track energy and the food source(s) being eaten? How will a toy be “carried”?
Senses: Each creature will have a way of sensing the world around them. You should have sight and smell as a starting point, then potentially add hearing.
Prompts: How will you code the “sight” of the animals? Many aspects of the simulation will have a smell, which may be in a trail that fades over time. You might do this as a parallel grid... Which senses/events will take priority?
Terrain and Obstacles: There should be at least two types of area in the terrain – back yard and house. Different animals will traverse their terrains in their own manner,although within a class they should have the same patterns. Obstacles might be fences, walls or doors/gates. These can be built in the code, however they will be better if read from a file.
Prompts: How will the animal know what terrain it is in? How will this affect their choice of movement for each time step? How will they get around obstacles?
Collisions/Interaction: How will your creatures seek out or avoid each other? They will need to detect each other and take action, with a decision being made on the outcome of any interactions.
Prompts: How will you detect a collision is imminent? What strategies will you have for the animals to avoid each other?
There are marks allocated for flexibility and usability. For example, changing terrain input file, or numbers of dogs/humans/squirrels/food can give very different simulations. You can begin with hard-coded values and filenames, but should move to prompting for values, or a better approach is to use command line arguments to control the parameters of the experiment/simulation. Configuration files can also be used.
Your code should include comments to explain what each section does and how. Apply PEP-8 and other style guides throughout - this will affect your readability score in our marking. Also beware of using while/True, break, continue and global variables – these are all discouraged in the unit – even if you see examples of their use online.
It may be useful to keep track of your progress/changes in the comments at the top of the program. Feel free to re-use the code and approaches from the lectures and practicals. However, remember to cite/self-cite your sources. If you submit work that you have already submitted for a previous assessment (in this unit or any other) you must specifically state this.
Beyond the working program, you will submit a document: the Project Report, worth 40% of the assignment marks. This is described in Section 3.1.
There will be bonus marks for additional functionality and the use of more advanced programming techniques (e.g. interactivity, high quality visualisation, 3D space, parameter sweep etc.) but only if they are sensible and done well. Make sure to discuss the additional work in your Report, this will be easy if you make notes and keep old (incremental) versions of your code.
3. Submission
Submit electronically via Blackboard. You can submit multiple times – we will only mark the last attempt. This can save you from disasters! Take care not to submit your last version late though. Read the submission instructions very carefully.
You should submit a single file, which should be zipped (.zip
). Check that you can decompress it successfully. The submission file must be named FOP_Assignment_<id>
where the <id>
is replaced by your student id. There should be no spaces in the file name; use underscores as shown.
The file must contain the following:
- Code – snoo.py and supporting files, i.e. all files needed to run your program, including input files.
- README file including short descriptions of all files and dependencies, and information on how to run the program.
- Report for your code, as described in Section 3.1.
- Cover Sheet - signed and dated. These are available on Blackboard. You can sign a hard copy and scan it in or you can fill in a soft copy and digitally sign it.
- You will also need to submit the Report to TurnItIn.
Make sure that your zip file contains what is required. Anything not included in your zip submission will not be marked. It is your responsibility to make sure that your submission is complete and correct – submitted to the main assignment link as a single zip file.
3.1 Project Report
You need to submit your Report in Word doc or pdf format. You will need to describe how you approached the implementation of the simulation, and explain to users how to run the program. You will then showcase the application(s) you have developed, and use them to explore the simulation outputs. This exploration would include changing parameters, simulation time and perhaps comparing outcomes if you switch various features on/off.
THE REPORT MUST BE SUBMITTED THROUGH TURNITIN AND IN THE ZIP FILE
Your Project Report will be around 10 pages and should include the following:
- Overview (2 marks) describe your program's purpose and implemented features.
- User Guide (2 marks) how to use your simulation (and parameter sweep code, if applicable)
- Traceability Matrix (10 marks) of features, implementation and testing of your code.The matrix should be a table with columns for:
- Feature - numbered for easy referencing
- Code reference(s) – reference to files/classes/methods or snippets of code only, do not put the whole program in the report
- Test reference(s) – test code or describe how you tested your feature was correctly implemented
- Completion date - N/A if not implemented
- Discussion (10 marks) of implemented features (referring to the Traceability Matrix), explaining how they work and how you implemented them. A UML Class Diagram should be included for objects and their relationships.
公众号:AI悦创【二维码】
AI悦创·编程一对一
AI悦创·推出辅导班啦,包括「Python 语言辅导班、C++ 辅导班、java 辅导班、算法/数据结构辅导班、少儿编程、pygame 游戏开发、Web、Linux」,全部都是一对一教学:一对一辅导 + 一对一答疑 + 布置作业 + 项目实践等。当然,还有线下线上摄影课程、Photoshop、Premiere 一对一教学、QQ、微信在线,随时响应!微信:Jiabcdefh
C++ 信息奥赛题解,长期更新!长期招收一对一中小学信息奥赛集训,莆田、厦门地区有机会线下上门,其他地区线上。微信:Jiabcdefh
方法一:QQ
方法二:微信:Jiabcdefh
- 0
- 0
- 0
- 0
- 0
- 0