The infection specifications were implemented using Python, SQLAlchemy and SQlite.
The infection.py module contains all the infection methods. The tests.py module contains all the tests
To use:
- install SQLAlchemy: in the command line type "pip install SQLAlchemy==0.9.7"
- in the main directory, open a python intepreter: in the command line type "python"
- type: from infection import *
- add users with the command: a = add_user("A") where a, and "A" can be any variable. Note that only one student can have each unique name
- add coaching relationships: add_coaching(a, b) where a is the coach and b is the student, and both are variables created by add_user method.
- test total_infection and limited_infection, inputing the object of the student, not the name (i.e a not "A")
- to see who was infected: infection_report()
- to uninfect all students: reset_infection()
**To run the tests, type the following in the python interpreter: 1. from tests import * 2. run_tests()
**If you import the test module, you can do additional tests on the set of users specified in it.
**Additional modifications infect_n() : First, look for a connected component of size n. If it finds it, it infects it. Otherwise, it does nothing.