{"id":21450677,"url":"https://github.com/mattczyr/evacsim","last_synced_at":"2025-06-11T23:33:44.534Z","repository":{"id":52386564,"uuid":"219186100","full_name":"MattCzyr/EvacSim","owner":"MattCzyr","description":"EvacSim is a simulation that uses graph theory and linear programming to model the effects of hurricanes on populations in order to predict optimal evacuation routes.","archived":false,"fork":false,"pushed_at":"2021-05-01T20:29:47.000Z","size":8953,"stargazers_count":5,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-22T10:35:44.309Z","etag":null,"topics":["cli","graph-theory","hackathon","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MattCzyr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-11-02T17:05:32.000Z","updated_at":"2024-07-20T06:57:08.000Z","dependencies_parsed_at":"2022-09-06T03:43:03.479Z","dependency_job_id":null,"html_url":"https://github.com/MattCzyr/EvacSim","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MattCzyr%2FEvacSim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MattCzyr%2FEvacSim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MattCzyr%2FEvacSim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MattCzyr%2FEvacSim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MattCzyr","download_url":"https://codeload.github.com/MattCzyr/EvacSim/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250221595,"owners_count":21394735,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","graph-theory","hackathon","python"],"created_at":"2024-11-23T04:16:09.847Z","updated_at":"2025-04-22T10:36:08.432Z","avatar_url":"https://github.com/MattCzyr.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EvacSim\n\nEvacSim is a deterministic simulation that uses graph theory and linear\nprogramming to model the effects of natural disasters on communities in order\nto find optimal evacuation routes. This project was originally developed for\nHackRPI 2019, a 24-hour hackathon in which it won 2nd place.  The project has now\nbeen overhauled as an open-source platform, in the hopes that it will become a\nservice that can be used for the greater good.\n\n## Background\n\nThis project was originally developed for HackRPI 2019, a 24-hour hackathon in\nwhich it won 2nd place. It used Java for model translation and representation,\nAMPL to run the flow algorithm, and Node to hold the whole thing together.\nThis has since been replaced entirely by Python.\n\nThe idea for the project was born after witnessing the devastating effects of\nHurricane Dorian as well as hearing from friends and family in tropical regions\nwho were forced to evacuate their homes due to storms numerous times over the\nyears. As such, the application was initially only able to simulate hurricanes.\nThis has since been replaced by a generic natural disaster representation,\nmodeled by polygons corresponding to the disaster's area of effect at different\ntimes.\n\n## How it works\n\n### Model\n\nIn the model, populations are represented by nodes and the infrastructure\nbetween them are represented by edges. These nodes and edges can then be used\nto construct a graph. The actual modeling happens in CSV files, such as the\nfollowing `nodes.csv` file modeling populations around Troy, NY:\n\n| Enabled | Name           | Latitude | Longitude | Population | Capacity |\n| ------- | -------------- | -------- | --------- | ---------- | -------- |\n| 0       | Troy           | 42.718   | -73.687   | 50000      | 60000    |\n| 0       | Albany         | 42.649   | -73.753   | 100000     | 125000   |\n| 0       | Guilderland    | 42.702   | -73.909   | 35000      | 50000    |\n| 0       | East Greenbush | 42.588   | -73.703   | 15000      | 20000    |\n| 0       | Brunswick      | 42.732   | -73.562   | 15000      | 30000    |\n| 0       | Schenectady    | 42.806   | -73.943   | 65000      | 80000    |\n| 0       | Latham         | 42.748   | -73.761   | 20000      | 30000    |\n\nSimilar models exist for edges and natural disasters:\n- `edges.csv`: Models infrastructure (ie. roads) between populations by source\n  node, destination node, transit time, and maximum capacity.\n- `disaster.csv`: Models the natural disaster with polygons, representing its\n  area of effect at different times. Area of effect polygons can have any\n  number of sides, as long as they are ordered clockwise or counter-clockwise.\n\nExamples can be found in the [models](../models/) folder.\n\n### Simulation\n\nOnce the models have been read, an algorithm is run on each city within the\nnatural disaster's area of effect. This algorithm is similar to a minimum-cost\nflow algorithm: it aims to find an evacuation route each at-risk community can\ntake to reach a safe city in the least amount of time, without violating\nconstraints like maximum capacities on cities and infrastructure.\n\n### Results\n\nAfter running the simulation, the results can be exported to a KML file. This\nfile can be viewed in an Earth browser such as Google Earth, where the cities,\ninfrastructure, natural disaster, and evacuation routes can be explored, as\nwell as their supporting data.\n\n## Setting up\n\n1. Install Python 3 through the [installer](https://www.python.org/downloads/)\n   or through a package manager like Brew or APT depending on your OS\n2. Install the virtualenv package with `pip3 install virtualenv`\n3. Create a new virtual environment with `python3 -m virtualenv .venv`\n4. Activate the virtual environment with `source .venv/bin/activate` on\n   macOS/Linux or `.venv\\Scripts\\activate` on Windows\n5. Install the project's dependencies with `pip3 install -r requirements.txt`\n6. You can now run the application with `python3 evacsim/__init__.py`,\n   specifying arguments as necessary\n7. When you're finished, deactivate the virtual environment with `deactivate`\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattczyr%2Fevacsim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmattczyr%2Fevacsim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattczyr%2Fevacsim/lists"}