Agent based model for drunks leaving a pub attempting to find their way home.
This program reads in a txt file of a pub and 25 homes. It maps this onto a figure and creates drunks which move randomly around the figure until they find their way home. Once they find their way homne the drunks stop moving. The program also produces a figure of the density of the drunks passing through each point on the map. The program finishes when all of the drunks are at home.
Submission Contents:
- drunks.py -> The main code
- agentframeworkdrunks.py -> agent framework for drunks.py
- drunks.txt -> input text file for pub and home locations
- DocumentationPFSS.docx -> documentation explaining development, sources, issues, and limitations
- test_move_function.py -> presentation of testing of move function
- densitymap.csv -> this is the csv file the program will produce
Instructions to run the code:
- The code was produced in python 3.9 using Spyder as part of Ananconda.
- Copy the agentframeworkdrunks.py, in.txt and drunks.py into Spyder or editing softerware of choice. Saving the drunks.txt in the same directionary.
- Before running the code "%matplot qt" is required to be entered for animations to run.
- Run the drunks.py file.
- The program will prompt for the choice between 1: Running Model or 2: Finished Model.
- Enter choice.
- Program will run desired choice
- A csv file of the density file will be produced