├── .gitignore ├── ABMHAP.pdf ├── LICENSE ├── README.md ├── data ├── chad.zip └── demography │ ├── adult_non_work.zip │ ├── adult_work.zip │ ├── child_school.zip │ └── child_young.zip ├── docs ├── ICC.rst ├── Makefile ├── _build │ ├── doctrees │ │ ├── activity.doctree │ │ ├── asset.doctree │ │ ├── bed.doctree │ │ ├── bio.doctree │ │ ├── commute.doctree │ │ ├── diary.doctree │ │ ├── eat.doctree │ │ ├── environment.pickle │ │ ├── food.doctree │ │ ├── home.doctree │ │ ├── hunger.doctree │ │ ├── income.doctree │ │ ├── index.doctree │ │ ├── interrupt.doctree │ │ ├── interruption.doctree │ │ ├── location.doctree │ │ ├── main.doctree │ │ ├── main_params.doctree │ │ ├── meal.doctree │ │ ├── my_globals.doctree │ │ ├── need.doctree │ │ ├── occupation.doctree │ │ ├── params.doctree │ │ ├── person.doctree │ │ ├── rest.doctree │ │ ├── scenario.doctree │ │ ├── scheduler.doctree │ │ ├── singleton.doctree │ │ ├── sleep.doctree │ │ ├── social.doctree │ │ ├── state.doctree │ │ ├── temporal.doctree │ │ ├── transport.doctree │ │ ├── travel.doctree │ │ ├── universe.doctree │ │ ├── work.doctree │ │ └── workplace.doctree │ ├── html │ │ ├── .buildinfo │ │ ├── _images │ │ │ └── math │ │ │ │ ├── 062063d200322f8e2675a1cc1e22e5ed532c8aad.png │ │ │ │ ├── 08bf8567834fd2397475c5628d3e7eb88523bcf8.png │ │ │ │ ├── 0b85dd41c4dfd2c85100308239c20882d9898fd3.png │ │ │ │ ├── 1886d713167ab3a994339cd4b64bcf0dc2d16662.png │ │ │ │ ├── 1dbc400fcc213305415872f9f625cd2828f97a00.png │ │ │ │ ├── 27bbef923171b5229fcf4f1bf9a0abacfb6ff482.png │ │ │ │ ├── 2a206aa293a38ca1db8e3b487b6c77ef7449039a.png │ │ │ │ ├── 2d0f65c82a01290576d5291bbb9f7d2ab6d21830.png │ │ │ │ ├── 3652e39c4e916aa4e24f357337027aececeb67fa.png │ │ │ │ ├── 3b12fdb86124019416eb90fc648db0723364dd46.png │ │ │ │ ├── 4ffa672cac9857b30b7238947cf95b020a72482a.png │ │ │ │ ├── 509e79c93f908403603c9e7b095e3f939b9ff433.png │ │ │ │ ├── 520e7065eb16d50dae8591f6454515205aa73c59.png │ │ │ │ ├── 5d097f7e45f0d4e6be4379f5b0ebca32f9c2d812.png │ │ │ │ ├── 5ec053cf70dc1c98cc297322250569eda193e7a4.png │ │ │ │ ├── 5f6b3e00ee8c7e64da9ad043757824572643b919.png │ │ │ │ ├── 5fcf4ce47ced9fa8d407eab80eec935b27818322.png │ │ │ │ ├── 62f34fae2b08036cedb90a3ebf47f74a61dcb1be.png │ │ │ │ ├── 708e1d8b6fd15b731aab0d5d72a65bbe4ab7359f.png │ │ │ │ ├── 7464b0c40e921b31b17472a2aabb4901b8e792fb.png │ │ │ │ ├── 76f1d8ace30435987c01a00ca53a71cba1f40e6c.png │ │ │ │ ├── 7731a6aaf909a43f94bd45f4ab36b6ef3d8c279c.png │ │ │ │ ├── 77bb581fe2e70bd98021463f3adb5dac81cf0f99.png │ │ │ │ ├── 8497490f615a60b2ee5c703ae8cca26f262fdf3e.png │ │ │ │ ├── 8c70fac0370544214e0b9e4e1ad21aaa1d8f22fb.png │ │ │ │ ├── 8d1e564b3a99700f3a8fe66041c33fc49f32af97.png │ │ │ │ ├── 98d7b283184b1e6854c14d4aa31b3dd45cce9039.png │ │ │ │ ├── a68b3a90801d7d52f27bf71d59a1d16a957304c2.png │ │ │ │ ├── a702e781dfc76762a3a132c2031fba8898430925.png │ │ │ │ ├── a7fab7f8a2758d2cb887e67af0da614cb6ec9486.png │ │ │ │ ├── a80ed95c02dc29fa8c23bacb690346773cdcaf35.png │ │ │ │ ├── ab84bbd3ef336a7f531380083cd9b5141ca98f59.png │ │ │ │ ├── addf07033f70a6721ab535c887ae2119106683fc.png │ │ │ │ ├── b3d35ceb5a9142c3b1ab9e61ea2ca79bf8aa8d96.png │ │ │ │ ├── b6db61e6244639bf22cc372a5bdead9695d8e288.png │ │ │ │ ├── c3e77541d047e420895b1683e06f8c2834f5d473.png │ │ │ │ ├── c99b9f4a9a1351540eadc537eb954b6e63f6df8c.png │ │ │ │ ├── c9cd2a9b30fb9740d391e4c20fcb38c8c27d7940.png │ │ │ │ ├── cc9cdf88bf192111300cf12e9845db5e98cb1624.png │ │ │ │ ├── cd30e0b91d2b53728ae09ccac9d857b79b3adfcb.png │ │ │ │ ├── d0c00b8daa835b34d5295761ff33cb7dcc84a5fe.png │ │ │ │ ├── d4de02b91bf45f9cea101c2103fd07a5e89c698e.png │ │ │ │ ├── d67c7e65a9aea9b01317b930b90bf11cfb6e8e83.png │ │ │ │ ├── d6eeed49f840eb9639b2810c61da18bc8c74f738.png │ │ │ │ ├── dcd93bb563359ce4401a98fb5276d8357896143c.png │ │ │ │ ├── e0303ed6987b432bfc52983272bc5ae803864271.png │ │ │ │ ├── e4577c41d8cf21bf71438517a57f5850538dfb71.png │ │ │ │ ├── e64d16745a41911c9f4d9aa62e83024b927be253.png │ │ │ │ ├── e8c2d0b75923cec7bf269bda3f93fbe4f61aafb1.png │ │ │ │ ├── e8e55ed1bc59f02fc947b85f9d29860954442a12.png │ │ │ │ ├── ebcff0c0c0a44884016856fdf5337e1283c98d5a.png │ │ │ │ ├── f2d5283d4fd453f45911280a6aa312f72a1e1158.png │ │ │ │ └── f8b85c7725f713a6cc965f0ea2c1752fff180985.png │ │ ├── _modules │ │ │ ├── activity.html │ │ │ ├── analysis.html │ │ │ ├── analyzer.html │ │ │ ├── asset.html │ │ │ ├── bed.html │ │ │ ├── bio.html │ │ │ ├── chad.html │ │ │ ├── chad_demography.html │ │ │ ├── chad_demography_adult_non_work.html │ │ │ ├── chad_demography_adult_work.html │ │ │ ├── chad_demography_child_school.html │ │ │ ├── chad_demography_child_young.html │ │ │ ├── chad_params.html │ │ │ ├── commute.html │ │ │ ├── commute_from_work_trial.html │ │ │ ├── commute_to_work_trial.html │ │ │ ├── datum.html │ │ │ ├── demography.html │ │ │ ├── diary.html │ │ │ ├── driver.html │ │ │ ├── driver_result.html │ │ │ ├── eat.html │ │ │ ├── eat_breakfast_trial.html │ │ │ ├── eat_dinner_trial.html │ │ │ ├── eat_lunch_trial.html │ │ │ ├── evaluation.html │ │ │ ├── fig_driver.html │ │ │ ├── food.html │ │ │ ├── home.html │ │ │ ├── hunger.html │ │ │ ├── income.html │ │ │ ├── index.html │ │ │ ├── interrupt.html │ │ │ ├── interruption.html │ │ │ ├── location.html │ │ │ ├── main.html │ │ │ ├── main_params.html │ │ │ ├── meal.html │ │ │ ├── my_globals.html │ │ │ ├── need.html │ │ │ ├── occupation.html │ │ │ ├── omni_trial.html │ │ │ ├── params.html │ │ │ ├── person.html │ │ │ ├── plotter.html │ │ │ ├── rest.html │ │ │ ├── scenario.html │ │ │ ├── scheduler.html │ │ │ ├── singleton.html │ │ │ ├── sleep.html │ │ │ ├── sleep_trial.html │ │ │ ├── social.html │ │ │ ├── state.html │ │ │ ├── temporal.html │ │ │ ├── transport.html │ │ │ ├── travel.html │ │ │ ├── trial.html │ │ │ ├── universe.html │ │ │ ├── variation.html │ │ │ ├── work.html │ │ │ ├── work_trial.html │ │ │ └── workplace.html │ │ ├── _sources │ │ │ ├── ICC.rst.txt │ │ │ ├── activity.rst.txt │ │ │ ├── analysis.rst.txt │ │ │ ├── analyzer.rst.txt │ │ │ ├── asset.rst.txt │ │ │ ├── bed.rst.txt │ │ │ ├── bio.rst.txt │ │ │ ├── chad.rst.txt │ │ │ ├── chad_code.rst.txt │ │ │ ├── chad_demography.rst.txt │ │ │ ├── chad_demography_adult_non_work.rst.txt │ │ │ ├── chad_demography_adult_work.rst.txt │ │ │ ├── chad_demography_child_school.rst.txt │ │ │ ├── chad_demography_child_young.rst.txt │ │ │ ├── chad_parameter_figures.rst.txt │ │ │ ├── chad_params.rst.txt │ │ │ ├── commute.rst.txt │ │ │ ├── commute_from_work_trial.rst.txt │ │ │ ├── commute_school.rst.txt │ │ │ ├── commute_to_work_trial.rst.txt │ │ │ ├── commute_work.rst.txt │ │ │ ├── config.rst.txt │ │ │ ├── count_records.rst.txt │ │ │ ├── data_counter.rst.txt │ │ │ ├── datum.rst.txt │ │ │ ├── demographics.rst.txt │ │ │ ├── demography.rst.txt │ │ │ ├── diary.rst.txt │ │ │ ├── driver.rst.txt │ │ │ ├── driver_params.rst.txt │ │ │ ├── driver_result.rst.txt │ │ │ ├── eat.rst.txt │ │ │ ├── eat_breakfast_trial.rst.txt │ │ │ ├── eat_dinner_trial.rst.txt │ │ │ ├── eat_lunch_trial.rst.txt │ │ │ ├── eat_new.rst.txt │ │ │ ├── evaluation.rst.txt │ │ │ ├── fig_driver.rst.txt │ │ │ ├── figure_loader.rst.txt │ │ │ ├── figure_loader_with_without_variation.rst.txt │ │ │ ├── figure_residuals.rst.txt │ │ │ ├── food.rst.txt │ │ │ ├── full_save.rst.txt │ │ │ ├── home.rst.txt │ │ │ ├── hunger.rst.txt │ │ │ ├── icf.rst.txt │ │ │ ├── income.rst.txt │ │ │ ├── index.rst.txt │ │ │ ├── interrupt.rst.txt │ │ │ ├── interruption.rst.txt │ │ │ ├── location.rst.txt │ │ │ ├── longitude_plot.rst.txt │ │ │ ├── main.rst.txt │ │ │ ├── main_params.rst.txt │ │ │ ├── meal.rst.txt │ │ │ ├── my_debug.rst.txt │ │ │ ├── my_globals.rst.txt │ │ │ ├── need.rst.txt │ │ │ ├── occupation.rst.txt │ │ │ ├── omni_trial.rst.txt │ │ │ ├── output.rst.txt │ │ │ ├── params.rst.txt │ │ │ ├── person.rst.txt │ │ │ ├── plot_cv_distribution.rst.txt │ │ │ ├── plot_diary.rst.txt │ │ │ ├── plot_graphs.rst.txt │ │ │ ├── plotter.rst.txt │ │ │ ├── rest.rst.txt │ │ │ ├── scenario.rst.txt │ │ │ ├── scheduler.rst.txt │ │ │ ├── school_new.rst.txt │ │ │ ├── see_cv.rst.txt │ │ │ ├── singleton.rst.txt │ │ │ ├── sleep.rst.txt │ │ │ ├── sleep_new.rst.txt │ │ │ ├── sleep_trial.rst.txt │ │ │ ├── social.rst.txt │ │ │ ├── state.rst.txt │ │ │ ├── temporal.rst.txt │ │ │ ├── transport.rst.txt │ │ │ ├── travel.rst.txt │ │ │ ├── trial.rst.txt │ │ │ ├── universe.rst.txt │ │ │ ├── variation.rst.txt │ │ │ ├── variation_notebook.rst.txt │ │ │ ├── view_distributions.rst.txt │ │ │ ├── work.rst.txt │ │ │ ├── work_new.rst.txt │ │ │ ├── work_trial.rst.txt │ │ │ └── workplace.rst.txt │ │ ├── _static │ │ │ ├── ajax-loader.gif │ │ │ ├── alabaster.css │ │ │ ├── alabaster.css_t.c~ │ │ │ ├── basic.css │ │ │ ├── comment-bright.png │ │ │ ├── comment-close.png │ │ │ ├── comment.png │ │ │ ├── custom.css │ │ │ ├── doctools.js │ │ │ ├── documentation_options.js │ │ │ ├── down-pressed.png │ │ │ ├── down.png │ │ │ ├── epa_logo_black_sm.png │ │ │ ├── file.png │ │ │ ├── jquery-1.11.1.js │ │ │ ├── jquery-3.2.1.js │ │ │ ├── jquery.js │ │ │ ├── minus.png │ │ │ ├── plus.png │ │ │ ├── pygments.css │ │ │ ├── searchtools.js │ │ │ ├── underscore-1.3.1.js │ │ │ ├── underscore.js │ │ │ ├── up-pressed.png │ │ │ ├── up.png │ │ │ └── websupport.js │ │ ├── activity.html │ │ ├── analysis.html │ │ ├── analyzer.html │ │ ├── asset.html │ │ ├── bed.html │ │ ├── bio.html │ │ ├── chad.html │ │ ├── chad_code.html │ │ ├── chad_demography.html │ │ ├── chad_demography_adult_non_work.html │ │ ├── chad_demography_adult_work.html │ │ ├── chad_demography_child_school.html │ │ ├── chad_demography_child_young.html │ │ ├── chad_parameter_figures.html │ │ ├── chad_params.html │ │ ├── commute.html │ │ ├── commute_from_work_trial.html │ │ ├── commute_school.html │ │ ├── commute_to_work_trial.html │ │ ├── commute_work.html │ │ ├── config.html │ │ ├── count_records.html │ │ ├── data_counter.html │ │ ├── datum.html │ │ ├── demographics.html │ │ ├── demography.html │ │ ├── diary.html │ │ ├── driver.html │ │ ├── driver_params.html │ │ ├── driver_result.html │ │ ├── eat.html │ │ ├── eat_breakfast_trial.html │ │ ├── eat_dinner_trial.html │ │ ├── eat_lunch_trial.html │ │ ├── eat_new.html │ │ ├── evaluation.html │ │ ├── fig_driver.html │ │ ├── figure_loader.html │ │ ├── figure_loader_with_without_variation.html │ │ ├── figure_residuals.html │ │ ├── food.html │ │ ├── full_save.html │ │ ├── genindex.html │ │ ├── home.html │ │ ├── hunger.html │ │ ├── income.html │ │ ├── index.html │ │ ├── interrupt.html │ │ ├── interruption.html │ │ ├── location.html │ │ ├── longitude_plot.html │ │ ├── main.html │ │ ├── main_params.html │ │ ├── meal.html │ │ ├── my_debug.html │ │ ├── my_globals.html │ │ ├── need.html │ │ ├── objects.inv │ │ ├── occupation.html │ │ ├── omni_trial.html │ │ ├── params.html │ │ ├── person.html │ │ ├── plot_diary.html │ │ ├── plot_graphs.html │ │ ├── plotter.html │ │ ├── py-modindex.html │ │ ├── rest.html │ │ ├── scenario.html │ │ ├── scheduler.html │ │ ├── school_new.html │ │ ├── search.html │ │ ├── searchindex.js │ │ ├── see_cv.html │ │ ├── singleton.html │ │ ├── sleep.html │ │ ├── sleep_new.html │ │ ├── sleep_trial.html │ │ ├── social.html │ │ ├── state.html │ │ ├── temporal.html │ │ ├── transport.html │ │ ├── travel.html │ │ ├── trial.html │ │ ├── universe.html │ │ ├── variation.html │ │ ├── work.html │ │ ├── work_new.html │ │ ├── work_trial.html │ │ └── workplace.html │ └── latex │ │ ├── ABMHAP.aux │ │ ├── ABMHAP.idx │ │ ├── ABMHAP.out │ │ ├── ABMHAP.pdf │ │ ├── ABMHAP.tex │ │ ├── ABMHAP.toc │ │ ├── Makefile │ │ ├── fncychap.sty │ │ ├── python.ist │ │ ├── sphinx.sty │ │ ├── sphinxhowto.cls │ │ ├── sphinxmanual.cls │ │ └── tabulary.sty ├── activity.rst ├── analysis.rst ├── analyzer.rst ├── asset.rst ├── bed.rst ├── bio.rst ├── chad.rst ├── chad_code.rst ├── chad_demography.rst ├── chad_demography_adult_non_work.rst ├── chad_demography_adult_work.rst ├── chad_demography_child_school.rst ├── chad_demography_child_young.rst ├── chad_parameter_figures.rst ├── chad_params.rst ├── commute.rst ├── commute_from_work_trial.rst ├── commute_school.rst ├── commute_to_work_trial.rst ├── commute_work.rst ├── conf.py ├── config.rst ├── count_records.rst ├── data_counter.rst ├── datum.rst ├── demographics.rst ├── demography.rst ├── diary.rst ├── driver.rst ├── driver_params.rst ├── driver_result.rst ├── eat.rst ├── eat_breakfast_trial.rst ├── eat_dinner_trial.rst ├── eat_lunch_trial.rst ├── eat_new.rst ├── evaluation.rst ├── fig_driver.rst ├── figure_loader.rst ├── figure_loader_with_without_variation.rst ├── figure_residuals.rst ├── food.rst ├── full_save.rst ├── home.rst ├── hunger.rst ├── icf.rst ├── income.rst ├── index.rst ├── interrupt.rst ├── interruption.rst ├── location.rst ├── longitude_plot.rst ├── main.rst ├── main_params.rst ├── make.bat ├── meal.rst ├── my_debug.rst ├── my_globals.rst ├── need.rst ├── occupation.rst ├── omni_trial.rst ├── output.rst ├── params.rst ├── person.rst ├── plot_cv_distribution.rst ├── plot_diary.rst ├── plot_graphs.rst ├── plotter.rst ├── rest.rst ├── scenario.rst ├── scheduler.rst ├── school_new.rst ├── see_cv.rst ├── singleton.rst ├── sleep.rst ├── sleep_new.rst ├── sleep_trial.rst ├── social.rst ├── state.rst ├── temporal.rst ├── transport.rst ├── travel.rst ├── trial.rst ├── universe.rst ├── variation.rst ├── variation_notebook.rst ├── view_distributions.rst ├── work.rst ├── work_new.rst ├── work_trial.rst └── workplace.rst ├── my_data └── example_output.csv ├── plotting ├── plot_diary.ipynb └── plotter.py ├── processing ├── commute_school.ipynb ├── commute_work.ipynb ├── count_records.ipynb ├── datum.py ├── demographics.ipynb ├── demography.py ├── eat_new.ipynb ├── plot_cv_distribution.ipynb ├── school_new.ipynb └── sleep_new.ipynb ├── run ├── main.py ├── main_params.py ├── scenario.py └── singleton.py ├── run_chad ├── analysis.py ├── analyzer.py ├── chad_demography.py ├── chad_demography_adult_non_work.py ├── chad_demography_adult_work.py ├── chad_demography_child_school.py ├── chad_demography_child_young.py ├── chad_parameter_figures.ipynb ├── chad_params.py ├── commute_from_work_trial.py ├── commute_to_work_trial.py ├── data_counter.ipynb ├── driver.py ├── driver_params.py ├── driver_result.py ├── eat_breakfast_trial.py ├── eat_dinner_trial.py ├── eat_lunch_trial.py ├── evaluation.py ├── fig_driver.py ├── figure_loader.ipynb ├── figure_loader_with_without_variation.ipynb ├── figure_residuals.ipynb ├── longitude_plot.ipynb ├── omni_trial.py ├── plot_graphs.ipynb ├── sleep_trial.py ├── trial.py ├── variation.py └── work_trial.py └── source ├── activity.py ├── asset.py ├── bed.py ├── bio.py ├── chad.py ├── chad_code.py ├── commute.py ├── config.py ├── diary.py ├── eat.py ├── food.py ├── home.py ├── hunger.py ├── income.py ├── interrupt.py ├── interruption.py ├── location.py ├── meal.py ├── my_globals.py ├── need.py ├── occupation.py ├── params.py ├── person.py ├── rest.py ├── scheduler.py ├── sleep.py ├── social.py ├── state.py ├── temporal.py ├── transport.py ├── travel.py ├── universe.py ├── work.py └── workplace.py /.gitignore: -------------------------------------------------------------------------------- 1 | # custom 2 | *ipynb_checkpoints 3 | .idea/* 4 | *Rhistory 5 | *Thumbs.db 6 | *.idea 7 | docs/_build/latex/ 8 | docs/_build/doctrees/ 9 | 10 | 11 | # Byte-compiled / optimized / DLL files 12 | __pycache__/ 13 | *.py[cod] 14 | 15 | # C extensions 16 | *.so 17 | 18 | # Distribution / packaging 19 | .Python 20 | env/ 21 | build/ 22 | develop-eggs/ 23 | dist/ 24 | downloads/ 25 | eggs/ 26 | .eggs/ 27 | lib/ 28 | lib64/ 29 | parts/ 30 | sdist/ 31 | var/ 32 | *.egg-info/ 33 | .installed.cfg 34 | *.egg 35 | 36 | # PyInstaller 37 | # Usually these files are written by a python script from a template 38 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 39 | *.manifest 40 | *.spec 41 | 42 | # Installer logs 43 | pip-log.txt 44 | pip-delete-this-directory.txt 45 | 46 | # Unit test / coverage reports 47 | htmlcov/ 48 | .tox/ 49 | .coverage 50 | .coverage.* 51 | .cache 52 | nosetests.xml 53 | coverage.xml 54 | *,cover 55 | 56 | # Translations 57 | *.mo 58 | *.pot 59 | 60 | # Django stuff: 61 | *.log 62 | 63 | # Sphinx documentation 64 | # docs/_build/ 65 | 66 | # PyBuilder 67 | target/ 68 | -------------------------------------------------------------------------------- /ABMHAP.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/ABMHAP.pdf -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # AgentBasedModel 2 | This is a git repository for the code for the **Agent-Based Model of Human 3 | Activity Patterns** (ABMHAP, pronounced "ab-map"). 4 | 5 | Code documentation and the users guide for the ABMHAP may be found in the following 6 | formats and locations: 7 | 8 | 1. .pdf format: ABMHAP.pdf 9 | 2. .html format: docs\_build\html\index.html 10 | 11 | The current version of the code and guide now includes the capability for the agents to be parameterized with empirical data from the Consolidated Human Activity Database (CHAD). 12 | 13 | ## EPA Disclaimer ## 14 | The United States Environmental Protection Agency (EPA) GitHub project code is provided on an "as is" basis and the user assumes responsibility for its use. EPA has relinquished control of the information and no longer has responsibility to protect the integrity , confidentiality, or availability of the information. Any reference to specific commercial products, processes, or services by service mark, trademark, manufacturer, or otherwise, does not constitute or imply their endorsement, recommendation or favoring by EPA. The EPA seal and logo shall not be used in any manner to imply endorsement of any commercial product or activity by EPA or the United States Government. 15 | -------------------------------------------------------------------------------- /data/chad.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/data/chad.zip -------------------------------------------------------------------------------- /data/demography/adult_non_work.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/data/demography/adult_non_work.zip -------------------------------------------------------------------------------- /data/demography/adult_work.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/data/demography/adult_work.zip -------------------------------------------------------------------------------- /data/demography/child_school.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/data/demography/child_school.zip -------------------------------------------------------------------------------- /data/demography/child_young.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/data/demography/child_young.zip -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line. 5 | SPHINXOPTS = 6 | SPHINXBUILD = sphinx-build 7 | SPHINXPROJ = ABMHAP 8 | SOURCEDIR = . 9 | BUILDDIR = _build 10 | 11 | # Put it first so that "make" without argument is like "make help". 12 | help: 13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 14 | 15 | .PHONY: help Makefile 16 | 17 | # Catch-all target: route all unknown targets to Sphinx using the new 18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 19 | %: Makefile 20 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) -------------------------------------------------------------------------------- /docs/_build/doctrees/activity.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/doctrees/activity.doctree -------------------------------------------------------------------------------- /docs/_build/doctrees/asset.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/doctrees/asset.doctree -------------------------------------------------------------------------------- /docs/_build/doctrees/bed.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/doctrees/bed.doctree -------------------------------------------------------------------------------- /docs/_build/doctrees/bio.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/doctrees/bio.doctree -------------------------------------------------------------------------------- /docs/_build/doctrees/commute.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/doctrees/commute.doctree -------------------------------------------------------------------------------- /docs/_build/doctrees/diary.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/doctrees/diary.doctree -------------------------------------------------------------------------------- /docs/_build/doctrees/eat.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/doctrees/eat.doctree -------------------------------------------------------------------------------- /docs/_build/doctrees/environment.pickle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/doctrees/environment.pickle -------------------------------------------------------------------------------- /docs/_build/doctrees/food.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/doctrees/food.doctree -------------------------------------------------------------------------------- /docs/_build/doctrees/home.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/doctrees/home.doctree -------------------------------------------------------------------------------- /docs/_build/doctrees/hunger.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/doctrees/hunger.doctree -------------------------------------------------------------------------------- /docs/_build/doctrees/income.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/doctrees/income.doctree -------------------------------------------------------------------------------- /docs/_build/doctrees/index.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/doctrees/index.doctree -------------------------------------------------------------------------------- /docs/_build/doctrees/interrupt.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/doctrees/interrupt.doctree -------------------------------------------------------------------------------- /docs/_build/doctrees/interruption.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/doctrees/interruption.doctree -------------------------------------------------------------------------------- /docs/_build/doctrees/location.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/doctrees/location.doctree -------------------------------------------------------------------------------- /docs/_build/doctrees/main.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/doctrees/main.doctree -------------------------------------------------------------------------------- /docs/_build/doctrees/main_params.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/doctrees/main_params.doctree -------------------------------------------------------------------------------- /docs/_build/doctrees/meal.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/doctrees/meal.doctree -------------------------------------------------------------------------------- /docs/_build/doctrees/my_globals.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/doctrees/my_globals.doctree -------------------------------------------------------------------------------- /docs/_build/doctrees/need.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/doctrees/need.doctree -------------------------------------------------------------------------------- /docs/_build/doctrees/occupation.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/doctrees/occupation.doctree -------------------------------------------------------------------------------- /docs/_build/doctrees/params.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/doctrees/params.doctree -------------------------------------------------------------------------------- /docs/_build/doctrees/person.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/doctrees/person.doctree -------------------------------------------------------------------------------- /docs/_build/doctrees/rest.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/doctrees/rest.doctree -------------------------------------------------------------------------------- /docs/_build/doctrees/scenario.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/doctrees/scenario.doctree -------------------------------------------------------------------------------- /docs/_build/doctrees/scheduler.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/doctrees/scheduler.doctree -------------------------------------------------------------------------------- /docs/_build/doctrees/singleton.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/doctrees/singleton.doctree -------------------------------------------------------------------------------- /docs/_build/doctrees/sleep.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/doctrees/sleep.doctree -------------------------------------------------------------------------------- /docs/_build/doctrees/social.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/doctrees/social.doctree -------------------------------------------------------------------------------- /docs/_build/doctrees/state.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/doctrees/state.doctree -------------------------------------------------------------------------------- /docs/_build/doctrees/temporal.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/doctrees/temporal.doctree -------------------------------------------------------------------------------- /docs/_build/doctrees/transport.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/doctrees/transport.doctree -------------------------------------------------------------------------------- /docs/_build/doctrees/travel.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/doctrees/travel.doctree -------------------------------------------------------------------------------- /docs/_build/doctrees/universe.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/doctrees/universe.doctree -------------------------------------------------------------------------------- /docs/_build/doctrees/work.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/doctrees/work.doctree -------------------------------------------------------------------------------- /docs/_build/doctrees/workplace.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/doctrees/workplace.doctree -------------------------------------------------------------------------------- /docs/_build/html/.buildinfo: -------------------------------------------------------------------------------- 1 | # Sphinx build info version 1 2 | # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. 3 | config: 5dfaeea8540a21f320440a64e9649494 4 | tags: 645f666f9bcd5a90fca523b33c5a78b7 5 | -------------------------------------------------------------------------------- /docs/_build/html/_images/math/062063d200322f8e2675a1cc1e22e5ed532c8aad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/html/_images/math/062063d200322f8e2675a1cc1e22e5ed532c8aad.png -------------------------------------------------------------------------------- /docs/_build/html/_images/math/08bf8567834fd2397475c5628d3e7eb88523bcf8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/html/_images/math/08bf8567834fd2397475c5628d3e7eb88523bcf8.png -------------------------------------------------------------------------------- /docs/_build/html/_images/math/0b85dd41c4dfd2c85100308239c20882d9898fd3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/html/_images/math/0b85dd41c4dfd2c85100308239c20882d9898fd3.png -------------------------------------------------------------------------------- /docs/_build/html/_images/math/1886d713167ab3a994339cd4b64bcf0dc2d16662.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/html/_images/math/1886d713167ab3a994339cd4b64bcf0dc2d16662.png -------------------------------------------------------------------------------- /docs/_build/html/_images/math/1dbc400fcc213305415872f9f625cd2828f97a00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/html/_images/math/1dbc400fcc213305415872f9f625cd2828f97a00.png -------------------------------------------------------------------------------- /docs/_build/html/_images/math/27bbef923171b5229fcf4f1bf9a0abacfb6ff482.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/html/_images/math/27bbef923171b5229fcf4f1bf9a0abacfb6ff482.png -------------------------------------------------------------------------------- /docs/_build/html/_images/math/2a206aa293a38ca1db8e3b487b6c77ef7449039a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/html/_images/math/2a206aa293a38ca1db8e3b487b6c77ef7449039a.png -------------------------------------------------------------------------------- /docs/_build/html/_images/math/2d0f65c82a01290576d5291bbb9f7d2ab6d21830.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/html/_images/math/2d0f65c82a01290576d5291bbb9f7d2ab6d21830.png -------------------------------------------------------------------------------- /docs/_build/html/_images/math/3652e39c4e916aa4e24f357337027aececeb67fa.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/html/_images/math/3652e39c4e916aa4e24f357337027aececeb67fa.png -------------------------------------------------------------------------------- /docs/_build/html/_images/math/3b12fdb86124019416eb90fc648db0723364dd46.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/html/_images/math/3b12fdb86124019416eb90fc648db0723364dd46.png -------------------------------------------------------------------------------- /docs/_build/html/_images/math/4ffa672cac9857b30b7238947cf95b020a72482a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/html/_images/math/4ffa672cac9857b30b7238947cf95b020a72482a.png -------------------------------------------------------------------------------- /docs/_build/html/_images/math/509e79c93f908403603c9e7b095e3f939b9ff433.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/html/_images/math/509e79c93f908403603c9e7b095e3f939b9ff433.png -------------------------------------------------------------------------------- /docs/_build/html/_images/math/520e7065eb16d50dae8591f6454515205aa73c59.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/html/_images/math/520e7065eb16d50dae8591f6454515205aa73c59.png -------------------------------------------------------------------------------- /docs/_build/html/_images/math/5d097f7e45f0d4e6be4379f5b0ebca32f9c2d812.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/html/_images/math/5d097f7e45f0d4e6be4379f5b0ebca32f9c2d812.png -------------------------------------------------------------------------------- /docs/_build/html/_images/math/5ec053cf70dc1c98cc297322250569eda193e7a4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/html/_images/math/5ec053cf70dc1c98cc297322250569eda193e7a4.png -------------------------------------------------------------------------------- /docs/_build/html/_images/math/5f6b3e00ee8c7e64da9ad043757824572643b919.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/html/_images/math/5f6b3e00ee8c7e64da9ad043757824572643b919.png -------------------------------------------------------------------------------- /docs/_build/html/_images/math/5fcf4ce47ced9fa8d407eab80eec935b27818322.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/html/_images/math/5fcf4ce47ced9fa8d407eab80eec935b27818322.png -------------------------------------------------------------------------------- /docs/_build/html/_images/math/62f34fae2b08036cedb90a3ebf47f74a61dcb1be.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/html/_images/math/62f34fae2b08036cedb90a3ebf47f74a61dcb1be.png -------------------------------------------------------------------------------- /docs/_build/html/_images/math/708e1d8b6fd15b731aab0d5d72a65bbe4ab7359f.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/html/_images/math/708e1d8b6fd15b731aab0d5d72a65bbe4ab7359f.png -------------------------------------------------------------------------------- /docs/_build/html/_images/math/7464b0c40e921b31b17472a2aabb4901b8e792fb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/html/_images/math/7464b0c40e921b31b17472a2aabb4901b8e792fb.png -------------------------------------------------------------------------------- /docs/_build/html/_images/math/76f1d8ace30435987c01a00ca53a71cba1f40e6c.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/html/_images/math/76f1d8ace30435987c01a00ca53a71cba1f40e6c.png -------------------------------------------------------------------------------- /docs/_build/html/_images/math/7731a6aaf909a43f94bd45f4ab36b6ef3d8c279c.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/html/_images/math/7731a6aaf909a43f94bd45f4ab36b6ef3d8c279c.png -------------------------------------------------------------------------------- /docs/_build/html/_images/math/77bb581fe2e70bd98021463f3adb5dac81cf0f99.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/html/_images/math/77bb581fe2e70bd98021463f3adb5dac81cf0f99.png -------------------------------------------------------------------------------- /docs/_build/html/_images/math/8497490f615a60b2ee5c703ae8cca26f262fdf3e.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/html/_images/math/8497490f615a60b2ee5c703ae8cca26f262fdf3e.png -------------------------------------------------------------------------------- /docs/_build/html/_images/math/8c70fac0370544214e0b9e4e1ad21aaa1d8f22fb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/html/_images/math/8c70fac0370544214e0b9e4e1ad21aaa1d8f22fb.png -------------------------------------------------------------------------------- /docs/_build/html/_images/math/8d1e564b3a99700f3a8fe66041c33fc49f32af97.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/html/_images/math/8d1e564b3a99700f3a8fe66041c33fc49f32af97.png -------------------------------------------------------------------------------- /docs/_build/html/_images/math/98d7b283184b1e6854c14d4aa31b3dd45cce9039.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/html/_images/math/98d7b283184b1e6854c14d4aa31b3dd45cce9039.png -------------------------------------------------------------------------------- /docs/_build/html/_images/math/a68b3a90801d7d52f27bf71d59a1d16a957304c2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/html/_images/math/a68b3a90801d7d52f27bf71d59a1d16a957304c2.png -------------------------------------------------------------------------------- /docs/_build/html/_images/math/a702e781dfc76762a3a132c2031fba8898430925.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/html/_images/math/a702e781dfc76762a3a132c2031fba8898430925.png -------------------------------------------------------------------------------- /docs/_build/html/_images/math/a7fab7f8a2758d2cb887e67af0da614cb6ec9486.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/html/_images/math/a7fab7f8a2758d2cb887e67af0da614cb6ec9486.png -------------------------------------------------------------------------------- /docs/_build/html/_images/math/a80ed95c02dc29fa8c23bacb690346773cdcaf35.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/html/_images/math/a80ed95c02dc29fa8c23bacb690346773cdcaf35.png -------------------------------------------------------------------------------- /docs/_build/html/_images/math/ab84bbd3ef336a7f531380083cd9b5141ca98f59.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/html/_images/math/ab84bbd3ef336a7f531380083cd9b5141ca98f59.png -------------------------------------------------------------------------------- /docs/_build/html/_images/math/addf07033f70a6721ab535c887ae2119106683fc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/html/_images/math/addf07033f70a6721ab535c887ae2119106683fc.png -------------------------------------------------------------------------------- /docs/_build/html/_images/math/b3d35ceb5a9142c3b1ab9e61ea2ca79bf8aa8d96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/html/_images/math/b3d35ceb5a9142c3b1ab9e61ea2ca79bf8aa8d96.png -------------------------------------------------------------------------------- /docs/_build/html/_images/math/b6db61e6244639bf22cc372a5bdead9695d8e288.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/html/_images/math/b6db61e6244639bf22cc372a5bdead9695d8e288.png -------------------------------------------------------------------------------- /docs/_build/html/_images/math/c3e77541d047e420895b1683e06f8c2834f5d473.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/html/_images/math/c3e77541d047e420895b1683e06f8c2834f5d473.png -------------------------------------------------------------------------------- /docs/_build/html/_images/math/c99b9f4a9a1351540eadc537eb954b6e63f6df8c.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/html/_images/math/c99b9f4a9a1351540eadc537eb954b6e63f6df8c.png -------------------------------------------------------------------------------- /docs/_build/html/_images/math/c9cd2a9b30fb9740d391e4c20fcb38c8c27d7940.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/html/_images/math/c9cd2a9b30fb9740d391e4c20fcb38c8c27d7940.png -------------------------------------------------------------------------------- /docs/_build/html/_images/math/cc9cdf88bf192111300cf12e9845db5e98cb1624.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/html/_images/math/cc9cdf88bf192111300cf12e9845db5e98cb1624.png -------------------------------------------------------------------------------- /docs/_build/html/_images/math/cd30e0b91d2b53728ae09ccac9d857b79b3adfcb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/html/_images/math/cd30e0b91d2b53728ae09ccac9d857b79b3adfcb.png -------------------------------------------------------------------------------- /docs/_build/html/_images/math/d0c00b8daa835b34d5295761ff33cb7dcc84a5fe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/html/_images/math/d0c00b8daa835b34d5295761ff33cb7dcc84a5fe.png -------------------------------------------------------------------------------- /docs/_build/html/_images/math/d4de02b91bf45f9cea101c2103fd07a5e89c698e.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/html/_images/math/d4de02b91bf45f9cea101c2103fd07a5e89c698e.png -------------------------------------------------------------------------------- /docs/_build/html/_images/math/d67c7e65a9aea9b01317b930b90bf11cfb6e8e83.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/html/_images/math/d67c7e65a9aea9b01317b930b90bf11cfb6e8e83.png -------------------------------------------------------------------------------- /docs/_build/html/_images/math/d6eeed49f840eb9639b2810c61da18bc8c74f738.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/html/_images/math/d6eeed49f840eb9639b2810c61da18bc8c74f738.png -------------------------------------------------------------------------------- /docs/_build/html/_images/math/dcd93bb563359ce4401a98fb5276d8357896143c.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/html/_images/math/dcd93bb563359ce4401a98fb5276d8357896143c.png -------------------------------------------------------------------------------- /docs/_build/html/_images/math/e0303ed6987b432bfc52983272bc5ae803864271.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/html/_images/math/e0303ed6987b432bfc52983272bc5ae803864271.png -------------------------------------------------------------------------------- /docs/_build/html/_images/math/e4577c41d8cf21bf71438517a57f5850538dfb71.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/html/_images/math/e4577c41d8cf21bf71438517a57f5850538dfb71.png -------------------------------------------------------------------------------- /docs/_build/html/_images/math/e64d16745a41911c9f4d9aa62e83024b927be253.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/html/_images/math/e64d16745a41911c9f4d9aa62e83024b927be253.png -------------------------------------------------------------------------------- /docs/_build/html/_images/math/e8c2d0b75923cec7bf269bda3f93fbe4f61aafb1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/html/_images/math/e8c2d0b75923cec7bf269bda3f93fbe4f61aafb1.png -------------------------------------------------------------------------------- /docs/_build/html/_images/math/e8e55ed1bc59f02fc947b85f9d29860954442a12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/html/_images/math/e8e55ed1bc59f02fc947b85f9d29860954442a12.png -------------------------------------------------------------------------------- /docs/_build/html/_images/math/ebcff0c0c0a44884016856fdf5337e1283c98d5a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/html/_images/math/ebcff0c0c0a44884016856fdf5337e1283c98d5a.png -------------------------------------------------------------------------------- /docs/_build/html/_images/math/f2d5283d4fd453f45911280a6aa312f72a1e1158.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/html/_images/math/f2d5283d4fd453f45911280a6aa312f72a1e1158.png -------------------------------------------------------------------------------- /docs/_build/html/_images/math/f8b85c7725f713a6cc965f0ea2c1752fff180985.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/html/_images/math/f8b85c7725f713a6cc965f0ea2c1752fff180985.png -------------------------------------------------------------------------------- /docs/_build/html/_sources/activity.rst.txt: -------------------------------------------------------------------------------- 1 | activity module 2 | =============== 3 | 4 | .. automodule:: activity 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/analysis.rst.txt: -------------------------------------------------------------------------------- 1 | analysis module 2 | =============== 3 | 4 | .. automodule:: analysis 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/analyzer.rst.txt: -------------------------------------------------------------------------------- 1 | analyzer module 2 | =============== 3 | 4 | .. automodule:: analyzer 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/asset.rst.txt: -------------------------------------------------------------------------------- 1 | asset module 2 | ============ 3 | 4 | .. automodule:: asset 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/bed.rst.txt: -------------------------------------------------------------------------------- 1 | bed module 2 | ========== 3 | 4 | .. automodule:: bed 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/bio.rst.txt: -------------------------------------------------------------------------------- 1 | bio module 2 | ========== 3 | 4 | .. automodule:: bio 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/chad.rst.txt: -------------------------------------------------------------------------------- 1 | chad module 2 | =========== 3 | 4 | .. automodule:: chad 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/chad_code.rst.txt: -------------------------------------------------------------------------------- 1 | chad\_code module 2 | ================= 3 | 4 | .. automodule:: chad_code 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/chad_demography.rst.txt: -------------------------------------------------------------------------------- 1 | chad\_demography module 2 | ======================= 3 | 4 | .. automodule:: chad_demography 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/chad_demography_adult_non_work.rst.txt: -------------------------------------------------------------------------------- 1 | chad\_demography\_adult\_non\_work module 2 | ========================================= 3 | 4 | .. automodule:: chad_demography_adult_non_work 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/chad_demography_adult_work.rst.txt: -------------------------------------------------------------------------------- 1 | chad\_demography\_adult\_work module 2 | ==================================== 3 | 4 | .. automodule:: chad_demography_adult_work 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/chad_demography_child_school.rst.txt: -------------------------------------------------------------------------------- 1 | chad\_demography\_child\_school module 2 | ====================================== 3 | 4 | .. automodule:: chad_demography_child_school 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/chad_demography_child_young.rst.txt: -------------------------------------------------------------------------------- 1 | chad\_demography\_child\_young module 2 | ===================================== 3 | 4 | .. automodule:: chad_demography_child_young 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/chad_parameter_figures.rst.txt: -------------------------------------------------------------------------------- 1 | chad_parameter_figures notebook 2 | =============================== 3 | 4 | .. code:: ipython3 5 | 6 | # The United States Environmental Protection Agency through its Office of 7 | # Research and Development has developed this software. The code is made 8 | # publicly available to better communicate the research. All input data 9 | # used fora given application should be reviewed by the researcher so 10 | # that the model results are based on appropriate data for any given 11 | # application. This model is under continued development. The model and 12 | # data included herein do not represent and should not be construed to 13 | # represent any Agency determination or policy. 14 | # 15 | # This file was written by Dr. Namdi Brandon 16 | # ORCID: 0000-0001-7050-1538 17 | # March 20, 2018 18 | 19 | WARNING: 20 | 21 | this code may not be useful 22 | 23 | This code plots the histograms of the distributions being sampled from 24 | the CHAD data for each activity. 25 | 26 | Import 27 | 28 | .. code:: ipython3 29 | 30 | import sys 31 | sys.path.append('..\\source') 32 | sys.path.append('..\\processing') 33 | 34 | # plotting capability 35 | import matplotlib.pylab as plt 36 | 37 | # zipfile capability 38 | import zipfile 39 | 40 | # ABMHAP modules 41 | 42 | # general capability 43 | import my_globals as mg 44 | import chad_params as cp 45 | import demography as dmg 46 | 47 | import activity, analysis, chad, omni_trial, params 48 | 49 | Run 50 | 51 | .. code:: ipython3 52 | 53 | # the demographic 54 | demo = dmg.ADULT_WORK 55 | 56 | # sets of activities 57 | keys_all = mg.KEYS_ACTIVITIES 58 | 59 | # the activity codes related to not eating 60 | keys_not_eat = [mg.KEY_SLEEP, mg.KEY_WORK, mg.KEY_COMMUTE_TO_WORK, mg.KEY_COMMUTE_FROM_WORK] 61 | 62 | # the activity codes of the eating activities 63 | keys_eat = [mg.KEY_EAT_BREAKFAST, mg.KEY_EAT_LUNCH, mg.KEY_EAT_DINNER] 64 | 65 | # the chosen group of activities 66 | keys = keys_all 67 | 68 | Loop through each activity and plot the histograms of start time, end 69 | time, and duration. Note: the limitations for each activity depends on 70 | which activity parameters are being sampled 71 | 72 | .. code:: ipython3 73 | 74 | # loop through each activity and plot the histograms of start time, end time, and duration 75 | # Note: the limitations for each activity depends on which activity parameters are being sampled 76 | for k in keys: 77 | 78 | # the CHAD limiting parameters 79 | s_params = cp.OMNI[k] 80 | 81 | # get the data 82 | stats_start, stats_end, stats_dt, record = analysis.get_verification_info(demo=demo, key_activity=k, 83 | sampling_params=[s_params]) 84 | # number of the bins 85 | num_bins = 24 86 | 87 | # create subplots 88 | fig, axes = plt.subplots(2, 2) 89 | 90 | # title 91 | fig.suptitle( activity.INT_2_STR[k] ) 92 | 93 | # 94 | # plot the mean start time distribution 95 | # 96 | ax = axes[0, 0] 97 | if k == mg.KEY_SLEEP: 98 | ax.hist(mg.to_periodic(stats_start.mu.values, do_hours=True), bins=num_bins, color='blue', label='start') 99 | else: 100 | ax.hist(stats_start.mu.values, bins=num_bins, color='blue', label='start') 101 | ax.set_xlabel('hours') 102 | ax.legend(loc='best') 103 | 104 | # 105 | # plot the mean end time distribution 106 | # 107 | ax = axes[0, 1] 108 | ax.hist(stats_end.mu.values, bins=num_bins, color='green', label='end') 109 | ax.set_xlabel('hours') 110 | ax.legend(loc='best') 111 | 112 | # 113 | # plot the mean duration distribution 114 | # 115 | ax = axes[1, 0] 116 | ax.hist(stats_dt.mu.values, bins=num_bins, color='red', label='duration') 117 | ax.set_xlabel('hours') 118 | ax.legend(loc='best') 119 | 120 | # show plots 121 | plt.show() 122 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/chad_params.rst.txt: -------------------------------------------------------------------------------- 1 | chad\_params module 2 | =================== 3 | 4 | .. automodule:: chad_params 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/commute.rst.txt: -------------------------------------------------------------------------------- 1 | commute module 2 | ============== 3 | 4 | .. automodule:: commute 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/commute_from_work_trial.rst.txt: -------------------------------------------------------------------------------- 1 | commute\_from\_work\_trial module 2 | ================================= 3 | 4 | .. automodule:: commute_from_work_trial 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/commute_school.rst.txt: -------------------------------------------------------------------------------- 1 | commute_school notebook 2 | ======================= 3 | 4 | .. code:: ipython3 5 | 6 | # The United States Environmental Protection Agency through its Office of 7 | # Research and Development has developed this software. The code is made 8 | # publicly available to better communicate the research. All input data 9 | # used fora given application should be reviewed by the researcher so 10 | # that the model results are based on appropriate data for any given 11 | # application. This model is under continued development. The model and 12 | # data included herein do not represent and should not be construed to 13 | # represent any Agency determination or policy. 14 | # 15 | # This file was written by Dr. Namdi Brandon 16 | # ORCID: 0000-0001-7050-1538 17 | # March 22, 2018 18 | 19 | This file goes through the data from the Consoldiated Human Activity 20 | Database (CHAD) and gets information relevent to **commuting to school** 21 | and **commuting from school** and processes the data for use in the 22 | Agent-Based Model of Human Activity Patterns (ABMHAP) for the school-age 23 | children demographic. More specficially, this file does the following: 24 | 25 | For a given demographic, 26 | 27 | 1. This function goes through the CHAD data and finds the commute 28 | activity data 29 | 30 | 2. The CHAD activity data are seperated into start time, end time, 31 | duration, and CHAD record data 32 | 33 | 3. The CHAD activity data is saved into longitudinal data and 34 | single-activity data 35 | 36 | Import 37 | 38 | .. code:: ipython3 39 | 40 | import sys 41 | sys.path.append('..\\source') 42 | 43 | # ABMHAP capability 44 | import demography as dmg 45 | import datum 46 | 47 | .. code:: ipython3 48 | 49 | %matplotlib notebook 50 | 51 | Load 52 | 53 | .. code:: ipython3 54 | 55 | # 56 | # demographic 57 | # 58 | # the input file and output file directory 59 | key = dmg.CHILD_SCHOOL 60 | 61 | # the input file and output file directory 62 | fname_input, fpath_output = dmg.INT_2_FIN_FOUT_LARGE[key] 63 | 64 | # load the data 65 | data = dmg.load(fname_input) 66 | 67 | Processing data 68 | 69 | .. code:: ipython3 70 | 71 | # get the raw commute data 72 | d, d_to_school, d_from_school = datum.analyze_commute_school(data) 73 | 74 | Plotting 75 | 76 | .. code:: ipython3 77 | 78 | # 79 | # choose to save longitudinal data or single-day data 80 | # 81 | # note that N for the LONGITUDINAL DATA is 1 82 | # this was done becaause there is NOT ENOUGH LONGITUDINAL DATA for adults and working 83 | # 84 | chooser = {True: (1, fpath_output + '\\longitude'), 85 | False: (1, fpath_output + '\\solo'), } 86 | 87 | # whether to save the longitudinal data (if True) or the single-day data (if False) 88 | # there is not enough longitudinal data to have a longitudinal model 89 | do_long = False 90 | 91 | .. code:: ipython3 92 | 93 | # save the longitude data 94 | do_save = False 95 | 96 | if do_save: 97 | 98 | N, fpath = chooser[do_long] 99 | 100 | # the directories the data should be saved in 101 | fpaths = [fpath + '\\commute_to_work', fpath + '\\commute_from_work'] 102 | 103 | # the dictionaries holding the data 104 | data_dict = [d_to_school, d_from_school] 105 | 106 | # save the data 107 | for fpath, d in zip(fpaths, data_dict): 108 | 109 | stats_dt, stats_start, stats_end, record = d['stats_dt'], d['stats_start'], d['stats_end'], d['data'] 110 | 111 | if do_long: 112 | dt, start, end, rec = datum.get_longitude(stats_dt, stats_start, stats_end, record, N=N) 113 | else: 114 | dt, start, end, rec = datum.get_solo(stats_dt, stats_start, stats_end, record) 115 | 116 | datum.save(fpath, record=rec, stats_dt=dt, stats_start=start, stats_end=end) 117 | 118 | 119 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/commute_to_work_trial.rst.txt: -------------------------------------------------------------------------------- 1 | commute\_to\_work\_trial module 2 | =============================== 3 | 4 | .. automodule:: commute_to_work_trial 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/commute_work.rst.txt: -------------------------------------------------------------------------------- 1 | commute_work notebook 2 | ===================== 3 | 4 | .. code:: ipython3 5 | 6 | # The United States Environmental Protection Agency through its Office of 7 | # Research and Development has developed this software. The code is made 8 | # publicly available to better communicate the research. All input data 9 | # used fora given application should be reviewed by the researcher so 10 | # that the model results are based on appropriate data for any given 11 | # application. This model is under continued development. The model and 12 | # data included herein do not represent and should not be construed to 13 | # represent any Agency determination or policy. 14 | # 15 | # This file was written by Dr. Namdi Brandon 16 | # ORCID: 0000-0001-7050-1538 17 | # March 22, 2018 18 | 19 | This file goes through the data from the Consoldiated Human Activity 20 | Database (CHAD) and gets information relevent to **commuting to work**, 21 | **commuting from work**, and **working** and processes the data for use 22 | in the Agent-Based Model of Human Activity Patterns (ABMHAP) for the 23 | working adult demographic. More specficially, this file does the 24 | following: 25 | 26 | 1. This function goes through the CHAD data and finds the commute and 27 | work-activity data 28 | 29 | 2. The data is chosen such that events are chosen such that the work 30 | events are sandwiched between the commute to work and commtue from 31 | work event 32 | 33 | 3. The CHAD activity data are seperated into start time, end time, 34 | duration, and CHAD record data 35 | 36 | 4. The CHAD activity data is saved into longitudinal data and 37 | single-activity data 38 | 39 | Import 40 | 41 | .. code:: ipython3 42 | 43 | import sys 44 | sys.path.append('..\\source') 45 | 46 | # plotting capability 47 | import matplotlib.pylab as plt 48 | 49 | # ABMHAP modules 50 | import demography as dmg 51 | import datum 52 | 53 | .. code:: ipython3 54 | 55 | %matplotlib notebook 56 | 57 | Load 58 | 59 | .. code:: ipython3 60 | 61 | # 62 | # demographic 63 | # 64 | # the input file and output file directory 65 | key = dmg.ADULT_WORK 66 | 67 | # the input file and output file directory 68 | fname_input, fpath_output = dmg.INT_2_FIN_FOUT_LARGE[key] 69 | 70 | # load the data 71 | data = dmg.load(fname_input) 72 | 73 | Processing data 74 | 75 | .. code:: ipython3 76 | 77 | # analyze the commuting data 78 | d, d_to_work, d_from_work, d_at_work = datum.analyze_commute(data) 79 | 80 | Saving Data 81 | 82 | .. code:: ipython3 83 | 84 | # choose to save longitudinal data or single-day data 85 | # 86 | # note that N for the LONGITUDINAL DATA is 1 87 | # this was done becaause there is NOT ENOUGH LONGITUDINAL DATA for adults and working 88 | # 89 | chooser = {True: (1, fpath_output + '\\longitude'), 90 | False: (1, fpath_output + '\\solo'), } 91 | 92 | # whether to save the longitudinal data (if True) or the single-day data (if False) 93 | # there is not enough longitudinal data to have a longitudinal model 94 | do_long = True 95 | 96 | .. code:: ipython3 97 | 98 | # save the longitude data 99 | do_save = False 100 | 101 | if do_save: 102 | 103 | N, fpath = chooser[do_long] 104 | 105 | # the directories the data should be saved in 106 | fpaths = [fpath + '\\commute_to_work', fpath + '\\commute_from_work', fpath + '\\work'] 107 | 108 | # the dictionaries holding the data 109 | data_dict = [d_to_work, d_from_work, d_at_work] 110 | 111 | # save the data 112 | for fpath, d in zip(fpaths, data_dict): 113 | 114 | stats_dt, stats_start, stats_end, record = d['stats_dt'], d['stats_start'], d['stats_end'], d['data'] 115 | 116 | if do_long: 117 | dt, start, end, rec = datum.get_longitude(stats_dt, stats_start, stats_end, record, N=N) 118 | else: 119 | dt, start, end, rec = datum.get_solo(stats_dt, stats_start, stats_end, record) 120 | 121 | datum.save(fpath, record=rec, stats_dt=dt, stats_start=start, stats_end=end) 122 | 123 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/config.rst.txt: -------------------------------------------------------------------------------- 1 | config module 2 | ============= 3 | 4 | .. automodule:: config 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/datum.rst.txt: -------------------------------------------------------------------------------- 1 | datum module 2 | ============ 3 | 4 | .. automodule:: datum 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/demography.rst.txt: -------------------------------------------------------------------------------- 1 | demography module 2 | ================= 3 | 4 | .. automodule:: demography 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/diary.rst.txt: -------------------------------------------------------------------------------- 1 | diary module 2 | ============ 3 | 4 | .. automodule:: diary 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/driver.rst.txt: -------------------------------------------------------------------------------- 1 | driver module 2 | ============= 3 | 4 | .. automodule:: driver 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/driver_params.rst.txt: -------------------------------------------------------------------------------- 1 | driver\_params module 2 | ===================== 3 | 4 | .. automodule:: driver_params 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/driver_result.rst.txt: -------------------------------------------------------------------------------- 1 | driver\_result module 2 | ===================== 3 | 4 | .. automodule:: driver_result 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/eat.rst.txt: -------------------------------------------------------------------------------- 1 | eat module 2 | ========== 3 | 4 | .. automodule:: eat 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/eat_breakfast_trial.rst.txt: -------------------------------------------------------------------------------- 1 | eat\_breakfast\_trial module 2 | ============================ 3 | 4 | .. automodule:: eat_breakfast_trial 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/eat_dinner_trial.rst.txt: -------------------------------------------------------------------------------- 1 | eat\_dinner\_trial module 2 | ========================= 3 | 4 | .. automodule:: eat_dinner_trial 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/eat_lunch_trial.rst.txt: -------------------------------------------------------------------------------- 1 | eat\_lunch\_trial module 2 | ======================== 3 | 4 | .. automodule:: eat_lunch_trial 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/eat_new.rst.txt: -------------------------------------------------------------------------------- 1 | eat_new notebook 2 | ================ 3 | 4 | .. code:: ipython3 5 | 6 | # The United States Environmental Protection Agency through its Office of 7 | # Research and Development has developed this software. The code is made 8 | # publicly available to better communicate the research. All input data 9 | # used fora given application should be reviewed by the researcher so 10 | # that the model results are based on appropriate data for any given 11 | # application. This model is under continued development. The model and 12 | # data included herein do not represent and should not be construed to 13 | # represent any Agency determination or policy. 14 | # 15 | # This file was written by Dr. Namdi Brandon 16 | # ORCID: 0000-0001-7050-1538 17 | # March 22, 2018 18 | 19 | This file goes through the data from the Consoldiated Human Activity 20 | Database (CHAD) and gets information relevent to **eating breakfast**, 21 | **eating lunch**, and **eating dinner** and processes the data for use 22 | in the Agent-Based Model of Human Activity Patterns (ABMHAP) for each 23 | demographic. More specficially, this file does the following: 24 | 25 | For a given demographic, 26 | 27 | 1. This function goes through the CHAD data and finds the eat-activity 28 | data 29 | 30 | 2. The CHAD activity data are seperated into start time, end time, 31 | duration, and CHAD record data for the meals: breakfast, lunch, and 32 | dinner 33 | 34 | 3. The CHAD activity data is saved into longitudinal data and 35 | single-activity data 36 | 37 | Import 38 | 39 | .. code:: ipython3 40 | 41 | import sys 42 | sys.path.append('..\\source') 43 | 44 | # plotting capability 45 | import matplotlib.pylab as plt 46 | 47 | # ABMHAP modules 48 | import demography as dmg 49 | import datum 50 | 51 | .. code:: ipython3 52 | 53 | %matplotlib notebook 54 | 55 | Load data 56 | 57 | .. code:: ipython3 58 | 59 | # 60 | # the demographic 61 | # 62 | key = dmg.CHILD_YOUNG 63 | 64 | # the input file and output file directory 65 | fname_input, fpath_output = dmg.INT_2_FIN_FOUT_LARGE[key] 66 | 67 | # load the data 68 | data = dmg.load(fname_input) 69 | 70 | Process the data 71 | 72 | .. code:: ipython3 73 | 74 | # analyze the eat-activity data 75 | d_breakfast, d_lunch, d_dinner = datum.analyze_eat(data) 76 | 77 | Plot the distribution 78 | 79 | .. code:: ipython3 80 | 81 | # 82 | # plot the distribution 83 | # 84 | d = d_dinner 85 | 86 | temp = d['data'] 87 | 88 | ylabel = 'Relative Frequency' 89 | xlabel = 'Time [h]' 90 | 91 | fig, axes = plt.subplots(2,2) 92 | 93 | # start time 94 | ax = axes[0,0] 95 | 96 | datum.histogram(ax, temp.start.values, color='b', label='start') 97 | ax.set_ylabel(ylabel) 98 | ax.set_xlabel(xlabel) 99 | ax.legend(loc='best') 100 | 101 | # end time 102 | ax = axes[0, 1] 103 | datum.histogram(ax, temp.end.values, color='g', label='end') 104 | ax.set_ylabel(ylabel) 105 | ax.set_xlabel(xlabel) 106 | ax.legend(loc='best') 107 | 108 | 109 | # duration 110 | ax = axes[1, 0] 111 | datum.histogram(ax, temp.dt.values, color='r', label='duration') 112 | ax.set_ylabel(ylabel) 113 | ax.set_xlabel(xlabel) 114 | ax.legend(loc='best') 115 | 116 | plt.show() 117 | 118 | Save the data 119 | 120 | .. code:: ipython3 121 | 122 | # choose to save longitudinal data or single-day data 123 | chooser = {True: (2, fpath_output + '\\longitude'), 124 | False: (1, fpath_output + '\\solo'), } 125 | 126 | # whether to save the longitudinal data (if True) or the single-day data (if False) 127 | do_long = False 128 | 129 | .. code:: ipython3 130 | 131 | # 132 | # save the data 133 | 134 | do_save = False 135 | 136 | if do_save: 137 | 138 | N, fpath = chooser[do_long] 139 | 140 | # the directories the data should be saved in 141 | fpaths = [fpath + '\\eat_breakfast', fpath + '\\eat_lunch', fpath + '\\eat_dinner'] 142 | 143 | # the dictionaries holding the data 144 | data_dict = [d_breakfast, d_lunch, d_dinner] 145 | 146 | 147 | # save the data 148 | for fpath, d in zip(fpaths, data_dict): 149 | 150 | stats_dt, stats_start, stats_end, record = d['stats_dt'], d['stats_start'], d['stats_end'], d['data'] 151 | 152 | if do_long: 153 | dt, start, end, rec = datum.get_longitude(stats_dt, stats_start, stats_end, record, N=N) 154 | else: 155 | dt, start, end, rec = datum.get_solo(stats_dt, stats_start, stats_end, record) 156 | 157 | datum.save(fpath, record=rec, stats_dt=dt, stats_start=start, stats_end=end) 158 | 159 | 160 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/evaluation.rst.txt: -------------------------------------------------------------------------------- 1 | evaluation module 2 | ================= 3 | 4 | .. automodule:: evaluation 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/fig_driver.rst.txt: -------------------------------------------------------------------------------- 1 | fig\_driver module 2 | ================== 3 | 4 | .. automodule:: fig_driver 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/food.rst.txt: -------------------------------------------------------------------------------- 1 | food module 2 | =========== 3 | 4 | .. automodule:: food 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/full_save.rst.txt: -------------------------------------------------------------------------------- 1 | 2 | .. code:: ipython3 3 | 4 | # The United States Environmental Protection Agency through its Office of 5 | # Research and Development has developed this software. The code is made 6 | # publicly available to better communicate the research. All input data 7 | # used fora given application should be reviewed by the researcher so 8 | # that the model results are based on appropriate data for any given 9 | # application. This model is under continued development. The model and 10 | # data included herein do not represent and should not be construed to 11 | # represent any Agency determination or policy. 12 | # 13 | # This file was written by Dr. Namdi Brandon 14 | # ORCID: 0000-0001-7050-1538 15 | # March 22, 2018 16 | 17 | This notebook is **only used for development**. 18 | 19 | This notebook is in charge of saving data and files in a compressed 20 | format as .zip files by doing the following: 21 | 22 | 1. save demographic data originally found in the 'data\_large' directory 23 | in the compressed form used by the ABMHAP in the 'data' directory 24 | 25 | 2. save the entire directory containing the ABMHAP directory in a 26 | compressed (.zip) format 27 | 28 | Import 29 | 30 | .. code:: ipython3 31 | 32 | import os, sys 33 | sys.path.append('..\\source') 34 | 35 | # ABMHAP modules 36 | import my_globals as mg 37 | 38 | import demography as dmg 39 | import chad 40 | 41 | Save the files releated to the demographics 42 | 43 | .. code:: ipython3 44 | 45 | # 46 | # the demographic 47 | # 48 | demo = dmg.CHILD_SCHOOL 49 | 50 | .. code:: ipython3 51 | 52 | # number of characters to not include: '.zip' 53 | n_char = 4 54 | 55 | # chooser 56 | # (the outfile directory for each demographic with no .zip ending, the source directory to compress) 57 | chooser_fout_source = { dmg.ADULT_WORK: (chad.FNAME_ADULT_WORK[:-n_char], chad.FDIR_ADULT_WORK_LARGE), 58 | dmg.ADULT_NON_WORK: (chad.FNAME_ADULT_NON_WORK[:-n_char], chad.FDIR_ADULT_NON_WORK_LARGE), 59 | dmg.CHILD_SCHOOL: (chad.FNAME_CHILD_SCHOOL[:-n_char], chad.FDIR_CHILD_SCHOOL_LARGE), 60 | dmg.CHILD_YOUNG: (chad.FNAME_CHILD_YOUNG[:-n_char], chad.FDIR_CHILD_YOUNG_LARGE), 61 | } 62 | 63 | # the outfile name (no .zip ending) 64 | fname, source_dir = chooser_fout_source[demo] 65 | 66 | 67 | .. code:: ipython3 68 | 69 | # 70 | # Save (zip) a directory about the demographics 71 | # 72 | # save flag 73 | do_save = False 74 | 75 | # save the data 76 | if do_save: 77 | mg.save_zip(out_file=fname, source_dir=source_dir) 78 | 79 | Save (zip) the entire directory for the ABMHAP code as a compressed file 80 | 81 | .. code:: ipython3 82 | 83 | # 84 | # saving parameters 85 | # 86 | 87 | # save (zip) the entire directory that contains the ABMHAP code 88 | # this is the directory to be compressed 89 | fpath_src = os.path.dirname( os.getcwd() ) 90 | 91 | # file directory 92 | fpath = os.getcwd() 93 | 94 | for i in range(3): 95 | fpath = os.path.dirname(fpath) 96 | 97 | # the file name of the save .zip file with out the .zip extension 98 | fname_out = fpath + '\\ABMHAP' # with no .zip 99 | 100 | .. code:: ipython3 101 | 102 | # 103 | # save the directory 104 | # 105 | 106 | # save flag 107 | do_save_abm_dir = False 108 | 109 | if do_save_abm_dir: 110 | mg.save_zip(out_file=fname_out, source_dir=fpath_src) 111 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/home.rst.txt: -------------------------------------------------------------------------------- 1 | home module 2 | =========== 3 | 4 | .. automodule:: home 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/hunger.rst.txt: -------------------------------------------------------------------------------- 1 | hunger module 2 | ============= 3 | 4 | .. automodule:: hunger 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/icf.rst.txt: -------------------------------------------------------------------------------- 1 | 2 | .. code:: ipython3 3 | 4 | # The United States Environmental Protection Agency through its Office of 5 | # Research and Development has developed this software. The code is made 6 | # publicly available to better communicate the research. All input data 7 | # used fora given application should be reviewed by the researcher so 8 | # that the model results are based on appropriate data for any given 9 | # application. This model is under continued development. The model and 10 | # data included herein do not represent and should not be construed to 11 | # represent any Agency determination or policy. 12 | # 13 | # This file was written by Dr. Namdi Brandon 14 | # ORCID: 0000-0001-7050-1538 15 | # March 20, 2018 16 | 17 | import 18 | 19 | .. code:: ipython3 20 | 21 | import os, sys 22 | sys.path.append('..\\source') 23 | sys.path.append('..\\processing') 24 | 25 | # data frame capability 26 | import pandas as pd 27 | 28 | # ABMHAP modules 29 | import my_globals as mg 30 | import demography as dmg 31 | 32 | 33 | function 34 | 35 | .. code:: ipython3 36 | 37 | def add_id(df_list): 38 | 39 | """ 40 | Add the agent identifier to the activity diaries. 41 | 42 | :param df_list: the activity diaries 43 | :type df_list: list of pandas.core.frame.DataFrame 44 | """ 45 | 46 | for i, df in enumerate(df_list): 47 | df['id'] = i+1 48 | 49 | return df_list 50 | 51 | def save(df, fname): 52 | 53 | # copy the data 54 | x = df.copy() 55 | 56 | # add +1 to day for ICF 57 | x.day = x.day + 1 58 | 59 | # create the directory for the save file if it does not exist 60 | os.makedirs(os.path.dirname(fname), exist_ok=True) 61 | 62 | # save the data frame 63 | x.to_csv(fname, index=False) 64 | 65 | return 66 | 67 | 68 | run 69 | 70 | .. code:: ipython3 71 | 72 | # get the file name 73 | fpath_load_data = mg.FDIR_MY_DATA + '\\with_without_variation\\n8192_d364_with_variation' 74 | fname_load_data = fpath_load_data + '\\data_adult_work.pkl' 75 | 76 | .. code:: ipython3 77 | 78 | # load the driver_result object 79 | x = mg.load(fname_load_data) 80 | 81 | .. code:: ipython3 82 | 83 | # list of each data frame 84 | df_list = x.get_all_data() 85 | 86 | # add unique identifiers for ICF 87 | df_list = add_id(df_list) 88 | 89 | # get the name of the columns to include the id as the first column instead of the last 90 | colnames = df_list[0].columns.values.tolist() 91 | colnames = [ colnames[-1] ] + colnames[:-1] 92 | 93 | # set the reorder the columns for each dataframe 94 | df_list = [df[colnames] for df in df_list] 95 | 96 | # combine the data into one dataframe 97 | df_all = pd.concat(df_list) 98 | 99 | .. code:: ipython3 100 | 101 | # 102 | # save parameters 103 | # 104 | 105 | # file directory to save the data in 106 | fpath = mg.FDIR_MY_DATA + '\\icf' 107 | 108 | # the file name of the file to save 109 | chooser = {dmg.ADULT_WORK: '\\adult_work.csv', 110 | dmg.ADULT_NON_WORK: '\\adult_non_work.csv', 111 | dmg.CHILD_SCHOOL: '\\child_school.csv', 112 | dmg.CHILD_YOUNG: '\\child_young.csv', 113 | } 114 | 115 | # the full file name 116 | fname_save = fpath + chooser[x.demographic] 117 | 118 | # print the full file name 119 | print(fname_save) 120 | 121 | 122 | .. parsed-literal:: 123 | 124 | ..\my_data\icf\adult_work.csv 125 | 126 | 127 | .. code:: ipython3 128 | 129 | # 130 | # save the data 131 | # 132 | 133 | do_save = False 134 | 135 | if do_save: 136 | save(df_all, fname_save) 137 | 138 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/income.rst.txt: -------------------------------------------------------------------------------- 1 | income module 2 | ============= 3 | 4 | .. automodule:: income 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/interrupt.rst.txt: -------------------------------------------------------------------------------- 1 | interrupt module 2 | ================ 3 | 4 | .. automodule:: interrupt 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/interruption.rst.txt: -------------------------------------------------------------------------------- 1 | interruption module 2 | =================== 3 | 4 | .. automodule:: interruption 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/location.rst.txt: -------------------------------------------------------------------------------- 1 | location module 2 | =============== 3 | 4 | .. automodule:: location 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/main.rst.txt: -------------------------------------------------------------------------------- 1 | main module 2 | =========== 3 | 4 | .. automodule:: main 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/main_params.rst.txt: -------------------------------------------------------------------------------- 1 | main\_params module 2 | =================== 3 | 4 | .. automodule:: main_params 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/meal.rst.txt: -------------------------------------------------------------------------------- 1 | meal module 2 | =========== 3 | 4 | .. automodule:: meal 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/my_debug.rst.txt: -------------------------------------------------------------------------------- 1 | my\_debug module 2 | ================ 3 | 4 | .. automodule:: my_debug 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/my_globals.rst.txt: -------------------------------------------------------------------------------- 1 | my\_globals module 2 | ================== 3 | 4 | .. automodule:: my_globals 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/need.rst.txt: -------------------------------------------------------------------------------- 1 | need module 2 | =========== 3 | 4 | .. automodule:: need 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/occupation.rst.txt: -------------------------------------------------------------------------------- 1 | occupation module 2 | ================= 3 | 4 | .. automodule:: occupation 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/omni_trial.rst.txt: -------------------------------------------------------------------------------- 1 | omni\_trial module 2 | ================== 3 | 4 | .. automodule:: omni_trial 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/output.rst.txt: -------------------------------------------------------------------------------- 1 | output module 2 | ============= 3 | 4 | .. automodule:: output 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/params.rst.txt: -------------------------------------------------------------------------------- 1 | params module 2 | ============= 3 | 4 | .. automodule:: params 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/person.rst.txt: -------------------------------------------------------------------------------- 1 | person module 2 | ============= 3 | 4 | .. automodule:: person 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/plotter.rst.txt: -------------------------------------------------------------------------------- 1 | plotter module 2 | ============== 3 | 4 | .. automodule:: plotter 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/rest.rst.txt: -------------------------------------------------------------------------------- 1 | rest module 2 | =========== 3 | 4 | .. automodule:: rest 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/scenario.rst.txt: -------------------------------------------------------------------------------- 1 | scenario module 2 | =============== 3 | 4 | .. automodule:: scenario 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/scheduler.rst.txt: -------------------------------------------------------------------------------- 1 | scheduler module 2 | ================ 3 | 4 | .. automodule:: scheduler 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/school_new.rst.txt: -------------------------------------------------------------------------------- 1 | school_new notebook 2 | =================== 3 | 4 | .. code:: ipython3 5 | 6 | # The United States Environmental Protection Agency through its Office of 7 | # Research and Development has developed this software. The code is made 8 | # publicly available to better communicate the research. All input data 9 | # used fora given application should be reviewed by the researcher so 10 | # that the model results are based on appropriate data for any given 11 | # application. This model is under continued development. The model and 12 | # data included herein do not represent and should not be construed to 13 | # represent any Agency determination or policy. 14 | # 15 | # This file was written by Dr. Namdi Brandon 16 | # ORCID: 0000-0001-7050-1538 17 | # March 22, 2018 18 | 19 | This file goes through the data from the Consoldiated Human Activity 20 | Database (CHAD) and gets information relevent to \*\* school\*\* and 21 | processes the data for use in the Agent-Based Model of Human Activity 22 | Patterns (ABMHAP) for the school-age children demographic. More 23 | specficially, this file does the following: 24 | 25 | For school-age children demographic, 26 | 27 | 1. This function goes through the CHAD data and finds the school 28 | activity data 29 | 30 | 2. The CHAD activity data are seperated into start time, end time, 31 | duration, and CHAD record data 32 | 33 | 3. The CHAD activity data is saved into longitudinal data and 34 | single-activity data 35 | 36 | import 37 | 38 | .. code:: ipython3 39 | 40 | import sys 41 | sys.path.append('..\\source') 42 | 43 | # ABMHAP modules 44 | import demography as dmg 45 | import datum 46 | 47 | load data 48 | 49 | .. code:: ipython3 50 | 51 | # 52 | # demographic 53 | # 54 | key = dmg.CHILD_SCHOOL 55 | 56 | fname_input, fpath_output = dmg.INT_2_FIN_FOUT_LARGE[key] 57 | 58 | # load the data 59 | data = dmg.load(fname_input) 60 | 61 | process the data 62 | 63 | .. code:: ipython3 64 | 65 | # dictionaries about the moments 66 | d = datum.analyze_education(data) 67 | 68 | save the data 69 | 70 | .. code:: ipython3 71 | 72 | # choose to save longitudinal data or single-day data 73 | chooser = {True: (2, fpath_output + '\\longitude'), 74 | False: (1, fpath_output + '\\solo'), } 75 | 76 | # whether to save the longitudinal data (if True) or the single-day data (if False) 77 | do_long = True 78 | 79 | .. code:: ipython3 80 | 81 | # 82 | # save the data 83 | # 84 | do_save = False 85 | 86 | if do_save: 87 | 88 | N, fpath = chooser[do_long] 89 | 90 | # the directory the data should be saved in 91 | fpath = fpath + '\\education' 92 | 93 | # save the data 94 | stats_dt, stats_start, stats_end, record = d['stats_dt'], d['stats_start'], d['stats_end'], d['data'] 95 | 96 | if do_long: 97 | dt, start, end, rec = datum.get_longitude(stats_dt, stats_start, stats_end, record, N=N) 98 | else: 99 | dt, start, end, rec = datum.get_solo(stats_dt, stats_start, stats_end, record) 100 | 101 | datum.save(fpath, record=rec, stats_dt=dt, stats_start=start, stats_end=end) 102 | 103 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/singleton.rst.txt: -------------------------------------------------------------------------------- 1 | singleton module 2 | ================ 3 | 4 | .. automodule:: singleton 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/sleep.rst.txt: -------------------------------------------------------------------------------- 1 | sleep module 2 | ============ 3 | 4 | .. automodule:: sleep 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/sleep_new.rst.txt: -------------------------------------------------------------------------------- 1 | sleep_new notebook 2 | ================== 3 | 4 | .. code:: ipython3 5 | 6 | # The United States Environmental Protection Agency through its Office of 7 | # Research and Development has developed this software. The code is made 8 | # publicly available to better communicate the research. All input data 9 | # used fora given application should be reviewed by the researcher so 10 | # that the model results are based on appropriate data for any given 11 | # application. This model is under continued development. The model and 12 | # data included herein do not represent and should not be construed to 13 | # represent any Agency determination or policy. 14 | # 15 | # This file was written by Dr. Namdi Brandon 16 | # ORCID: 0000-0001-7050-1538 17 | # March 22, 2018 18 | 19 | This file goes through the data from the Consoldiated Human Activity 20 | Database (CHAD) and gets information relevent to **sleeping** and 21 | processes the data for use in the Agent-Based Model of Human Activity 22 | Patterns (ABMHAP) for each demographic. More specficially, this file 23 | does the following: 24 | 25 | For a given demographic, 26 | 27 | 1. This function goes through the CHAD data and finds the sleep-activity 28 | data 29 | 30 | 2. The CHAD activity data are seperated into start time, end time, 31 | duration, and CHAD record data 32 | 33 | 3. The CHAD activity data is saved into longitudinal data and 34 | single-activity data 35 | 36 | Import 37 | 38 | .. code:: ipython3 39 | 40 | import sys 41 | sys.path.append('..\\source') 42 | 43 | # plotting capability 44 | import matplotlib.pylab as plt 45 | 46 | # ABMHAP modules 47 | import demography as dmg 48 | import my_globals as mg 49 | import datum 50 | 51 | .. code:: ipython3 52 | 53 | %matplotlib notebook 54 | 55 | Load 56 | 57 | .. code:: ipython3 58 | 59 | # 60 | # demographic 61 | # 62 | demo = dmg.CHILD_YOUNG 63 | 64 | # the input file and output file directory 65 | fname_input, fpath_output = dmg.INT_2_FIN_FOUT_LARGE[key] 66 | 67 | # load the data 68 | data = dmg.load(fname_input) 69 | 70 | Process data 71 | 72 | .. code:: ipython3 73 | 74 | # analyze the data 75 | d_slumber = datum.analyze_sleep(data) 76 | 77 | .. code:: ipython3 78 | 79 | # get the statistical data 80 | d = d_slumber 81 | 82 | slumber, stats_dt, stats_start, stats_end = d['data'], d['stats_dt'], d['stats_start'], d['stats_end'] 83 | 84 | slumber_we, stats_we_dt, stats_we_start, stats_we_end = \ 85 | d['data_weekend'], d['stats_we_dt'], d['stats_we_start'], d['stats_we_end'] 86 | 87 | slumber_wd, stats_wd_dt, stats_wd_start, stats_wd_end = \ 88 | d['data_weekday'], d['stats_wd_dt'], d['stats_wd_start'], d['stats_wd_end'] 89 | 90 | save the data 91 | 92 | .. code:: ipython3 93 | 94 | # the minimum number of activity entries per individual to be considered longitudinal 95 | N_long = 2 96 | 97 | # there is not much longitudinal information of pre-school children 98 | if demo in [dmg.CHILD_YOUNG]: 99 | N_long = 1 100 | 101 | # choose to save longitudinal data or single-day data 102 | chooser = {True: (N_long, fpath_output + '\\longitude'), 103 | False: (1, fpath_output + '\\solo'), } 104 | 105 | # whether to save the longitudinal data (if True) or the single-day data (if False) 106 | do_long = True 107 | 108 | .. code:: ipython3 109 | 110 | # save the and solo data 111 | do_save = False 112 | 113 | if do_save: 114 | 115 | N, fpath = chooser[do_long] 116 | 117 | if do_long: 118 | data_all = datum.get_longitude(stats_dt, stats_start, stats_end, slumber, N=N) 119 | data_weekend = datum.get_longitude(stats_we_dt, stats_we_start, stats_we_end, slumber_we, N=N) 120 | data_weekday = datum.get_longitude(stats_wd_dt, stats_wd_start, stats_wd_end, slumber_wd, N=N) 121 | else: 122 | data_all = datum.get_solo(stats_dt, stats_start, stats_end, slumber) 123 | data_weekend = datum.get_solo(stats_we_dt, stats_we_start, stats_we_end, slumber_we) 124 | data_weekday = datum.get_solo(stats_wd_dt, stats_wd_start, stats_wd_end, slumber_wd) 125 | 126 | # the directories the data should be saved in 127 | fpath = fpath + '\\sleep' 128 | fpaths = [ fpath + '\\all', fpath + '\\non_workday', fpath + '\\workday' ] 129 | 130 | # the dictionaries holding the data 131 | data_list = [data_all, data_weekend, data_weekday] 132 | 133 | # save the data 134 | for fpath, d in zip(fpaths, data_list): 135 | 136 | stats_dt, stats_start, stats_end, record = d 137 | datum.save(fpath, record=record, stats_dt=stats_dt, stats_start=stats_start, stats_end=stats_end) 138 | 139 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/sleep_trial.rst.txt: -------------------------------------------------------------------------------- 1 | sleep\_trial module 2 | =================== 3 | 4 | .. automodule:: sleep_trial 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/social.rst.txt: -------------------------------------------------------------------------------- 1 | social module 2 | ============= 3 | 4 | .. automodule:: social 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/state.rst.txt: -------------------------------------------------------------------------------- 1 | state module 2 | ============ 3 | 4 | .. automodule:: state 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/temporal.rst.txt: -------------------------------------------------------------------------------- 1 | temporal module 2 | =============== 3 | 4 | .. automodule:: temporal 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/transport.rst.txt: -------------------------------------------------------------------------------- 1 | transport module 2 | ================ 3 | 4 | .. automodule:: transport 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/travel.rst.txt: -------------------------------------------------------------------------------- 1 | travel module 2 | ============= 3 | 4 | .. automodule:: travel 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/trial.rst.txt: -------------------------------------------------------------------------------- 1 | trial module 2 | ============ 3 | 4 | .. automodule:: trial 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/universe.rst.txt: -------------------------------------------------------------------------------- 1 | universe module 2 | =============== 3 | 4 | .. automodule:: universe 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/variation.rst.txt: -------------------------------------------------------------------------------- 1 | variation module 2 | ================ 3 | 4 | .. automodule:: variation 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/work.rst.txt: -------------------------------------------------------------------------------- 1 | work module 2 | =========== 3 | 4 | .. automodule:: work 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/work_new.rst.txt: -------------------------------------------------------------------------------- 1 | 2 | .. code:: ipython3 3 | 4 | # The United States Environmental Protection Agency through its Office of 5 | # Research and Development has developed this software. The code is made 6 | # publicly available to better communicate the research. All input data 7 | # used fora given application should be reviewed by the researcher so 8 | # that the model results are based on appropriate data for any given 9 | # application. This model is under continued development. The model and 10 | # data included herein do not represent and should not be construed to 11 | # represent any Agency determination or policy. 12 | # 13 | # This file was written by Dr. Namdi Brandon 14 | # ORCID: 0000-0001-7050-1538 15 | # March 22, 2018 16 | 17 | **This file is NOT used** in order to load the appropriate data. 18 | 19 | See **commute\_work.ipynb** notebook instead 20 | 21 | import 22 | 23 | .. code:: ipython3 24 | 25 | # plotting capability 26 | import matplotlib.pylab as plt 27 | 28 | # import 29 | import os 30 | 31 | # ABMHAP modules 32 | from datum import * 33 | 34 | import my_globals as mg 35 | 36 | run 37 | 38 | .. code:: ipython3 39 | 40 | # the file where the raw data will be pickled 41 | fpath = os.path.dirname( os.getcwd() ) + '\\my_data' 42 | fname = fpath + '\\data_raw.pkl' 43 | 44 | .. code:: ipython3 45 | 46 | # save and load data as a pkl file 47 | do_save = False 48 | do_load = False 49 | 50 | .. code:: ipython3 51 | 52 | if do_load: 53 | data = mg.load(fname) 54 | else: 55 | data = chad.CHAD_RAW(min_age=social.ADULT_AGE, max_age=social.MAX_AGE) 56 | 57 | 58 | .. parsed-literal:: 59 | 60 | M:\Net MyDocuments\research\code\HEM\abm\source\chad.py:246: DtypeWarning: Columns (1) have mixed types. Specify dtype option on import or set low_memory=False. 61 | self.quest = self.get_quest() 62 | C:\Users\nbrandon\AppData\Local\Continuum\Anaconda3\lib\site-packages\ipykernel\__main__.py:4: DtypeWarning: Columns (4,5) have mixed types. Specify dtype option on import or set low_memory=False. 63 | 64 | 65 | save 66 | 67 | .. code:: ipython3 68 | 69 | if do_save: 70 | mg.save(data, fname) 71 | 72 | The order for getting work data 73 | 74 | 1. Get the CHADIDs that are for employed, fulltime workers 75 | 76 | 2. Get the work events data from employed, fulltime workers 77 | 78 | 3. Calculate the longitudinal data in order to sum ajacent periods and 79 | merge events from before midnight to after midnight 80 | 81 | 4. Make 1 work event starting from the first event and ending on the 82 | last event 83 | 84 | .. code:: ipython3 85 | 86 | d_raw, d_long, d_full = analyze_work(data) 87 | 88 | 89 | .. parsed-literal:: 90 | 91 | loading work data... 92 | calculating longitudinal data... 93 | calculating fulltime data... 94 | analyzing moments... 95 | 96 | 97 | .. code:: ipython3 98 | 99 | # the activity data 100 | d = d_full 101 | 102 | .. code:: ipython3 103 | 104 | x = d['stats_end'] 105 | y = d['stats_start'] 106 | 107 | plot 108 | 109 | .. code:: ipython3 110 | 111 | plt.figure(1) 112 | histogram( x.mu.values, color='green' ) 113 | 114 | plt.figure(2) 115 | histogram( y.mu.values, color='blue' ) 116 | 117 | plt.show() 118 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/work_trial.rst.txt: -------------------------------------------------------------------------------- 1 | work\_trial module 2 | ================== 3 | 4 | .. automodule:: work_trial 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/workplace.rst.txt: -------------------------------------------------------------------------------- 1 | workplace module 2 | ================ 3 | 4 | .. automodule:: workplace 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/_build/html/_static/ajax-loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/html/_static/ajax-loader.gif -------------------------------------------------------------------------------- /docs/_build/html/_static/comment-bright.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/html/_static/comment-bright.png -------------------------------------------------------------------------------- /docs/_build/html/_static/comment-close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/html/_static/comment-close.png -------------------------------------------------------------------------------- /docs/_build/html/_static/comment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/html/_static/comment.png -------------------------------------------------------------------------------- /docs/_build/html/_static/custom.css: -------------------------------------------------------------------------------- 1 | /* This file intentionally left blank. */ 2 | -------------------------------------------------------------------------------- /docs/_build/html/_static/documentation_options.js: -------------------------------------------------------------------------------- 1 | var DOCUMENTATION_OPTIONS = { 2 | URL_ROOT: '', 3 | VERSION: '2018.06', 4 | LANGUAGE: 'en', 5 | COLLAPSE_INDEX: false, 6 | FILE_SUFFIX: '.html', 7 | HAS_SOURCE: true, 8 | SOURCELINK_SUFFIX: '.txt' 9 | }; -------------------------------------------------------------------------------- /docs/_build/html/_static/down-pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/html/_static/down-pressed.png -------------------------------------------------------------------------------- /docs/_build/html/_static/down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/html/_static/down.png -------------------------------------------------------------------------------- /docs/_build/html/_static/epa_logo_black_sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/html/_static/epa_logo_black_sm.png -------------------------------------------------------------------------------- /docs/_build/html/_static/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/html/_static/file.png -------------------------------------------------------------------------------- /docs/_build/html/_static/minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/html/_static/minus.png -------------------------------------------------------------------------------- /docs/_build/html/_static/plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/html/_static/plus.png -------------------------------------------------------------------------------- /docs/_build/html/_static/pygments.css: -------------------------------------------------------------------------------- 1 | .highlight .hll { background-color: #ffffcc } 2 | .highlight { background: #eeffcc; } 3 | .highlight .c { color: #408090; font-style: italic } /* Comment */ 4 | .highlight .err { border: 1px solid #FF0000 } /* Error */ 5 | .highlight .k { color: #007020; font-weight: bold } /* Keyword */ 6 | .highlight .o { color: #666666 } /* Operator */ 7 | .highlight .ch { color: #408090; font-style: italic } /* Comment.Hashbang */ 8 | .highlight .cm { color: #408090; font-style: italic } /* Comment.Multiline */ 9 | .highlight .cp { color: #007020 } /* Comment.Preproc */ 10 | .highlight .cpf { color: #408090; font-style: italic } /* Comment.PreprocFile */ 11 | .highlight .c1 { color: #408090; font-style: italic } /* Comment.Single */ 12 | .highlight .cs { color: #408090; background-color: #fff0f0 } /* Comment.Special */ 13 | .highlight .gd { color: #A00000 } /* Generic.Deleted */ 14 | .highlight .ge { font-style: italic } /* Generic.Emph */ 15 | .highlight .gr { color: #FF0000 } /* Generic.Error */ 16 | .highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ 17 | .highlight .gi { color: #00A000 } /* Generic.Inserted */ 18 | .highlight .go { color: #333333 } /* Generic.Output */ 19 | .highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */ 20 | .highlight .gs { font-weight: bold } /* Generic.Strong */ 21 | .highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ 22 | .highlight .gt { color: #0044DD } /* Generic.Traceback */ 23 | .highlight .kc { color: #007020; font-weight: bold } /* Keyword.Constant */ 24 | .highlight .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */ 25 | .highlight .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */ 26 | .highlight .kp { color: #007020 } /* Keyword.Pseudo */ 27 | .highlight .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */ 28 | .highlight .kt { color: #902000 } /* Keyword.Type */ 29 | .highlight .m { color: #208050 } /* Literal.Number */ 30 | .highlight .s { color: #4070a0 } /* Literal.String */ 31 | .highlight .na { color: #4070a0 } /* Name.Attribute */ 32 | .highlight .nb { color: #007020 } /* Name.Builtin */ 33 | .highlight .nc { color: #0e84b5; font-weight: bold } /* Name.Class */ 34 | .highlight .no { color: #60add5 } /* Name.Constant */ 35 | .highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */ 36 | .highlight .ni { color: #d55537; font-weight: bold } /* Name.Entity */ 37 | .highlight .ne { color: #007020 } /* Name.Exception */ 38 | .highlight .nf { color: #06287e } /* Name.Function */ 39 | .highlight .nl { color: #002070; font-weight: bold } /* Name.Label */ 40 | .highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */ 41 | .highlight .nt { color: #062873; font-weight: bold } /* Name.Tag */ 42 | .highlight .nv { color: #bb60d5 } /* Name.Variable */ 43 | .highlight .ow { color: #007020; font-weight: bold } /* Operator.Word */ 44 | .highlight .w { color: #bbbbbb } /* Text.Whitespace */ 45 | .highlight .mb { color: #208050 } /* Literal.Number.Bin */ 46 | .highlight .mf { color: #208050 } /* Literal.Number.Float */ 47 | .highlight .mh { color: #208050 } /* Literal.Number.Hex */ 48 | .highlight .mi { color: #208050 } /* Literal.Number.Integer */ 49 | .highlight .mo { color: #208050 } /* Literal.Number.Oct */ 50 | .highlight .sa { color: #4070a0 } /* Literal.String.Affix */ 51 | .highlight .sb { color: #4070a0 } /* Literal.String.Backtick */ 52 | .highlight .sc { color: #4070a0 } /* Literal.String.Char */ 53 | .highlight .dl { color: #4070a0 } /* Literal.String.Delimiter */ 54 | .highlight .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */ 55 | .highlight .s2 { color: #4070a0 } /* Literal.String.Double */ 56 | .highlight .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */ 57 | .highlight .sh { color: #4070a0 } /* Literal.String.Heredoc */ 58 | .highlight .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */ 59 | .highlight .sx { color: #c65d09 } /* Literal.String.Other */ 60 | .highlight .sr { color: #235388 } /* Literal.String.Regex */ 61 | .highlight .s1 { color: #4070a0 } /* Literal.String.Single */ 62 | .highlight .ss { color: #517918 } /* Literal.String.Symbol */ 63 | .highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */ 64 | .highlight .fm { color: #06287e } /* Name.Function.Magic */ 65 | .highlight .vc { color: #bb60d5 } /* Name.Variable.Class */ 66 | .highlight .vg { color: #bb60d5 } /* Name.Variable.Global */ 67 | .highlight .vi { color: #bb60d5 } /* Name.Variable.Instance */ 68 | .highlight .vm { color: #bb60d5 } /* Name.Variable.Magic */ 69 | .highlight .il { color: #208050 } /* Literal.Number.Integer.Long */ -------------------------------------------------------------------------------- /docs/_build/html/_static/up-pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/html/_static/up-pressed.png -------------------------------------------------------------------------------- /docs/_build/html/_static/up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/html/_static/up.png -------------------------------------------------------------------------------- /docs/_build/html/config.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | config module — ABMHAP 2018.06 documentation 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 |
29 |
30 |
31 | 32 |
33 |

config module

34 |

This file contains the config file, which contains useful code for global parameters operations across modules.

35 |
36 | 37 | 38 |
39 |
40 |
41 | 70 |
71 |
72 | 83 | 84 | 85 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /docs/_build/html/driver_params.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | driver_params module — ABMHAP 2018.06 documentation 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 |
31 |
32 |
33 | 34 |
35 |

driver_params module

36 |

This module is responsible for containing parameters that driver.py uses to control the simulation. The user should set the parameters in this module before running the driver driver.py.

37 |
38 | 39 | 40 |
41 |
42 |
43 | 74 |
75 |
76 | 87 | 88 | 89 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /docs/_build/html/main_params.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | main_params module — ABMHAP 2018.06 documentation 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 |
31 |
32 |
33 | 34 |
35 |

main_params module

36 |

This module is responsible for containing parameters that main.py uses to control the simulation. The user should set the parameters in this module before running the driver main.py

37 |
38 |
39 | main_params.set_no_variation(num_people)[source]
40 |

This function sets the standard deviations in all of the activity-parameters to zero.

41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 |
Parameters:num_people (int) – the number of people in the simulation
Returns:a tuple of the standard deviations of all of the activity-parameters
51 |
52 | 53 |
54 | 55 | 56 |
57 |
58 |
59 | 90 |
91 |
92 | 103 | 104 | 105 | 106 | 107 | 108 | -------------------------------------------------------------------------------- /docs/_build/html/my_debug.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | my_debug module — ABMHAP 2018.06 documentation 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 |
31 |
32 |
33 | 34 |
35 |

my_debug module

36 |
37 |

Warning

38 |

This is not used as part of the ABMHAP module. This should be removed.

39 |
40 |
41 | 42 | 43 |
44 |
45 |
46 | 77 |
78 |
79 | 90 | 91 | 92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /docs/_build/html/objects.inv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/html/objects.inv -------------------------------------------------------------------------------- /docs/_build/html/search.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | Search — ABMHAP 2018.06 documentation 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 |
36 |
37 |
38 |
39 | 40 |

Search

41 |
42 | 43 |

44 | Please activate JavaScript to enable the search 45 | functionality. 46 |

47 |
48 |

49 | From here you can search these documents. Enter your search 50 | words into the box below and click "search". Note that the search 51 | function will automatically search for all of the words. Pages 52 | containing fewer words won't appear in the result list. 53 |

54 |
55 | 56 | 57 | 58 |
59 | 60 |
61 | 62 |
63 | 64 |
65 |
66 |
67 | 77 |
78 |
79 | 87 | 88 | 89 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /docs/_build/html/workplace.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | workplace module — ABMHAP 2018.06 documentation 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 |
31 |
32 |
33 | 34 |
35 |

workplace module

36 |

This module contains code for the asset that allows a person to go to work / school.

37 |

This file contains workplace.Workplace.

38 |
39 |
40 | class workplace.Workplace[source]
41 |

Bases: asset.Asset

42 |

This class allows a Person to go to work / school.

43 |

Activities in this asset: work.Work

44 |
45 | 46 |
47 | 48 | 49 |
50 |
51 |
52 | 83 |
84 |
85 | 96 | 97 | 98 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /docs/_build/latex/ABMHAP.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanExposure/AgentBasedModel/06053c72eab1577a637207278e859c212c02250b/docs/_build/latex/ABMHAP.pdf -------------------------------------------------------------------------------- /docs/_build/latex/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for Sphinx LaTeX output 2 | 3 | ALLDOCS = $(basename $(wildcard *.tex)) 4 | ALLPDF = $(addsuffix .pdf,$(ALLDOCS)) 5 | ALLDVI = $(addsuffix .dvi,$(ALLDOCS)) 6 | ALLPS = $(addsuffix .ps,$(ALLDOCS)) 7 | 8 | # Prefix for archive names 9 | ARCHIVEPREFIX = 10 | # Additional LaTeX options 11 | LATEXOPTS = 12 | # format: pdf or dvi 13 | FMT = pdf 14 | 15 | LATEX = latex 16 | PDFLATEX = pdflatex 17 | MAKEINDEX = makeindex 18 | 19 | 20 | all: $(ALLPDF) 21 | all-pdf: $(ALLPDF) 22 | all-dvi: $(ALLDVI) 23 | all-ps: $(ALLPS) 24 | 25 | all-pdf-ja: 26 | for f in *.pdf *.png *.gif *.jpg *.jpeg; do extractbb $$f; done 27 | for f in *.tex; do platex -kanji=utf8 $(LATEXOPTS) $$f; done 28 | for f in *.tex; do platex -kanji=utf8 $(LATEXOPTS) $$f; done 29 | for f in *.tex; do platex -kanji=utf8 $(LATEXOPTS) $$f; done 30 | -for f in *.idx; do mendex -U -f -d "`basename $$f .idx`.dic" -s python.ist $$f; done 31 | for f in *.tex; do platex -kanji=utf8 $(LATEXOPTS) $$f; done 32 | for f in *.tex; do platex -kanji=utf8 $(LATEXOPTS) $$f; done 33 | for f in *.dvi; do dvipdfmx $$f; done 34 | 35 | zip: all-$(FMT) 36 | mkdir $(ARCHIVEPREFIX)docs-$(FMT) 37 | cp $(ALLPDF) $(ARCHIVEPREFIX)docs-$(FMT) 38 | zip -q -r -9 $(ARCHIVEPREFIX)docs-$(FMT).zip $(ARCHIVEPREFIX)docs-$(FMT) 39 | rm -r $(ARCHIVEPREFIX)docs-$(FMT) 40 | 41 | tar: all-$(FMT) 42 | mkdir $(ARCHIVEPREFIX)docs-$(FMT) 43 | cp $(ALLPDF) $(ARCHIVEPREFIX)docs-$(FMT) 44 | tar cf $(ARCHIVEPREFIX)docs-$(FMT).tar $(ARCHIVEPREFIX)docs-$(FMT) 45 | rm -r $(ARCHIVEPREFIX)docs-$(FMT) 46 | 47 | gz: tar 48 | gzip -9 < $(ARCHIVEPREFIX)docs-$(FMT).tar > $(ARCHIVEPREFIX)docs-$(FMT).tar.gz 49 | 50 | bz2: tar 51 | bzip2 -9 -k $(ARCHIVEPREFIX)docs-$(FMT).tar 52 | 53 | xz: tar 54 | xz -9 -k $(ARCHIVEPREFIX)docs-$(FMT).tar 55 | 56 | # The number of LaTeX runs is quite conservative, but I don't expect it 57 | # to get run often, so the little extra time won't hurt. 58 | %.dvi: %.tex 59 | $(LATEX) $(LATEXOPTS) '$<' 60 | $(LATEX) $(LATEXOPTS) '$<' 61 | $(LATEX) $(LATEXOPTS) '$<' 62 | -$(MAKEINDEX) -s python.ist '$(basename $<).idx' 63 | $(LATEX) $(LATEXOPTS) '$<' 64 | $(LATEX) $(LATEXOPTS) '$<' 65 | 66 | %.pdf: %.tex 67 | $(PDFLATEX) $(LATEXOPTS) '$<' 68 | $(PDFLATEX) $(LATEXOPTS) '$<' 69 | $(PDFLATEX) $(LATEXOPTS) '$<' 70 | -$(MAKEINDEX) -s python.ist '$(basename $<).idx' 71 | $(PDFLATEX) $(LATEXOPTS) '$<' 72 | $(PDFLATEX) $(LATEXOPTS) '$<' 73 | 74 | %.ps: %.dvi 75 | dvips '$<' 76 | 77 | clean: 78 | rm -f *.log *.ind *.aux *.toc *.syn *.idx *.out *.ilg *.pla *.ps *.tar *.tar.gz *.tar.bz2 *.tar.xz $(ALLPDF) $(ALLDVI) 79 | 80 | .PHONY: all all-pdf all-dvi all-ps clean zip tar gz bz2 xz 81 | .PHONY: all-pdf-ja 82 | -------------------------------------------------------------------------------- /docs/_build/latex/python.ist: -------------------------------------------------------------------------------- 1 | line_max 100 2 | headings_flag 1 3 | heading_prefix " \\bigletter " 4 | 5 | preamble "\\begin{sphinxtheindex} 6 | \\def\\bigletter#1{{\\Large\\sffamily#1}\\nopagebreak\\vspace{1mm}} 7 | 8 | " 9 | 10 | postamble "\n\n\\end{sphinxtheindex}\n" 11 | 12 | symhead_positive "{Symbols}" 13 | numhead_positive "{Numbers}" 14 | -------------------------------------------------------------------------------- /docs/_build/latex/sphinxhowto.cls: -------------------------------------------------------------------------------- 1 | % 2 | % sphinxhowto.cls for Sphinx (http://sphinx-doc.org/) 3 | % 4 | 5 | \NeedsTeXFormat{LaTeX2e}[1995/12/01] 6 | \ProvidesClass{sphinxhowto}[2017/03/26 v1.6 Document class (Sphinx HOWTO)] 7 | 8 | % 'oneside' option overriding the 'twoside' default 9 | \newif\if@oneside 10 | \DeclareOption{oneside}{\@onesidetrue} 11 | % Pass remaining document options to the parent class. 12 | \DeclareOption*{\PassOptionsToClass{\CurrentOption}{\sphinxdocclass}} 13 | \ProcessOptions\relax 14 | 15 | % Default to two-side document 16 | \if@oneside 17 | % nothing to do (oneside is the default) 18 | \else 19 | \PassOptionsToClass{twoside}{\sphinxdocclass} 20 | \fi 21 | 22 | \LoadClass{\sphinxdocclass} 23 | 24 | % Set some sane defaults for section numbering depth and TOC depth. You can 25 | % reset these counters in your preamble. 26 | % 27 | \setcounter{secnumdepth}{2} 28 | \setcounter{tocdepth}{2}% i.e. section and subsection 29 | 30 | % Change the title page to look a bit better, and fit in with the fncychap 31 | % ``Bjarne'' style a bit better. 32 | % 33 | \renewcommand{\maketitle}{% 34 | \noindent\rule{\textwidth}{1pt}\par 35 | \begingroup % for PDF information dictionary 36 | \def\endgraf{ }\def\and{\& }% 37 | \pdfstringdefDisableCommands{\def\\{, }}% overwrite hyperref setup 38 | \hypersetup{pdfauthor={\@author}, pdftitle={\@title}}% 39 | \endgroup 40 | \begin{flushright} 41 | \sphinxlogo 42 | \py@HeaderFamily 43 | {\Huge \@title }\par 44 | {\itshape\large \py@release \releaseinfo}\par 45 | \vspace{25pt} 46 | {\Large 47 | \begin{tabular}[t]{c} 48 | \@author 49 | \end{tabular}}\par 50 | \vspace{25pt} 51 | \@date \par 52 | \py@authoraddress \par 53 | \end{flushright} 54 | \@thanks 55 | \setcounter{footnote}{0} 56 | \let\thanks\relax\let\maketitle\relax 57 | %\gdef\@thanks{}\gdef\@author{}\gdef\@title{} 58 | } 59 | 60 | \newcommand{\sphinxtableofcontents}{ 61 | \begingroup 62 | \parskip = 0mm 63 | \tableofcontents 64 | \endgroup 65 | \rule{\textwidth}{1pt} 66 | \vspace{12pt} 67 | } 68 | 69 | \@ifundefined{fancyhf}{ 70 | \pagestyle{plain}}{ 71 | \pagestyle{normal}} % start this way; change for 72 | \pagenumbering{arabic} % ToC & chapters 73 | 74 | \thispagestyle{empty} 75 | 76 | % Fix the bibliography environment to add an entry to the Table of 77 | % Contents. 78 | % For an article document class this environment is a section, 79 | % so no page break before it. 80 | % 81 | \newenvironment{sphinxthebibliography}[1]{% 82 | % \phantomsection % not needed here since TeXLive 2010's hyperref 83 | \begin{thebibliography}{1}% 84 | \addcontentsline{toc}{section}{\ifdefined\refname\refname\else\ifdefined\bibname\bibname\fi\fi}}{\end{thebibliography}} 85 | 86 | 87 | % Same for the indices. 88 | % The memoir class already does this, so we don't duplicate it in that case. 89 | % 90 | \@ifclassloaded{memoir} 91 | {\newenvironment{sphinxtheindex}{\begin{theindex}}{\end{theindex}}} 92 | {\newenvironment{sphinxtheindex}{% 93 | \phantomsection % needed because no chapter, section, ... is created by theindex 94 | \begin{theindex}% 95 | \addcontentsline{toc}{section}{\indexname}}{\end{theindex}}} 96 | -------------------------------------------------------------------------------- /docs/_build/latex/sphinxmanual.cls: -------------------------------------------------------------------------------- 1 | % 2 | % sphinxmanual.cls for Sphinx (http://sphinx-doc.org/) 3 | % 4 | 5 | \NeedsTeXFormat{LaTeX2e}[1995/12/01] 6 | \ProvidesClass{sphinxmanual}[2017/03/26 v1.6 Document class (Sphinx manual)] 7 | 8 | % chapters starting at odd pages (overridden by 'openany' document option) 9 | \PassOptionsToClass{openright}{\sphinxdocclass} 10 | 11 | % 'oneside' option overriding the 'twoside' default 12 | \newif\if@oneside 13 | \DeclareOption{oneside}{\@onesidetrue} 14 | % Pass remaining document options to the parent class. 15 | \DeclareOption*{\PassOptionsToClass{\CurrentOption}{\sphinxdocclass}} 16 | \ProcessOptions\relax 17 | 18 | % Defaults two-side document 19 | \if@oneside 20 | % nothing to do (oneside is the default) 21 | \else 22 | \PassOptionsToClass{twoside}{\sphinxdocclass} 23 | \fi 24 | 25 | \LoadClass{\sphinxdocclass} 26 | 27 | % Set some sane defaults for section numbering depth and TOC depth. You can 28 | % reset these counters in your preamble. 29 | % 30 | \setcounter{secnumdepth}{2} 31 | \setcounter{tocdepth}{1} 32 | 33 | % Change the title page to look a bit better, and fit in with the fncychap 34 | % ``Bjarne'' style a bit better. 35 | % 36 | \renewcommand{\maketitle}{% 37 | \let\spx@tempa\relax 38 | \ifHy@pageanchor\def\spx@tempa{\Hy@pageanchortrue}\fi 39 | \hypersetup{pageanchor=false}% avoid duplicate destination warnings 40 | \begin{titlepage}% 41 | \let\footnotesize\small 42 | \let\footnoterule\relax 43 | \noindent\rule{\textwidth}{1pt}\par 44 | \begingroup % for PDF information dictionary 45 | \def\endgraf{ }\def\and{\& }% 46 | \pdfstringdefDisableCommands{\def\\{, }}% overwrite hyperref setup 47 | \hypersetup{pdfauthor={\@author}, pdftitle={\@title}}% 48 | \endgroup 49 | \begin{flushright}% 50 | \sphinxlogo 51 | \py@HeaderFamily 52 | {\Huge \@title \par} 53 | {\itshape\LARGE \py@release\releaseinfo \par} 54 | \vfill 55 | {\LARGE 56 | \begin{tabular}[t]{c} 57 | \@author 58 | \end{tabular} 59 | \par} 60 | \vfill\vfill 61 | {\large 62 | \@date \par 63 | \vfill 64 | \py@authoraddress \par 65 | }% 66 | \end{flushright}%\par 67 | \@thanks 68 | \end{titlepage}% 69 | \setcounter{footnote}{0}% 70 | \let\thanks\relax\let\maketitle\relax 71 | %\gdef\@thanks{}\gdef\@author{}\gdef\@title{} 72 | \if@openright\cleardoublepage\else\clearpage\fi 73 | \spx@tempa 74 | } 75 | 76 | \newcommand{\sphinxtableofcontents}{% 77 | \pagenumbering{roman}% 78 | \pagestyle{plain}% 79 | \begingroup 80 | \parskip \z@skip 81 | \tableofcontents 82 | \endgroup 83 | % before resetting page counter, let's do the right thing. 84 | \if@openright\cleardoublepage\else\clearpage\fi 85 | \pagenumbering{arabic}% 86 | \ifdefined\fancyhf\pagestyle{normal}\fi 87 | } 88 | 89 | % This is needed to get the width of the section # area wide enough in the 90 | % library reference. Doing it here keeps it the same for all the manuals. 91 | % 92 | \renewcommand*\l@section{\@dottedtocline{1}{1.5em}{2.6em}} 93 | \renewcommand*\l@subsection{\@dottedtocline{2}{4.1em}{3.5em}} 94 | 95 | % Fix the bibliography environment to add an entry to the Table of 96 | % Contents. 97 | % For a report document class this environment is a chapter. 98 | % 99 | \newenvironment{sphinxthebibliography}[1]{% 100 | \if@openright\cleardoublepage\else\clearpage\fi 101 | % \phantomsection % not needed here since TeXLive 2010's hyperref 102 | \begin{thebibliography}{1}% 103 | \addcontentsline{toc}{chapter}{\bibname}}{\end{thebibliography}} 104 | 105 | % Same for the indices. 106 | % The memoir class already does this, so we don't duplicate it in that case. 107 | % 108 | \@ifclassloaded{memoir} 109 | {\newenvironment{sphinxtheindex}{\begin{theindex}}{\end{theindex}}} 110 | {\newenvironment{sphinxtheindex}{% 111 | \if@openright\cleardoublepage\else\clearpage\fi 112 | \phantomsection % needed as no chapter, section, ... created 113 | \begin{theindex}% 114 | \addcontentsline{toc}{chapter}{\indexname}}{\end{theindex}}} 115 | -------------------------------------------------------------------------------- /docs/activity.rst: -------------------------------------------------------------------------------- 1 | activity module 2 | =============== 3 | 4 | .. automodule:: activity 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/analysis.rst: -------------------------------------------------------------------------------- 1 | analysis module 2 | =============== 3 | 4 | .. automodule:: analysis 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/analyzer.rst: -------------------------------------------------------------------------------- 1 | analyzer module 2 | =============== 3 | 4 | .. automodule:: analyzer 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/asset.rst: -------------------------------------------------------------------------------- 1 | asset module 2 | ============ 3 | 4 | .. automodule:: asset 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/bed.rst: -------------------------------------------------------------------------------- 1 | bed module 2 | ========== 3 | 4 | .. automodule:: bed 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/bio.rst: -------------------------------------------------------------------------------- 1 | bio module 2 | ========== 3 | 4 | .. automodule:: bio 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/chad.rst: -------------------------------------------------------------------------------- 1 | chad module 2 | =========== 3 | 4 | .. automodule:: chad 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/chad_code.rst: -------------------------------------------------------------------------------- 1 | chad\_code module 2 | ================= 3 | 4 | .. automodule:: chad_code 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/chad_demography.rst: -------------------------------------------------------------------------------- 1 | chad\_demography module 2 | ======================= 3 | 4 | .. automodule:: chad_demography 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/chad_demography_adult_non_work.rst: -------------------------------------------------------------------------------- 1 | chad\_demography\_adult\_non\_work module 2 | ========================================= 3 | 4 | .. automodule:: chad_demography_adult_non_work 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/chad_demography_adult_work.rst: -------------------------------------------------------------------------------- 1 | chad\_demography\_adult\_work module 2 | ==================================== 3 | 4 | .. automodule:: chad_demography_adult_work 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/chad_demography_child_school.rst: -------------------------------------------------------------------------------- 1 | chad\_demography\_child\_school module 2 | ====================================== 3 | 4 | .. automodule:: chad_demography_child_school 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/chad_demography_child_young.rst: -------------------------------------------------------------------------------- 1 | chad\_demography\_child\_young module 2 | ===================================== 3 | 4 | .. automodule:: chad_demography_child_young 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/chad_parameter_figures.rst: -------------------------------------------------------------------------------- 1 | chad_parameter_figures notebook 2 | =============================== 3 | 4 | .. code:: ipython3 5 | 6 | # The United States Environmental Protection Agency through its Office of 7 | # Research and Development has developed this software. The code is made 8 | # publicly available to better communicate the research. All input data 9 | # used fora given application should be reviewed by the researcher so 10 | # that the model results are based on appropriate data for any given 11 | # application. This model is under continued development. The model and 12 | # data included herein do not represent and should not be construed to 13 | # represent any Agency determination or policy. 14 | # 15 | # This file was written by Dr. Namdi Brandon 16 | # ORCID: 0000-0001-7050-1538 17 | # March 20, 2018 18 | 19 | WARNING: 20 | 21 | this code may not be useful 22 | 23 | This code plots the histograms of the distributions being sampled from 24 | the CHAD data for each activity. 25 | 26 | Import 27 | 28 | .. code:: ipython3 29 | 30 | import sys 31 | sys.path.append('..\\source') 32 | sys.path.append('..\\processing') 33 | 34 | # plotting capability 35 | import matplotlib.pylab as plt 36 | 37 | # zipfile capability 38 | import zipfile 39 | 40 | # ABMHAP modules 41 | 42 | # general capability 43 | import my_globals as mg 44 | import chad_params as cp 45 | import demography as dmg 46 | 47 | import activity, analysis, chad, omni_trial, params 48 | 49 | Run 50 | 51 | .. code:: ipython3 52 | 53 | # the demographic 54 | demo = dmg.ADULT_WORK 55 | 56 | # sets of activities 57 | keys_all = mg.KEYS_ACTIVITIES 58 | 59 | # the activity codes related to not eating 60 | keys_not_eat = [mg.KEY_SLEEP, mg.KEY_WORK, mg.KEY_COMMUTE_TO_WORK, mg.KEY_COMMUTE_FROM_WORK] 61 | 62 | # the activity codes of the eating activities 63 | keys_eat = [mg.KEY_EAT_BREAKFAST, mg.KEY_EAT_LUNCH, mg.KEY_EAT_DINNER] 64 | 65 | # the chosen group of activities 66 | keys = keys_all 67 | 68 | Loop through each activity and plot the histograms of start time, end 69 | time, and duration. Note: the limitations for each activity depends on 70 | which activity parameters are being sampled 71 | 72 | .. code:: ipython3 73 | 74 | # loop through each activity and plot the histograms of start time, end time, and duration 75 | # Note: the limitations for each activity depends on which activity parameters are being sampled 76 | for k in keys: 77 | 78 | # the CHAD limiting parameters 79 | s_params = cp.OMNI[k] 80 | 81 | # get the data 82 | stats_start, stats_end, stats_dt, record = analysis.get_verification_info(demo=demo, key_activity=k, 83 | sampling_params=[s_params]) 84 | # number of the bins 85 | num_bins = 24 86 | 87 | # create subplots 88 | fig, axes = plt.subplots(2, 2) 89 | 90 | # title 91 | fig.suptitle( activity.INT_2_STR[k] ) 92 | 93 | # 94 | # plot the mean start time distribution 95 | # 96 | ax = axes[0, 0] 97 | if k == mg.KEY_SLEEP: 98 | ax.hist(mg.to_periodic(stats_start.mu.values, do_hours=True), bins=num_bins, color='blue', label='start') 99 | else: 100 | ax.hist(stats_start.mu.values, bins=num_bins, color='blue', label='start') 101 | ax.set_xlabel('hours') 102 | ax.legend(loc='best') 103 | 104 | # 105 | # plot the mean end time distribution 106 | # 107 | ax = axes[0, 1] 108 | ax.hist(stats_end.mu.values, bins=num_bins, color='green', label='end') 109 | ax.set_xlabel('hours') 110 | ax.legend(loc='best') 111 | 112 | # 113 | # plot the mean duration distribution 114 | # 115 | ax = axes[1, 0] 116 | ax.hist(stats_dt.mu.values, bins=num_bins, color='red', label='duration') 117 | ax.set_xlabel('hours') 118 | ax.legend(loc='best') 119 | 120 | # show plots 121 | plt.show() 122 | -------------------------------------------------------------------------------- /docs/chad_params.rst: -------------------------------------------------------------------------------- 1 | chad\_params module 2 | =================== 3 | 4 | .. automodule:: chad_params 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/commute.rst: -------------------------------------------------------------------------------- 1 | commute module 2 | ============== 3 | 4 | .. automodule:: commute 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/commute_from_work_trial.rst: -------------------------------------------------------------------------------- 1 | commute\_from\_work\_trial module 2 | ================================= 3 | 4 | .. automodule:: commute_from_work_trial 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/commute_school.rst: -------------------------------------------------------------------------------- 1 | commute_school notebook 2 | ======================= 3 | 4 | .. code:: ipython3 5 | 6 | # The United States Environmental Protection Agency through its Office of 7 | # Research and Development has developed this software. The code is made 8 | # publicly available to better communicate the research. All input data 9 | # used fora given application should be reviewed by the researcher so 10 | # that the model results are based on appropriate data for any given 11 | # application. This model is under continued development. The model and 12 | # data included herein do not represent and should not be construed to 13 | # represent any Agency determination or policy. 14 | # 15 | # This file was written by Dr. Namdi Brandon 16 | # ORCID: 0000-0001-7050-1538 17 | # March 22, 2018 18 | 19 | This file goes through the data from the Consoldiated Human Activity 20 | Database (CHAD) and gets information relevent to **commuting to school** 21 | and **commuting from school** and processes the data for use in the 22 | Agent-Based Model of Human Activity Patterns (ABMHAP) for the school-age 23 | children demographic. More specficially, this file does the following: 24 | 25 | For a given demographic, 26 | 27 | 1. This function goes through the CHAD data and finds the commute 28 | activity data 29 | 30 | 2. The CHAD activity data are seperated into start time, end time, 31 | duration, and CHAD record data 32 | 33 | 3. The CHAD activity data is saved into longitudinal data and 34 | single-activity data 35 | 36 | Import 37 | 38 | .. code:: ipython3 39 | 40 | import sys 41 | sys.path.append('..\\source') 42 | 43 | # ABMHAP capability 44 | import demography as dmg 45 | import datum 46 | 47 | .. code:: ipython3 48 | 49 | %matplotlib notebook 50 | 51 | Load 52 | 53 | .. code:: ipython3 54 | 55 | # 56 | # demographic 57 | # 58 | # the input file and output file directory 59 | key = dmg.CHILD_SCHOOL 60 | 61 | # the input file and output file directory 62 | fname_input, fpath_output = dmg.INT_2_FIN_FOUT_LARGE[key] 63 | 64 | # load the data 65 | data = dmg.load(fname_input) 66 | 67 | Processing data 68 | 69 | .. code:: ipython3 70 | 71 | # get the raw commute data 72 | d, d_to_school, d_from_school = datum.analyze_commute_school(data) 73 | 74 | Plotting 75 | 76 | .. code:: ipython3 77 | 78 | # 79 | # choose to save longitudinal data or single-day data 80 | # 81 | # note that N for the LONGITUDINAL DATA is 1 82 | # this was done becaause there is NOT ENOUGH LONGITUDINAL DATA for adults and working 83 | # 84 | chooser = {True: (1, fpath_output + '\\longitude'), 85 | False: (1, fpath_output + '\\solo'), } 86 | 87 | # whether to save the longitudinal data (if True) or the single-day data (if False) 88 | # there is not enough longitudinal data to have a longitudinal model 89 | do_long = False 90 | 91 | .. code:: ipython3 92 | 93 | # save the longitude data 94 | do_save = False 95 | 96 | if do_save: 97 | 98 | N, fpath = chooser[do_long] 99 | 100 | # the directories the data should be saved in 101 | fpaths = [fpath + '\\commute_to_work', fpath + '\\commute_from_work'] 102 | 103 | # the dictionaries holding the data 104 | data_dict = [d_to_school, d_from_school] 105 | 106 | # save the data 107 | for fpath, d in zip(fpaths, data_dict): 108 | 109 | stats_dt, stats_start, stats_end, record = d['stats_dt'], d['stats_start'], d['stats_end'], d['data'] 110 | 111 | if do_long: 112 | dt, start, end, rec = datum.get_longitude(stats_dt, stats_start, stats_end, record, N=N) 113 | else: 114 | dt, start, end, rec = datum.get_solo(stats_dt, stats_start, stats_end, record) 115 | 116 | datum.save(fpath, record=rec, stats_dt=dt, stats_start=start, stats_end=end) 117 | 118 | 119 | -------------------------------------------------------------------------------- /docs/commute_to_work_trial.rst: -------------------------------------------------------------------------------- 1 | commute\_to\_work\_trial module 2 | =============================== 3 | 4 | .. automodule:: commute_to_work_trial 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/commute_work.rst: -------------------------------------------------------------------------------- 1 | commute_work notebook 2 | ===================== 3 | 4 | .. code:: ipython3 5 | 6 | # The United States Environmental Protection Agency through its Office of 7 | # Research and Development has developed this software. The code is made 8 | # publicly available to better communicate the research. All input data 9 | # used fora given application should be reviewed by the researcher so 10 | # that the model results are based on appropriate data for any given 11 | # application. This model is under continued development. The model and 12 | # data included herein do not represent and should not be construed to 13 | # represent any Agency determination or policy. 14 | # 15 | # This file was written by Dr. Namdi Brandon 16 | # ORCID: 0000-0001-7050-1538 17 | # March 22, 2018 18 | 19 | This file goes through the data from the Consoldiated Human Activity 20 | Database (CHAD) and gets information relevent to **commuting to work**, 21 | **commuting from work**, and **working** and processes the data for use 22 | in the Agent-Based Model of Human Activity Patterns (ABMHAP) for the 23 | working adult demographic. More specficially, this file does the 24 | following: 25 | 26 | 1. This function goes through the CHAD data and finds the commute and 27 | work-activity data 28 | 29 | 2. The data is chosen such that events are chosen such that the work 30 | events are sandwiched between the commute to work and commtue from 31 | work event 32 | 33 | 3. The CHAD activity data are seperated into start time, end time, 34 | duration, and CHAD record data 35 | 36 | 4. The CHAD activity data is saved into longitudinal data and 37 | single-activity data 38 | 39 | Import 40 | 41 | .. code:: ipython3 42 | 43 | import sys 44 | sys.path.append('..\\source') 45 | 46 | # plotting capability 47 | import matplotlib.pylab as plt 48 | 49 | # ABMHAP modules 50 | import demography as dmg 51 | import datum 52 | 53 | .. code:: ipython3 54 | 55 | %matplotlib notebook 56 | 57 | Load 58 | 59 | .. code:: ipython3 60 | 61 | # 62 | # demographic 63 | # 64 | # the input file and output file directory 65 | key = dmg.ADULT_WORK 66 | 67 | # the input file and output file directory 68 | fname_input, fpath_output = dmg.INT_2_FIN_FOUT_LARGE[key] 69 | 70 | # load the data 71 | data = dmg.load(fname_input) 72 | 73 | Processing data 74 | 75 | .. code:: ipython3 76 | 77 | # analyze the commuting data 78 | d, d_to_work, d_from_work, d_at_work = datum.analyze_commute(data) 79 | 80 | Saving Data 81 | 82 | .. code:: ipython3 83 | 84 | # choose to save longitudinal data or single-day data 85 | # 86 | # note that N for the LONGITUDINAL DATA is 1 87 | # this was done becaause there is NOT ENOUGH LONGITUDINAL DATA for adults and working 88 | # 89 | chooser = {True: (1, fpath_output + '\\longitude'), 90 | False: (1, fpath_output + '\\solo'), } 91 | 92 | # whether to save the longitudinal data (if True) or the single-day data (if False) 93 | # there is not enough longitudinal data to have a longitudinal model 94 | do_long = True 95 | 96 | .. code:: ipython3 97 | 98 | # save the longitude data 99 | do_save = False 100 | 101 | if do_save: 102 | 103 | N, fpath = chooser[do_long] 104 | 105 | # the directories the data should be saved in 106 | fpaths = [fpath + '\\commute_to_work', fpath + '\\commute_from_work', fpath + '\\work'] 107 | 108 | # the dictionaries holding the data 109 | data_dict = [d_to_work, d_from_work, d_at_work] 110 | 111 | # save the data 112 | for fpath, d in zip(fpaths, data_dict): 113 | 114 | stats_dt, stats_start, stats_end, record = d['stats_dt'], d['stats_start'], d['stats_end'], d['data'] 115 | 116 | if do_long: 117 | dt, start, end, rec = datum.get_longitude(stats_dt, stats_start, stats_end, record, N=N) 118 | else: 119 | dt, start, end, rec = datum.get_solo(stats_dt, stats_start, stats_end, record) 120 | 121 | datum.save(fpath, record=rec, stats_dt=dt, stats_start=start, stats_end=end) 122 | 123 | -------------------------------------------------------------------------------- /docs/config.rst: -------------------------------------------------------------------------------- 1 | config module 2 | ============= 3 | 4 | .. automodule:: config 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/datum.rst: -------------------------------------------------------------------------------- 1 | datum module 2 | ============ 3 | 4 | .. automodule:: datum 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/demography.rst: -------------------------------------------------------------------------------- 1 | demography module 2 | ================= 3 | 4 | .. automodule:: demography 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/diary.rst: -------------------------------------------------------------------------------- 1 | diary module 2 | ============ 3 | 4 | .. automodule:: diary 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/driver.rst: -------------------------------------------------------------------------------- 1 | driver module 2 | ============= 3 | 4 | .. automodule:: driver 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/driver_params.rst: -------------------------------------------------------------------------------- 1 | driver\_params module 2 | ===================== 3 | 4 | .. automodule:: driver_params 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/driver_result.rst: -------------------------------------------------------------------------------- 1 | driver\_result module 2 | ===================== 3 | 4 | .. automodule:: driver_result 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/eat.rst: -------------------------------------------------------------------------------- 1 | eat module 2 | ========== 3 | 4 | .. automodule:: eat 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/eat_breakfast_trial.rst: -------------------------------------------------------------------------------- 1 | eat\_breakfast\_trial module 2 | ============================ 3 | 4 | .. automodule:: eat_breakfast_trial 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/eat_dinner_trial.rst: -------------------------------------------------------------------------------- 1 | eat\_dinner\_trial module 2 | ========================= 3 | 4 | .. automodule:: eat_dinner_trial 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/eat_lunch_trial.rst: -------------------------------------------------------------------------------- 1 | eat\_lunch\_trial module 2 | ======================== 3 | 4 | .. automodule:: eat_lunch_trial 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/eat_new.rst: -------------------------------------------------------------------------------- 1 | eat_new notebook 2 | ================ 3 | 4 | .. code:: ipython3 5 | 6 | # The United States Environmental Protection Agency through its Office of 7 | # Research and Development has developed this software. The code is made 8 | # publicly available to better communicate the research. All input data 9 | # used fora given application should be reviewed by the researcher so 10 | # that the model results are based on appropriate data for any given 11 | # application. This model is under continued development. The model and 12 | # data included herein do not represent and should not be construed to 13 | # represent any Agency determination or policy. 14 | # 15 | # This file was written by Dr. Namdi Brandon 16 | # ORCID: 0000-0001-7050-1538 17 | # March 22, 2018 18 | 19 | This file goes through the data from the Consoldiated Human Activity 20 | Database (CHAD) and gets information relevent to **eating breakfast**, 21 | **eating lunch**, and **eating dinner** and processes the data for use 22 | in the Agent-Based Model of Human Activity Patterns (ABMHAP) for each 23 | demographic. More specficially, this file does the following: 24 | 25 | For a given demographic, 26 | 27 | 1. This function goes through the CHAD data and finds the eat-activity 28 | data 29 | 30 | 2. The CHAD activity data are seperated into start time, end time, 31 | duration, and CHAD record data for the meals: breakfast, lunch, and 32 | dinner 33 | 34 | 3. The CHAD activity data is saved into longitudinal data and 35 | single-activity data 36 | 37 | Import 38 | 39 | .. code:: ipython3 40 | 41 | import sys 42 | sys.path.append('..\\source') 43 | 44 | # plotting capability 45 | import matplotlib.pylab as plt 46 | 47 | # ABMHAP modules 48 | import demography as dmg 49 | import datum 50 | 51 | .. code:: ipython3 52 | 53 | %matplotlib notebook 54 | 55 | Load data 56 | 57 | .. code:: ipython3 58 | 59 | # 60 | # the demographic 61 | # 62 | key = dmg.CHILD_YOUNG 63 | 64 | # the input file and output file directory 65 | fname_input, fpath_output = dmg.INT_2_FIN_FOUT_LARGE[key] 66 | 67 | # load the data 68 | data = dmg.load(fname_input) 69 | 70 | Process the data 71 | 72 | .. code:: ipython3 73 | 74 | # analyze the eat-activity data 75 | d_breakfast, d_lunch, d_dinner = datum.analyze_eat(data) 76 | 77 | Plot the distribution 78 | 79 | .. code:: ipython3 80 | 81 | # 82 | # plot the distribution 83 | # 84 | d = d_dinner 85 | 86 | temp = d['data'] 87 | 88 | ylabel = 'Relative Frequency' 89 | xlabel = 'Time [h]' 90 | 91 | fig, axes = plt.subplots(2,2) 92 | 93 | # start time 94 | ax = axes[0,0] 95 | 96 | datum.histogram(ax, temp.start.values, color='b', label='start') 97 | ax.set_ylabel(ylabel) 98 | ax.set_xlabel(xlabel) 99 | ax.legend(loc='best') 100 | 101 | # end time 102 | ax = axes[0, 1] 103 | datum.histogram(ax, temp.end.values, color='g', label='end') 104 | ax.set_ylabel(ylabel) 105 | ax.set_xlabel(xlabel) 106 | ax.legend(loc='best') 107 | 108 | 109 | # duration 110 | ax = axes[1, 0] 111 | datum.histogram(ax, temp.dt.values, color='r', label='duration') 112 | ax.set_ylabel(ylabel) 113 | ax.set_xlabel(xlabel) 114 | ax.legend(loc='best') 115 | 116 | plt.show() 117 | 118 | Save the data 119 | 120 | .. code:: ipython3 121 | 122 | # choose to save longitudinal data or single-day data 123 | chooser = {True: (2, fpath_output + '\\longitude'), 124 | False: (1, fpath_output + '\\solo'), } 125 | 126 | # whether to save the longitudinal data (if True) or the single-day data (if False) 127 | do_long = False 128 | 129 | .. code:: ipython3 130 | 131 | # 132 | # save the data 133 | 134 | do_save = False 135 | 136 | if do_save: 137 | 138 | N, fpath = chooser[do_long] 139 | 140 | # the directories the data should be saved in 141 | fpaths = [fpath + '\\eat_breakfast', fpath + '\\eat_lunch', fpath + '\\eat_dinner'] 142 | 143 | # the dictionaries holding the data 144 | data_dict = [d_breakfast, d_lunch, d_dinner] 145 | 146 | 147 | # save the data 148 | for fpath, d in zip(fpaths, data_dict): 149 | 150 | stats_dt, stats_start, stats_end, record = d['stats_dt'], d['stats_start'], d['stats_end'], d['data'] 151 | 152 | if do_long: 153 | dt, start, end, rec = datum.get_longitude(stats_dt, stats_start, stats_end, record, N=N) 154 | else: 155 | dt, start, end, rec = datum.get_solo(stats_dt, stats_start, stats_end, record) 156 | 157 | datum.save(fpath, record=rec, stats_dt=dt, stats_start=start, stats_end=end) 158 | 159 | 160 | -------------------------------------------------------------------------------- /docs/evaluation.rst: -------------------------------------------------------------------------------- 1 | evaluation module 2 | ================= 3 | 4 | .. automodule:: evaluation 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/fig_driver.rst: -------------------------------------------------------------------------------- 1 | fig\_driver module 2 | ================== 3 | 4 | .. automodule:: fig_driver 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/food.rst: -------------------------------------------------------------------------------- 1 | food module 2 | =========== 3 | 4 | .. automodule:: food 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/full_save.rst: -------------------------------------------------------------------------------- 1 | 2 | .. code:: ipython3 3 | 4 | # The United States Environmental Protection Agency through its Office of 5 | # Research and Development has developed this software. The code is made 6 | # publicly available to better communicate the research. All input data 7 | # used fora given application should be reviewed by the researcher so 8 | # that the model results are based on appropriate data for any given 9 | # application. This model is under continued development. The model and 10 | # data included herein do not represent and should not be construed to 11 | # represent any Agency determination or policy. 12 | # 13 | # This file was written by Dr. Namdi Brandon 14 | # ORCID: 0000-0001-7050-1538 15 | # March 22, 2018 16 | 17 | This notebook is **only used for development**. 18 | 19 | This notebook is in charge of saving data and files in a compressed 20 | format as .zip files by doing the following: 21 | 22 | 1. save demographic data originally found in the 'data\_large' directory 23 | in the compressed form used by the ABMHAP in the 'data' directory 24 | 25 | 2. save the entire directory containing the ABMHAP directory in a 26 | compressed (.zip) format 27 | 28 | Import 29 | 30 | .. code:: ipython3 31 | 32 | import os, sys 33 | sys.path.append('..\\source') 34 | 35 | # ABMHAP modules 36 | import my_globals as mg 37 | 38 | import demography as dmg 39 | import chad 40 | 41 | Save the files releated to the demographics 42 | 43 | .. code:: ipython3 44 | 45 | # 46 | # the demographic 47 | # 48 | demo = dmg.CHILD_SCHOOL 49 | 50 | .. code:: ipython3 51 | 52 | # number of characters to not include: '.zip' 53 | n_char = 4 54 | 55 | # chooser 56 | # (the outfile directory for each demographic with no .zip ending, the source directory to compress) 57 | chooser_fout_source = { dmg.ADULT_WORK: (chad.FNAME_ADULT_WORK[:-n_char], chad.FDIR_ADULT_WORK_LARGE), 58 | dmg.ADULT_NON_WORK: (chad.FNAME_ADULT_NON_WORK[:-n_char], chad.FDIR_ADULT_NON_WORK_LARGE), 59 | dmg.CHILD_SCHOOL: (chad.FNAME_CHILD_SCHOOL[:-n_char], chad.FDIR_CHILD_SCHOOL_LARGE), 60 | dmg.CHILD_YOUNG: (chad.FNAME_CHILD_YOUNG[:-n_char], chad.FDIR_CHILD_YOUNG_LARGE), 61 | } 62 | 63 | # the outfile name (no .zip ending) 64 | fname, source_dir = chooser_fout_source[demo] 65 | 66 | 67 | .. code:: ipython3 68 | 69 | # 70 | # Save (zip) a directory about the demographics 71 | # 72 | # save flag 73 | do_save = False 74 | 75 | # save the data 76 | if do_save: 77 | mg.save_zip(out_file=fname, source_dir=source_dir) 78 | 79 | Save (zip) the entire directory for the ABMHAP code as a compressed file 80 | 81 | .. code:: ipython3 82 | 83 | # 84 | # saving parameters 85 | # 86 | 87 | # save (zip) the entire directory that contains the ABMHAP code 88 | # this is the directory to be compressed 89 | fpath_src = os.path.dirname( os.getcwd() ) 90 | 91 | # file directory 92 | fpath = os.getcwd() 93 | 94 | for i in range(3): 95 | fpath = os.path.dirname(fpath) 96 | 97 | # the file name of the save .zip file with out the .zip extension 98 | fname_out = fpath + '\\ABMHAP' # with no .zip 99 | 100 | .. code:: ipython3 101 | 102 | # 103 | # save the directory 104 | # 105 | 106 | # save flag 107 | do_save_abm_dir = False 108 | 109 | if do_save_abm_dir: 110 | mg.save_zip(out_file=fname_out, source_dir=fpath_src) 111 | -------------------------------------------------------------------------------- /docs/home.rst: -------------------------------------------------------------------------------- 1 | home module 2 | =========== 3 | 4 | .. automodule:: home 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/hunger.rst: -------------------------------------------------------------------------------- 1 | hunger module 2 | ============= 3 | 4 | .. automodule:: hunger 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/icf.rst: -------------------------------------------------------------------------------- 1 | 2 | .. code:: ipython3 3 | 4 | # The United States Environmental Protection Agency through its Office of 5 | # Research and Development has developed this software. The code is made 6 | # publicly available to better communicate the research. All input data 7 | # used fora given application should be reviewed by the researcher so 8 | # that the model results are based on appropriate data for any given 9 | # application. This model is under continued development. The model and 10 | # data included herein do not represent and should not be construed to 11 | # represent any Agency determination or policy. 12 | # 13 | # This file was written by Dr. Namdi Brandon 14 | # ORCID: 0000-0001-7050-1538 15 | # March 20, 2018 16 | 17 | import 18 | 19 | .. code:: ipython3 20 | 21 | import os, sys 22 | sys.path.append('..\\source') 23 | sys.path.append('..\\processing') 24 | 25 | # data frame capability 26 | import pandas as pd 27 | 28 | # ABMHAP modules 29 | import my_globals as mg 30 | import demography as dmg 31 | 32 | 33 | function 34 | 35 | .. code:: ipython3 36 | 37 | def add_id(df_list): 38 | 39 | """ 40 | Add the agent identifier to the activity diaries. 41 | 42 | :param df_list: the activity diaries 43 | :type df_list: list of pandas.core.frame.DataFrame 44 | """ 45 | 46 | for i, df in enumerate(df_list): 47 | df['id'] = i+1 48 | 49 | return df_list 50 | 51 | def save(df, fname): 52 | 53 | # copy the data 54 | x = df.copy() 55 | 56 | # add +1 to day for ICF 57 | x.day = x.day + 1 58 | 59 | # create the directory for the save file if it does not exist 60 | os.makedirs(os.path.dirname(fname), exist_ok=True) 61 | 62 | # save the data frame 63 | x.to_csv(fname, index=False) 64 | 65 | return 66 | 67 | 68 | run 69 | 70 | .. code:: ipython3 71 | 72 | # get the file name 73 | fpath_load_data = mg.FDIR_MY_DATA + '\\with_without_variation\\n8192_d364_with_variation' 74 | fname_load_data = fpath_load_data + '\\data_adult_work.pkl' 75 | 76 | .. code:: ipython3 77 | 78 | # load the driver_result object 79 | x = mg.load(fname_load_data) 80 | 81 | .. code:: ipython3 82 | 83 | # list of each data frame 84 | df_list = x.get_all_data() 85 | 86 | # add unique identifiers for ICF 87 | df_list = add_id(df_list) 88 | 89 | # get the name of the columns to include the id as the first column instead of the last 90 | colnames = df_list[0].columns.values.tolist() 91 | colnames = [ colnames[-1] ] + colnames[:-1] 92 | 93 | # set the reorder the columns for each dataframe 94 | df_list = [df[colnames] for df in df_list] 95 | 96 | # combine the data into one dataframe 97 | df_all = pd.concat(df_list) 98 | 99 | .. code:: ipython3 100 | 101 | # 102 | # save parameters 103 | # 104 | 105 | # file directory to save the data in 106 | fpath = mg.FDIR_MY_DATA + '\\icf' 107 | 108 | # the file name of the file to save 109 | chooser = {dmg.ADULT_WORK: '\\adult_work.csv', 110 | dmg.ADULT_NON_WORK: '\\adult_non_work.csv', 111 | dmg.CHILD_SCHOOL: '\\child_school.csv', 112 | dmg.CHILD_YOUNG: '\\child_young.csv', 113 | } 114 | 115 | # the full file name 116 | fname_save = fpath + chooser[x.demographic] 117 | 118 | # print the full file name 119 | print(fname_save) 120 | 121 | 122 | .. parsed-literal:: 123 | 124 | ..\my_data\icf\adult_work.csv 125 | 126 | 127 | .. code:: ipython3 128 | 129 | # 130 | # save the data 131 | # 132 | 133 | do_save = False 134 | 135 | if do_save: 136 | save(df_all, fname_save) 137 | 138 | -------------------------------------------------------------------------------- /docs/income.rst: -------------------------------------------------------------------------------- 1 | income module 2 | ============= 3 | 4 | .. automodule:: income 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/interrupt.rst: -------------------------------------------------------------------------------- 1 | interrupt module 2 | ================ 3 | 4 | .. automodule:: interrupt 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/interruption.rst: -------------------------------------------------------------------------------- 1 | interruption module 2 | =================== 3 | 4 | .. automodule:: interruption 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/location.rst: -------------------------------------------------------------------------------- 1 | location module 2 | =============== 3 | 4 | .. automodule:: location 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/main.rst: -------------------------------------------------------------------------------- 1 | main module 2 | =========== 3 | 4 | .. automodule:: main 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/main_params.rst: -------------------------------------------------------------------------------- 1 | main\_params module 2 | =================== 3 | 4 | .. automodule:: main_params 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | pushd %~dp0 4 | 5 | REM Command file for Sphinx documentation 6 | 7 | if "%SPHINXBUILD%" == "" ( 8 | set SPHINXBUILD=sphinx-build 9 | ) 10 | set SOURCEDIR=. 11 | set BUILDDIR=_build 12 | set SPHINXPROJ=ABMHAP 13 | 14 | if "%1" == "" goto help 15 | 16 | %SPHINXBUILD% >NUL 2>NUL 17 | if errorlevel 9009 ( 18 | echo. 19 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 20 | echo.installed, then set the SPHINXBUILD environment variable to point 21 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 22 | echo.may add the Sphinx directory to PATH. 23 | echo. 24 | echo.If you don't have Sphinx installed, grab it from 25 | echo.http://sphinx-doc.org/ 26 | exit /b 1 27 | ) 28 | 29 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% 30 | goto end 31 | 32 | :help 33 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% 34 | 35 | :end 36 | popd 37 | -------------------------------------------------------------------------------- /docs/meal.rst: -------------------------------------------------------------------------------- 1 | meal module 2 | =========== 3 | 4 | .. automodule:: meal 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/my_debug.rst: -------------------------------------------------------------------------------- 1 | my\_debug module 2 | ================ 3 | 4 | .. automodule:: my_debug 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/my_globals.rst: -------------------------------------------------------------------------------- 1 | my\_globals module 2 | ================== 3 | 4 | .. automodule:: my_globals 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/need.rst: -------------------------------------------------------------------------------- 1 | need module 2 | =========== 3 | 4 | .. automodule:: need 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/occupation.rst: -------------------------------------------------------------------------------- 1 | occupation module 2 | ================= 3 | 4 | .. automodule:: occupation 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/omni_trial.rst: -------------------------------------------------------------------------------- 1 | omni\_trial module 2 | ================== 3 | 4 | .. automodule:: omni_trial 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/output.rst: -------------------------------------------------------------------------------- 1 | output module 2 | ============= 3 | 4 | .. automodule:: output 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/params.rst: -------------------------------------------------------------------------------- 1 | params module 2 | ============= 3 | 4 | .. automodule:: params 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/person.rst: -------------------------------------------------------------------------------- 1 | person module 2 | ============= 3 | 4 | .. automodule:: person 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/plotter.rst: -------------------------------------------------------------------------------- 1 | plotter module 2 | ============== 3 | 4 | .. automodule:: plotter 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/rest.rst: -------------------------------------------------------------------------------- 1 | rest module 2 | =========== 3 | 4 | .. automodule:: rest 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/scenario.rst: -------------------------------------------------------------------------------- 1 | scenario module 2 | =============== 3 | 4 | .. automodule:: scenario 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/scheduler.rst: -------------------------------------------------------------------------------- 1 | scheduler module 2 | ================ 3 | 4 | .. automodule:: scheduler 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/school_new.rst: -------------------------------------------------------------------------------- 1 | school_new notebook 2 | =================== 3 | 4 | .. code:: ipython3 5 | 6 | # The United States Environmental Protection Agency through its Office of 7 | # Research and Development has developed this software. The code is made 8 | # publicly available to better communicate the research. All input data 9 | # used fora given application should be reviewed by the researcher so 10 | # that the model results are based on appropriate data for any given 11 | # application. This model is under continued development. The model and 12 | # data included herein do not represent and should not be construed to 13 | # represent any Agency determination or policy. 14 | # 15 | # This file was written by Dr. Namdi Brandon 16 | # ORCID: 0000-0001-7050-1538 17 | # March 22, 2018 18 | 19 | This file goes through the data from the Consoldiated Human Activity 20 | Database (CHAD) and gets information relevent to \*\* school\*\* and 21 | processes the data for use in the Agent-Based Model of Human Activity 22 | Patterns (ABMHAP) for the school-age children demographic. More 23 | specficially, this file does the following: 24 | 25 | For school-age children demographic, 26 | 27 | 1. This function goes through the CHAD data and finds the school 28 | activity data 29 | 30 | 2. The CHAD activity data are seperated into start time, end time, 31 | duration, and CHAD record data 32 | 33 | 3. The CHAD activity data is saved into longitudinal data and 34 | single-activity data 35 | 36 | import 37 | 38 | .. code:: ipython3 39 | 40 | import sys 41 | sys.path.append('..\\source') 42 | 43 | # ABMHAP modules 44 | import demography as dmg 45 | import datum 46 | 47 | load data 48 | 49 | .. code:: ipython3 50 | 51 | # 52 | # demographic 53 | # 54 | key = dmg.CHILD_SCHOOL 55 | 56 | fname_input, fpath_output = dmg.INT_2_FIN_FOUT_LARGE[key] 57 | 58 | # load the data 59 | data = dmg.load(fname_input) 60 | 61 | process the data 62 | 63 | .. code:: ipython3 64 | 65 | # dictionaries about the moments 66 | d = datum.analyze_education(data) 67 | 68 | save the data 69 | 70 | .. code:: ipython3 71 | 72 | # choose to save longitudinal data or single-day data 73 | chooser = {True: (2, fpath_output + '\\longitude'), 74 | False: (1, fpath_output + '\\solo'), } 75 | 76 | # whether to save the longitudinal data (if True) or the single-day data (if False) 77 | do_long = True 78 | 79 | .. code:: ipython3 80 | 81 | # 82 | # save the data 83 | # 84 | do_save = False 85 | 86 | if do_save: 87 | 88 | N, fpath = chooser[do_long] 89 | 90 | # the directory the data should be saved in 91 | fpath = fpath + '\\education' 92 | 93 | # save the data 94 | stats_dt, stats_start, stats_end, record = d['stats_dt'], d['stats_start'], d['stats_end'], d['data'] 95 | 96 | if do_long: 97 | dt, start, end, rec = datum.get_longitude(stats_dt, stats_start, stats_end, record, N=N) 98 | else: 99 | dt, start, end, rec = datum.get_solo(stats_dt, stats_start, stats_end, record) 100 | 101 | datum.save(fpath, record=rec, stats_dt=dt, stats_start=start, stats_end=end) 102 | 103 | -------------------------------------------------------------------------------- /docs/singleton.rst: -------------------------------------------------------------------------------- 1 | singleton module 2 | ================ 3 | 4 | .. automodule:: singleton 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/sleep.rst: -------------------------------------------------------------------------------- 1 | sleep module 2 | ============ 3 | 4 | .. automodule:: sleep 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/sleep_new.rst: -------------------------------------------------------------------------------- 1 | sleep_new notebook 2 | ================== 3 | 4 | .. code:: ipython3 5 | 6 | # The United States Environmental Protection Agency through its Office of 7 | # Research and Development has developed this software. The code is made 8 | # publicly available to better communicate the research. All input data 9 | # used fora given application should be reviewed by the researcher so 10 | # that the model results are based on appropriate data for any given 11 | # application. This model is under continued development. The model and 12 | # data included herein do not represent and should not be construed to 13 | # represent any Agency determination or policy. 14 | # 15 | # This file was written by Dr. Namdi Brandon 16 | # ORCID: 0000-0001-7050-1538 17 | # March 22, 2018 18 | 19 | This file goes through the data from the Consoldiated Human Activity 20 | Database (CHAD) and gets information relevent to **sleeping** and 21 | processes the data for use in the Agent-Based Model of Human Activity 22 | Patterns (ABMHAP) for each demographic. More specficially, this file 23 | does the following: 24 | 25 | For a given demographic, 26 | 27 | 1. This function goes through the CHAD data and finds the sleep-activity 28 | data 29 | 30 | 2. The CHAD activity data are seperated into start time, end time, 31 | duration, and CHAD record data 32 | 33 | 3. The CHAD activity data is saved into longitudinal data and 34 | single-activity data 35 | 36 | Import 37 | 38 | .. code:: ipython3 39 | 40 | import sys 41 | sys.path.append('..\\source') 42 | 43 | # plotting capability 44 | import matplotlib.pylab as plt 45 | 46 | # ABMHAP modules 47 | import demography as dmg 48 | import my_globals as mg 49 | import datum 50 | 51 | .. code:: ipython3 52 | 53 | %matplotlib notebook 54 | 55 | Load 56 | 57 | .. code:: ipython3 58 | 59 | # 60 | # demographic 61 | # 62 | demo = dmg.CHILD_YOUNG 63 | 64 | # the input file and output file directory 65 | fname_input, fpath_output = dmg.INT_2_FIN_FOUT_LARGE[key] 66 | 67 | # load the data 68 | data = dmg.load(fname_input) 69 | 70 | Process data 71 | 72 | .. code:: ipython3 73 | 74 | # analyze the data 75 | d_slumber = datum.analyze_sleep(data) 76 | 77 | .. code:: ipython3 78 | 79 | # get the statistical data 80 | d = d_slumber 81 | 82 | slumber, stats_dt, stats_start, stats_end = d['data'], d['stats_dt'], d['stats_start'], d['stats_end'] 83 | 84 | slumber_we, stats_we_dt, stats_we_start, stats_we_end = \ 85 | d['data_weekend'], d['stats_we_dt'], d['stats_we_start'], d['stats_we_end'] 86 | 87 | slumber_wd, stats_wd_dt, stats_wd_start, stats_wd_end = \ 88 | d['data_weekday'], d['stats_wd_dt'], d['stats_wd_start'], d['stats_wd_end'] 89 | 90 | save the data 91 | 92 | .. code:: ipython3 93 | 94 | # the minimum number of activity entries per individual to be considered longitudinal 95 | N_long = 2 96 | 97 | # there is not much longitudinal information of pre-school children 98 | if demo in [dmg.CHILD_YOUNG]: 99 | N_long = 1 100 | 101 | # choose to save longitudinal data or single-day data 102 | chooser = {True: (N_long, fpath_output + '\\longitude'), 103 | False: (1, fpath_output + '\\solo'), } 104 | 105 | # whether to save the longitudinal data (if True) or the single-day data (if False) 106 | do_long = True 107 | 108 | .. code:: ipython3 109 | 110 | # save the and solo data 111 | do_save = False 112 | 113 | if do_save: 114 | 115 | N, fpath = chooser[do_long] 116 | 117 | if do_long: 118 | data_all = datum.get_longitude(stats_dt, stats_start, stats_end, slumber, N=N) 119 | data_weekend = datum.get_longitude(stats_we_dt, stats_we_start, stats_we_end, slumber_we, N=N) 120 | data_weekday = datum.get_longitude(stats_wd_dt, stats_wd_start, stats_wd_end, slumber_wd, N=N) 121 | else: 122 | data_all = datum.get_solo(stats_dt, stats_start, stats_end, slumber) 123 | data_weekend = datum.get_solo(stats_we_dt, stats_we_start, stats_we_end, slumber_we) 124 | data_weekday = datum.get_solo(stats_wd_dt, stats_wd_start, stats_wd_end, slumber_wd) 125 | 126 | # the directories the data should be saved in 127 | fpath = fpath + '\\sleep' 128 | fpaths = [ fpath + '\\all', fpath + '\\non_workday', fpath + '\\workday' ] 129 | 130 | # the dictionaries holding the data 131 | data_list = [data_all, data_weekend, data_weekday] 132 | 133 | # save the data 134 | for fpath, d in zip(fpaths, data_list): 135 | 136 | stats_dt, stats_start, stats_end, record = d 137 | datum.save(fpath, record=record, stats_dt=stats_dt, stats_start=stats_start, stats_end=stats_end) 138 | 139 | -------------------------------------------------------------------------------- /docs/sleep_trial.rst: -------------------------------------------------------------------------------- 1 | sleep\_trial module 2 | =================== 3 | 4 | .. automodule:: sleep_trial 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/social.rst: -------------------------------------------------------------------------------- 1 | social module 2 | ============= 3 | 4 | .. automodule:: social 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/state.rst: -------------------------------------------------------------------------------- 1 | state module 2 | ============ 3 | 4 | .. automodule:: state 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/temporal.rst: -------------------------------------------------------------------------------- 1 | temporal module 2 | =============== 3 | 4 | .. automodule:: temporal 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/transport.rst: -------------------------------------------------------------------------------- 1 | transport module 2 | ================ 3 | 4 | .. automodule:: transport 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/travel.rst: -------------------------------------------------------------------------------- 1 | travel module 2 | ============= 3 | 4 | .. automodule:: travel 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/trial.rst: -------------------------------------------------------------------------------- 1 | trial module 2 | ============ 3 | 4 | .. automodule:: trial 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/universe.rst: -------------------------------------------------------------------------------- 1 | universe module 2 | =============== 3 | 4 | .. automodule:: universe 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/variation.rst: -------------------------------------------------------------------------------- 1 | variation module 2 | ================ 3 | 4 | .. automodule:: variation 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/work.rst: -------------------------------------------------------------------------------- 1 | work module 2 | =========== 3 | 4 | .. automodule:: work 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/work_new.rst: -------------------------------------------------------------------------------- 1 | 2 | .. code:: ipython3 3 | 4 | # The United States Environmental Protection Agency through its Office of 5 | # Research and Development has developed this software. The code is made 6 | # publicly available to better communicate the research. All input data 7 | # used fora given application should be reviewed by the researcher so 8 | # that the model results are based on appropriate data for any given 9 | # application. This model is under continued development. The model and 10 | # data included herein do not represent and should not be construed to 11 | # represent any Agency determination or policy. 12 | # 13 | # This file was written by Dr. Namdi Brandon 14 | # ORCID: 0000-0001-7050-1538 15 | # March 22, 2018 16 | 17 | **This file is NOT used** in order to load the appropriate data. 18 | 19 | See **commute\_work.ipynb** notebook instead 20 | 21 | import 22 | 23 | .. code:: ipython3 24 | 25 | # plotting capability 26 | import matplotlib.pylab as plt 27 | 28 | # import 29 | import os 30 | 31 | # ABMHAP modules 32 | from datum import * 33 | 34 | import my_globals as mg 35 | 36 | run 37 | 38 | .. code:: ipython3 39 | 40 | # the file where the raw data will be pickled 41 | fpath = os.path.dirname( os.getcwd() ) + '\\my_data' 42 | fname = fpath + '\\data_raw.pkl' 43 | 44 | .. code:: ipython3 45 | 46 | # save and load data as a pkl file 47 | do_save = False 48 | do_load = False 49 | 50 | .. code:: ipython3 51 | 52 | if do_load: 53 | data = mg.load(fname) 54 | else: 55 | data = chad.CHAD_RAW(min_age=social.ADULT_AGE, max_age=social.MAX_AGE) 56 | 57 | 58 | .. parsed-literal:: 59 | 60 | M:\Net MyDocuments\research\code\HEM\abm\source\chad.py:246: DtypeWarning: Columns (1) have mixed types. Specify dtype option on import or set low_memory=False. 61 | self.quest = self.get_quest() 62 | C:\Users\nbrandon\AppData\Local\Continuum\Anaconda3\lib\site-packages\ipykernel\__main__.py:4: DtypeWarning: Columns (4,5) have mixed types. Specify dtype option on import or set low_memory=False. 63 | 64 | 65 | save 66 | 67 | .. code:: ipython3 68 | 69 | if do_save: 70 | mg.save(data, fname) 71 | 72 | The order for getting work data 73 | 74 | 1. Get the CHADIDs that are for employed, fulltime workers 75 | 76 | 2. Get the work events data from employed, fulltime workers 77 | 78 | 3. Calculate the longitudinal data in order to sum ajacent periods and 79 | merge events from before midnight to after midnight 80 | 81 | 4. Make 1 work event starting from the first event and ending on the 82 | last event 83 | 84 | .. code:: ipython3 85 | 86 | d_raw, d_long, d_full = analyze_work(data) 87 | 88 | 89 | .. parsed-literal:: 90 | 91 | loading work data... 92 | calculating longitudinal data... 93 | calculating fulltime data... 94 | analyzing moments... 95 | 96 | 97 | .. code:: ipython3 98 | 99 | # the activity data 100 | d = d_full 101 | 102 | .. code:: ipython3 103 | 104 | x = d['stats_end'] 105 | y = d['stats_start'] 106 | 107 | plot 108 | 109 | .. code:: ipython3 110 | 111 | plt.figure(1) 112 | histogram( x.mu.values, color='green' ) 113 | 114 | plt.figure(2) 115 | histogram( y.mu.values, color='blue' ) 116 | 117 | plt.show() 118 | -------------------------------------------------------------------------------- /docs/work_trial.rst: -------------------------------------------------------------------------------- 1 | work\_trial module 2 | ================== 3 | 4 | .. automodule:: work_trial 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/workplace.rst: -------------------------------------------------------------------------------- 1 | workplace module 2 | ================ 3 | 4 | .. automodule:: workplace 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /my_data/example_output.csv: -------------------------------------------------------------------------------- 1 | day,start,end,dt,act,loc 2 | 0,16.0,18.966666666666665,2.966666666666667,-1.0,0.0 3 | 0,18.966666666666665,19.683333333333334,0.7166666666666667,4.0,0.0 4 | 0,19.683333333333334,21.883333333333333,2.2,-1.0,0.0 5 | 0,21.883333333333333,7.85,9.966666666666667,6.0,0.0 6 | 1,7.85,8.116666666666667,0.26666666666666666,-1.0,0.0 7 | 1,8.116666666666667,8.333333333333334,0.21666666666666667,3.0,0.0 8 | 1,8.333333333333334,8.5,0.16666666666666666,-1.0,0.0 9 | 1,8.5,9.0,0.5,2.0,1.0 10 | 1,9.0,11.933333333333334,2.933333333333333,7.0,3.0 11 | 1,11.933333333333334,12.483333333333333,0.55,5.0,3.0 12 | 1,12.483333333333333,17.0,4.516666666666667,7.0,3.0 13 | 1,17.0,17.5,0.5,1.0,1.0 14 | 1,17.5,18.966666666666665,1.4666666666666666,-1.0,0.0 15 | 1,18.966666666666665,19.733333333333334,0.7666666666666667,4.0,0.0 16 | 1,19.733333333333334,21.666666666666668,1.9333333333333333,-1.0,0.0 17 | 1,21.666666666666668,8.033333333333333,10.366666666666667,6.0,0.0 18 | 2,8.033333333333333,8.416666666666666,0.38333333333333336,3.0,0.0 19 | 2,8.416666666666666,8.75,0.3333333333333333,-1.0,0.0 20 | 2,8.75,9.15,0.4,2.0,1.0 21 | 2,9.15,12.183333333333334,3.033333333333333,7.0,3.0 22 | 2,12.183333333333334,12.85,0.6666666666666666,5.0,3.0 23 | 2,12.85,17.033333333333335,4.183333333333334,7.0,3.0 24 | 2,17.033333333333335,17.633333333333333,0.6,1.0,1.0 25 | 2,17.633333333333333,19.05,1.4166666666666667,-1.0,0.0 26 | 2,19.05,19.766666666666666,0.7166666666666667,4.0,0.0 27 | 2,19.766666666666666,22.2,2.433333333333333,-1.0,0.0 28 | 2,22.2,7.866666666666666,9.666666666666666,6.0,0.0 29 | 3,7.866666666666666,7.883333333333334,0.016666666666666666,-1.0,0.0 30 | 3,7.883333333333334,8.1,0.21666666666666667,3.0,0.0 31 | 3,8.1,8.333333333333334,0.23333333333333334,-1.0,0.0 32 | 3,8.333333333333334,8.833333333333334,0.5,2.0,1.0 33 | 3,8.833333333333334,11.883333333333333,3.05,7.0,3.0 34 | 3,11.883333333333333,12.316666666666666,0.43333333333333335,5.0,3.0 35 | 3,12.316666666666666,16.966666666666665,4.65,7.0,3.0 36 | 3,16.966666666666665,17.566666666666666,0.6,1.0,1.0 37 | 3,17.566666666666666,18.916666666666668,1.35,-1.0,0.0 38 | 3,18.916666666666668,19.65,0.7333333333333333,4.0,0.0 39 | 3,19.65,21.733333333333334,2.0833333333333335,-1.0,0.0 40 | 3,21.733333333333334,8.266666666666667,10.533333333333333,6.0,0.0 41 | 4,8.266666666666667,8.483333333333333,0.21666666666666667,3.0,0.0 42 | 4,8.483333333333333,9.066666666666666,0.5833333333333334,2.0,1.0 43 | 4,9.066666666666666,12.116666666666667,3.05,7.0,3.0 44 | 4,12.116666666666667,12.483333333333333,0.36666666666666664,5.0,3.0 45 | 4,12.483333333333333,16.95,4.466666666666667,7.0,3.0 46 | 4,16.95,17.516666666666666,0.5666666666666667,1.0,1.0 47 | 4,17.516666666666666,19.016666666666666,1.5,-1.0,0.0 48 | 4,19.016666666666666,19.783333333333335,0.7666666666666667,4.0,0.0 49 | 4,19.783333333333335,22.0,2.216666666666667,-1.0,0.0 50 | 4,22.0,7.8,9.8,6.0,0.0 51 | 5,7.8,7.883333333333334,0.08333333333333333,-1.0,0.0 52 | 5,7.883333333333334,8.183333333333334,0.3,3.0,0.0 53 | 5,8.183333333333334,8.533333333333333,0.35,-1.0,0.0 54 | 5,8.533333333333333,9.0,0.4666666666666667,2.0,1.0 55 | 5,9.0,12.216666666666667,3.216666666666667,7.0,3.0 56 | 5,12.216666666666667,12.75,0.5333333333333333,5.0,3.0 57 | 5,12.75,17.016666666666666,4.266666666666667,7.0,3.0 58 | 5,17.016666666666666,17.45,0.43333333333333335,1.0,1.0 59 | 5,17.45,19.116666666666667,1.6666666666666667,-1.0,0.0 60 | 5,19.116666666666667,19.883333333333333,0.7666666666666667,4.0,0.0 61 | 5,19.883333333333333,21.75,1.8666666666666667,-1.0,0.0 62 | 5,21.75,8.05,10.3,6.0,0.0 63 | 6,8.05,8.15,0.1,-1.0,0.0 64 | 6,8.15,8.433333333333334,0.2833333333333333,3.0,0.0 65 | 6,8.433333333333334,11.85,3.4166666666666665,-1.0,0.0 66 | 6,11.85,12.216666666666667,0.36666666666666664,5.0,0.0 67 | 6,12.216666666666667,19.066666666666666,6.85,-1.0,0.0 68 | 6,19.066666666666666,19.816666666666666,0.75,4.0,0.0 69 | 6,19.816666666666666,21.916666666666668,2.1,-1.0,0.0 70 | 6,21.916666666666668,7.8,9.883333333333333,6.0,0.0 71 | 7,7.8,7.883333333333334,0.08333333333333333,-1.0,0.0 72 | 7,7.883333333333334,8.183333333333334,0.3,3.0,0.0 73 | 7,8.183333333333334,12.066666666666666,3.8833333333333333,-1.0,0.0 74 | 7,12.066666666666666,12.583333333333334,0.5166666666666667,5.0,0.0 75 | 7,12.583333333333334,19.083333333333332,6.5,-1.0,0.0 76 | 7,19.083333333333332,19.816666666666666,0.7333333333333333,4.0,0.0 77 | 7,19.816666666666666,22.433333333333334,2.6166666666666667,-1.0,0.0 78 | 7,22.433333333333334,24.0,1.5666666666666667,6.0,0.0 79 | -------------------------------------------------------------------------------- /run_chad/driver_params.py: -------------------------------------------------------------------------------- 1 | # The United States Environmental Protection Agency through its Office of 2 | # Research and Development has developed this software. The code is made 3 | # publicly available to better communicate the research. All input data 4 | # used fora given application should be reviewed by the researcher so 5 | # that the model results are based on appropriate data for any given 6 | # application. This model is under continued development. The model and 7 | # data included herein do not represent and should not be construed to 8 | # represent any Agency determination or policy. 9 | # 10 | # This file was written by Dr. Namdi Brandon 11 | # ORCID: 0000-0001-7050-1538 12 | # March 22, 2018 13 | 14 | """ 15 | This module is responsible for containing parameters that driver.py uses to control \ 16 | the simulation. The user should set the parameters in this module **before** \ 17 | running the driver :literal:`driver.py`. 18 | 19 | .. moduleauthor:: Dr. Namdi Brandon 20 | """ 21 | 22 | # =========================================== 23 | # import 24 | # =========================================== 25 | import sys 26 | sys.path.append('..\\processing') 27 | sys.path.append('..\\source') 28 | 29 | # agent-based model modules 30 | import my_globals as mg 31 | import demography as dmg 32 | import trial 33 | 34 | # =========================================== 35 | # default constants 36 | # =========================================== 37 | 38 | # the default number of days in the simulation 39 | NUM_DAYS = 7 40 | 41 | # the default number of additional hours in the simulation 42 | NUM_HOURS = 0 43 | 44 | # the default number of additional minutes in the simulation 45 | NUM_MIN = 0 46 | 47 | # the default number of people per household 48 | NUM_PEOPLE = 1 49 | 50 | # default directory to save the data 51 | FPATH = mg.FDIR_MY_DATA 52 | 53 | # default file name to load pre-existing input data 54 | FNAME_LOAD_TRIALS_BASE = None 55 | 56 | # =========================================== 57 | # user-defined parameters 58 | # =========================================== 59 | 60 | # seed for the random number generator (set to None or a fixed integer for reproducibility) 61 | seed = None 62 | 63 | # ------------------------------------------- 64 | # time information 65 | # ------------------------------------------- 66 | 67 | # the number of days 68 | num_days = 7 69 | 70 | # the number of additional hours 71 | num_hours = 8 72 | 73 | # the number of additional minutes 74 | num_min = NUM_MIN 75 | 76 | # the number of people per household 77 | num_people = NUM_PEOPLE 78 | # ------------------------------------------- 79 | # flags 80 | # ------------------------------------------- 81 | 82 | # control how the simulation moves through time (False, is the default) 83 | # If True, the simulation uses a strategy to move through time minute by minute, which is slow 84 | # If False, the simulation uses a strategy to move through time by skipping to time steps in which 85 | # a potential computation, calculation, or action could be done. This greatly decreases the simulation \ 86 | # by decreasing the total amount of computation. 87 | do_minute_by_minute = False 88 | 89 | # should the simulation plot results at the end of the run 90 | do_plot = False 91 | 92 | # should the simulation print messages to the screen 93 | do_print = True 94 | 95 | # should the simulation save the results (both input and output) of the simulation 96 | do_save = True 97 | 98 | # load previously made input 99 | do_load_trials = False 100 | 101 | # ------------------------------------------- 102 | # demographic parameters 103 | # ------------------------------------------- 104 | 105 | # select trial 106 | trial_code = trial.OMNI 107 | 108 | # set the demographic 109 | demographic = dmg.ADULT_WORK 110 | 111 | # ------------------------------------------- 112 | # save and load parameters 113 | # ------------------------------------------- 114 | 115 | # the directory to save the data (output) 116 | fpath = FPATH 117 | 118 | # the directory to load the input 119 | fname_load_trials_base = FNAME_LOAD_TRIALS_BASE 120 | 121 | # ============================================== 122 | # initialize the random number generator 123 | # ============================================== 124 | 125 | # initialize generator 126 | mg.initialize_random_number_generator(seed) -------------------------------------------------------------------------------- /source/bed.py: -------------------------------------------------------------------------------- 1 | # The United States Environmental Protection Agency through its Office of 2 | # Research and Development has developed this software. The code is made 3 | # publicly available to better communicate the research. All input data 4 | # used fora given application should be reviewed by the researcher so 5 | # that the model results are based on appropriate data for any given 6 | # application. This model is under continued development. The model and 7 | # data included herein do not represent and should not be construed to 8 | # represent any Agency determination or policy. 9 | # 10 | # This file was written by Dr. Namdi Brandon 11 | # ORCID: 0000-0001-7050-1538 12 | # August 14, 2017 13 | 14 | """ 15 | This module contains code that enables the agent to use a bed. This class allows access to the \ 16 | sleep (:class:`sleep.Sleep`) activity. 17 | 18 | This module contains the following class: :class:`bed.Bed`. 19 | 20 | .. moduleauthor:: Dr. Namdi Brandon 21 | """ 22 | 23 | # =============================================== 24 | # import 25 | # =============================================== 26 | 27 | # general math package 28 | import numpy as np 29 | 30 | # agent-based model modules 31 | import asset, sleep 32 | 33 | # =============================================== 34 | # class Bed 35 | # =============================================== 36 | 37 | class Bed(asset.Asset): 38 | 39 | """ 40 | This asset models a bed. It allows the agent to address the Rest (:class:`rest.Rest`) need by doing the \ 41 | sleep (:class:`sleep.Sleep`) activity. 42 | 43 | """ 44 | 45 | # constructor 46 | def __init__(self): 47 | 48 | # call the Asset constructor 49 | asset.Asset.__init__(self) 50 | 51 | # set the category 52 | self.category = asset.BED 53 | 54 | # set the maximum amount of users 55 | self.max_users = np.inf 56 | 57 | # set the activities 58 | self.activities = {'sleep': sleep.Sleep(), } 59 | 60 | return 61 | 62 | -------------------------------------------------------------------------------- /source/config.py: -------------------------------------------------------------------------------- 1 | """ 2 | This file contains the config file, which contains useful code for global parameters operations across modules. 3 | """ 4 | 5 | # whether or not to print to screen 6 | do_print = False -------------------------------------------------------------------------------- /source/food.py: -------------------------------------------------------------------------------- 1 | # The United States Environmental Protection Agency through its Office of 2 | # Research and Development has developed this software. The code is made 3 | # publicly available to better communicate the research. All input data 4 | # used fora given application should be reviewed by the researcher so 5 | # that the model results are based on appropriate data for any given 6 | # application. This model is under continued development. The model and 7 | # data included herein do not represent and should not be construed to 8 | # represent any Agency determination or policy. 9 | # 10 | # This file was written by Dr. Namdi Brandon 11 | # ORCID: 0000-0001-7050-1538 12 | # August 14, 2017 13 | 14 | """ 15 | This module contains information about the asset that allows for the eating activity. 16 | 17 | This module contains the following class: :class:`food.Food`. 18 | 19 | .. moduleauthor:: Dr. Namdi Brandon. 20 | """ 21 | 22 | 23 | # =============================================== 24 | # import 25 | # =============================================== 26 | 27 | # general math capability 28 | import numpy as np 29 | 30 | # agent-based model modules 31 | import asset, eat, location 32 | 33 | # =============================================== 34 | # class Food 35 | # =============================================== 36 | 37 | class Food(asset.Asset): 38 | 39 | """ 40 | This class represents an asset that allows the agent to eat breakfast, eat lunch, and eat dinner. 41 | 42 | Activities in this asset: 43 | 44 | #. :class:`eat.Eat_Breakfast` 45 | #. :class:`eat.Eat_Lunch` 46 | #. :class:`eat.Eat_Dinner` 47 | 48 | """ 49 | # 50 | # constructor 51 | # 52 | def __init__(self): 53 | 54 | # call the Asset constructor 55 | asset.Asset.__init__(self) 56 | 57 | # assign the asset category 58 | self.category = asset.FOOD 59 | 60 | # set the maximum number of users 61 | self.max_users = np.inf 62 | 63 | # set the location 64 | self.location.local = location.HOME 65 | 66 | # add the activity to the activity list 67 | self.activities = {'eat breakfast': eat.Eat_Breakfast(), 68 | 'eat lunch': eat.Eat_Lunch(), 69 | 'eat dinner': eat.Eat_Dinner(), 70 | } 71 | 72 | return 73 | -------------------------------------------------------------------------------- /source/interrupt.py: -------------------------------------------------------------------------------- 1 | # The United States Environmental Protection Agency through its Office of 2 | # Research and Development has developed this software. The code is made 3 | # publicly available to better communicate the research. All input data 4 | # used fora given application should be reviewed by the researcher so 5 | # that the model results are based on appropriate data for any given 6 | # application. This model is under continued development. The model and 7 | # data included herein do not represent and should not be construed to 8 | # represent any Agency determination or policy. 9 | # 10 | # This file was written by Dr. Namdi Brandon 11 | # ORCID: 0000-0001-7050-1538 12 | # August 14, 2017 13 | 14 | """ 15 | This module contains code for interrupting a current activity. 16 | 17 | This module contains class :class:`interrupt.Interrupt`. 18 | 19 | .. moduleauthor:: Dr. Namdi Brandon 20 | """ 21 | 22 | # =============================================== 23 | # import 24 | # =============================================== 25 | 26 | # agent-based model modules 27 | import activity, need 28 | 29 | # =============================================== 30 | # class Interrupt 31 | # =============================================== 32 | 33 | class Interrupt(activity.Activity): 34 | 35 | """ 36 | This class allows for the current activity to be interrupted by another activity. 37 | """ 38 | 39 | # 40 | # constructor 41 | # 42 | def __init__(self): 43 | 44 | activity.Activity.__init__(self) 45 | 46 | self.id = activity.INTERRUPT 47 | 48 | return 49 | 50 | def advertise(self, p, str_need, act): 51 | 52 | """ 53 | This function calculates the score of an activities advertisement to a Person. This function does the \ 54 | the following: 55 | 56 | #. temporarily sets the value of the Need that must be immediately addressed to a low level. 57 | #. send an advertisement is is made from the potentially interrupting activity 58 | #. calculate the score from the potentially interrupting activity 59 | 60 | :param person.Person p: the person who is being advertised to 61 | :param int str_need: the id of the Need that needs to be addressed, which \ 62 | could potentially cause an interrupting event 63 | :param activity.Activity act: the activity of interest that could immediately \ 64 | interrupt a current activity 65 | 66 | :return: the value of the advertisement 67 | :rtype: float 68 | """ 69 | 70 | # original magnitude of the need 71 | mag_temp = p.needs[str_need].magnitude 72 | 73 | # set the magnitude of the interrupting need 74 | p.needs[str_need].magnitude = need.MAG_INTERRUPTION 75 | 76 | # get the score 77 | score = act.advertise(p) 78 | 79 | # restore the need magnitude to the original amount 80 | p.needs[str_need].magnitude = mag_temp 81 | 82 | return score 83 | 84 | def start(self, p): 85 | 86 | """ 87 | This handles the start of an activity. 88 | 89 | :param person.Person p: the person of interest 90 | :return: None 91 | """ 92 | 93 | # store a list of the arguments for the end() procedure 94 | p.state.arg_end.append(p) 95 | 96 | return -------------------------------------------------------------------------------- /source/location.py: -------------------------------------------------------------------------------- 1 | # The United States Environmental Protection Agency through its Office of 2 | # Research and Development has developed this software. The code is made 3 | # publicly available to better communicate the research. All input data 4 | # used fora given application should be reviewed by the researcher so 5 | # that the model results are based on appropriate data for any given 6 | # application. This model is under continued development. The model and 7 | # data included herein do not represent and should not be construed to 8 | # represent any Agency determination or policy. 9 | # 10 | # This file was written by Dr. Namdi Brandon 11 | # ORCID: 0000-0001-7050-1538 12 | # August 14, 2017 13 | 14 | """ 15 | This module is responsible for containing information about the \ 16 | concept of location. 17 | 18 | This module contains class :class:`location.Location`. 19 | 20 | .. moduleauthor:: Dr. Namdi Brandon 21 | """ 22 | 23 | # =============================================== 24 | # constants 25 | # =============================================== 26 | 27 | # geographical location constants 28 | NORTH = 1 29 | SOUTH = 2 30 | EAST = 3 31 | WEST = 4 32 | 33 | # local location constants 34 | HOME = 0 35 | TRANSIT = 1 36 | OFF_SITE = 3 37 | 38 | 39 | # This dictionary takes the INTEGER representation of a geographical location code 40 | # and returns a STRING representation 41 | INT_2_STR_GEO = { 42 | NORTH: 'North', 43 | SOUTH: 'South', 44 | EAST: 'East', 45 | WEST: 'West', 46 | } 47 | 48 | # This dictionary takes the INTEGER representation of a local location code 49 | # and returns a STRING representation 50 | INT_2_STR_LOCAL = { 51 | HOME: 'Home', 52 | TRANSIT: 'Transit', 53 | OFF_SITE: 'Off-Site', 54 | } 55 | 56 | # =============================================== 57 | # class Location 58 | # =============================================== 59 | 60 | class Location(object): 61 | 62 | """ 63 | This class holds information relevant to the location of persons and assets. 64 | 65 | :param int geography: the geographical location code 66 | :param int local: the local location code 67 | 68 | :ivar int geo: the geographical location code within the United States (e.g. north, south, eats, or west) 69 | :ivar int local: the local location code (e.g. home, off site, etc) 70 | """ 71 | 72 | # 73 | # Constructor 74 | # 75 | 76 | def __init__( self, geography=NORTH, local=HOME ): 77 | 78 | # the geographical location (referring to area of the United States) 79 | self.geo = geography 80 | 81 | # the local location 82 | self.local = local 83 | 84 | return 85 | 86 | def print_geo(self): 87 | 88 | """ 89 | Returns the geographical location in a string format 90 | 91 | :return: the string representation of the geographical location 92 | :rtype: str 93 | """ 94 | 95 | # message to be printed if there is an error 96 | msg = 'ERROR! %d is an invalid geographical location!\n' % self.geo 97 | 98 | return INT_2_STR_GEO.get(self.geo, msg) 99 | 100 | def print_local(self): 101 | 102 | """ 103 | Returns the local location in a string format 104 | 105 | :return: the string representation of the local location 106 | :rtype: str 107 | """ 108 | 109 | # message to be printed if there is an error 110 | msg = 'ERROR! %d is an invalid location.local!\n' % self.local 111 | 112 | return INT_2_STR_LOCAL.get(self.local, msg) 113 | 114 | def reset(self): 115 | 116 | """ 117 | This function resets the location to the default value, (:const:`location.HOME`). 118 | 119 | :return: None 120 | """ 121 | 122 | self.local = HOME 123 | 124 | return 125 | 126 | def toString( self ): 127 | 128 | """ 129 | This function represents the Location object as a string. 130 | 131 | :return msg: the string representation of the Location object 132 | :rtype: str 133 | """ 134 | 135 | msg = '' 136 | msg = msg + 'Geographical location: ' + self.print_geo() + '\n' 137 | msg = msg + 'Local location: ' + self.print_local() + '\n' 138 | 139 | return msg 140 | -------------------------------------------------------------------------------- /source/transport.py: -------------------------------------------------------------------------------- 1 | # The United States Environmental Protection Agency through its Office of 2 | # Research and Development has developed this software. The code is made 3 | # publicly available to better communicate the research. All input data 4 | # used fora given application should be reviewed by the researcher so 5 | # that the model results are based on appropriate data for any given 6 | # application. This model is under continued development. The model and 7 | # data included herein do not represent and should not be construed to 8 | # represent any Agency determination or policy. 9 | # 10 | # This file was written by Dr. Namdi Brandon 11 | # ORCID: 0000-0001-7050-1538 12 | # August 14, 2017 13 | 14 | """ 15 | This module contains information about the asset that allows a person to do \ 16 | the following activities: 17 | 18 | #. commute to work 19 | #. commute from work 20 | 21 | This module contains code for :class:`transport.Transport`. 22 | 23 | .. moduleauthor:: Dr. Namdi Brandon 24 | """ 25 | 26 | # =============================================== 27 | # import 28 | # =============================================== 29 | 30 | # agent-based model modules 31 | import asset, commute, location, occupation 32 | 33 | # =============================================== 34 | # class Transport 35 | # =============================================== 36 | 37 | class Transport(asset.Asset): 38 | 39 | """ 40 | This class is an asset that allows for commuting. 41 | 42 | Activities in this asset: 43 | 44 | #. :class:`commute.Commute_To_Work` 45 | #. :class:`commute.Commute_From_Work` 46 | 47 | """ 48 | 49 | # 50 | # constructor 51 | # 52 | def __init__(self): 53 | 54 | asset.Asset.__init__(self) 55 | 56 | self.category = asset.TRANSPORT 57 | self.max_users = 1 58 | 59 | # add the activities to the activity list 60 | self.activities = {'commute to work': commute.Commute_To_Work(), 61 | 'commute from work': commute.Commute_From_Work() } 62 | return 63 | 64 | def initialize(self, people): 65 | 66 | """ 67 | This function sets the transport location according to whether or not the Person is commuting to or \ 68 | from work. 69 | 70 | .. note:: 71 | This function just sets the transport object to be at the home 72 | 73 | :param list people: a list of people in the simulation 74 | 75 | :return: None 76 | """ 77 | 78 | self.location.local = location.HOME 79 | 80 | # find out if it's work time for each person 81 | # is_work_time = [occupation.is_work_time(p.clock, p.socio.job) for p in people ] 82 | 83 | # find out if it's commute time for each person 84 | # is_commute_time = [occupation.is_work_time(p.clock, p.socio.job, is_commute_to_work=True) for p in people ] 85 | 86 | # if a person is commuting / working, set the location to that Person's location 87 | # if (True in is_work_time): 88 | # self.location.local = people[is_work_time.index(True)].socio.job.location.local 89 | # elif (True in is_commute_time): 90 | # self.location.local = people[is_commute_time.index(True)].socio.job.location.local 91 | 92 | return -------------------------------------------------------------------------------- /source/workplace.py: -------------------------------------------------------------------------------- 1 | # The United States Environmental Protection Agency through its Office of 2 | # Research and Development has developed this software. The code is made 3 | # publicly available to better communicate the research. All input data 4 | # used fora given application should be reviewed by the researcher so 5 | # that the model results are based on appropriate data for any given 6 | # application. This model is under continued development. The model and 7 | # data included herein do not represent and should not be construed to 8 | # represent any Agency determination or policy. 9 | # 10 | # This file was written by Dr. Namdi Brandon 11 | # ORCID: 0000-0001-7050-1538 12 | # August 14, 2017 13 | 14 | """ 15 | This module contains code for the asset that allows a person to go to work / school. 16 | 17 | This file contains :class:`workplace.Workplace`. 18 | 19 | .. moduleauthor:: Dr. Namdi Brandon 20 | """ 21 | 22 | # =============================================== 23 | # import 24 | # =============================================== 25 | 26 | # general math capabilities 27 | import numpy as np 28 | 29 | # ABM modules 30 | import asset, location, work 31 | 32 | # =============================================== 33 | # class Workplace 34 | # =============================================== 35 | 36 | class Workplace(asset.Asset): 37 | 38 | """ 39 | This class allows a Person to go to work / school. 40 | 41 | Activities in this asset: :class:`work.Work` 42 | """ 43 | 44 | # 45 | # constructor 46 | # 47 | def __init__(self): 48 | 49 | asset.Asset.__init__(self) 50 | 51 | self.category = asset.WORKPLACE 52 | self.max_users = np.inf 53 | 54 | # set the location 55 | self.location.local = location.OFF_SITE 56 | 57 | # the work activity 58 | self.activities = {'work': work.Work(), } 59 | 60 | return 61 | 62 | 63 | --------------------------------------------------------------------------------