Group Exercise: Random Walk Simulation#
This is a group exercise, so you should be working in pairs of two students. The goal is to practise writing readable, maintainable, reliable, reusable and efficient code collaboratively.
This assignment is part of your final grade. Fulfilling the minimum requirements (see below) is required to pass this assignment. Implementing some of the additional requirements will give you extra points.
Organisation#
Make groups of 2 students.
Set up your repository: One student of your group forks the code from https://courses.gistools.geog.uni-heidelberg.de/advancedgeoscripting/04_random_walker. This student invites the other student as a collaborator to the forked repository, so you can both work on the code.
Work on the code to fulfil the requirements (see below).
Merge Request: Once you’re done, create a merge request into the main branch of the advancedgeoscripting/04_random-walker repo. Deadline: Fri, 9:00 am. Note: Once the merge request is opened, you can still make changes and push additional commits.
Code review: Each group reviews the code of another group on Friday.
Improve your code based on the review you got.
Improve the Random Walker program#
In this repo you find a basic implementation of a random walk simulation in 2-dimensional space taken from this blogpost. Running the code yields an image which shows the path of the random walk.
The program works but it is not very readable. Apply the best practices in scientific computing to make the code more readable, maintainable, reliable, reusable and efficient. In addition, extend the program based on the requirements listed below.
Minimum requirements:#
These requirements are mandatory to pass the assignment.
The program should be able to simulate multiple random walkers, not just one.
The program should be executable from the command line.
The user should be able to specify the number of random walkers through a command line parameter.
Write tests to see if your random walkers are working as expected.
Make sure to use the best-practices by Wilson net al 2014 for readable code style.
Document how to install and run the program in your README.md, e.g. take a look at this readme template.
Additional requirements:#
These requirements are optional.
Create three different types of walkers, e.g. a “fast walker” which has a bigger step size.
Add a “landscape” in which the random walkers are walking in which contains obstacles which the walkers cannot cross (e.g. a lake)
Invent and implement another functionality of your own.
Be creative here! :)
Code Review#
Friday morning each group will review the code of another group. The reviewing group can leave comments in the code or create issues regarding:
Is the documentation in the README.md clear?
Does it work properly? Try to make it fail and report bugs.
Leave suggestions to improve the code. Are the best-practices implemented in the code? Take a look at Wilson et al. (2014) again.
Ask questions if you don’t understand certain parts of the code.
Also give compliments for good solutions. :)