The writeup for the assignment from which this assignment is based can be found at https://howtostartacsdept.wordpress.com/2018/01/13/step-86-write-up-the-ethical-engine-lab/. Thanks to Justin Li for this version of the lab, and to Evan Peck for the original lab (on which Justin's code is based).
- source : the source code for the assignment
- labs : the lab writeups to assign in class
This lab could be done as a single in-class lab, with the remainder of the lab completed outside of class. I found, though, that students had a lot of questions about how to implement their algorithms/work with existing source code. So, ideally, this is a lab best done over 1.5 or 2 class periods. In the labs directory, I split the writeup into two pieces if you do end up splitting the lab over multiple class periods, and I also retained the writeup as a whole.
I recommend spending a bit of time at the beginning of the first session giving them a quick tour through the Person and Scenario classes, in scenario.py. This will help orient them to the code and save a bit of unproductive wheel-spinning.
It is really important that you have the students sketch out their algorithms on paper before letting them loose on the coding part. This gets them to slow down and reflect on what decisions they will encode explicitly, and why. In some cases, this gets them to reflect back on what they were doing in the manual decision-making part of the lab, because they weren't doing this during the manual decision-making part of the lab.
I've included an example implementation of automatic_decision() in sample.py. Students are often overwhelmed when moving from algorithm to implementation, and I've found having a sample they can use as a starting point helps them get unstuck. Feel free to replace this with your own sample, or use as-is.
You will need to create the zip file of all of the Python files in source/ and distribute this to students in part 1 of the lab.