{ "info": { "author": "Cash Costello", "author_email": "cash.costello@jhuapl.edu", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Science/Research", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 3 :: Only", "Topic :: Scientific/Engineering", "Topic :: Scientific/Engineering :: Artificial Life" ], "description": "[![Build Status](https://travis-ci.org/ACI-ESP/dworp.svg)](https://travis-ci.org/ACI-ESP/dworp)\n[![Coverage Status](https://img.shields.io/coveralls/github/ACI-ESP/dworp.svg)](https://coveralls.io/github/ACI-ESP/dworp)\n\nDworp\n=============\nFlexible framework for building agent-based modeling simulations.\n\nRequirements\n--------------\n * python 3\n\nInstallation\n--------------\nInstall using pip (maybe be pip3 on some platforms):\n```bash\npip install dworp\n```\n\nTo install with the optional plotting capability:\n```bash\npip install dworp[plot]\n```\nThis will install dependencies required by `dworp.plot` (currently only matplotlib).\n\nUsing\n---------------\nDworp defines basic interfaces for building simulations and provides some\ndefault components to support rapid creation of agent-based models.\n\n### Agent\nAn `Agent` updates its state in the `step()` function.\nThe update may depend on the environment, its neighbors, past history, or other features.\n\nAn agent has two optional functions `init()` and `complete()`.\nThe `init()` function is called when an agent is added to the simulation.\nThe `complete()` function is called at the end of a time step.\n\n```python\nclass MyAgent(dworp.Agent):\n def step(self, now, env):\n # ToDo add example here\n pass\n```\n\n#### Visibility of Agent State\nWhen agents are updating their state based on their neighbors' state, \nyou may want to use a two stage update mechanism.\nIn the first stage, the agents update their state privately so that their neighbors\ncannot see the new state.\nIn the second stage, the agents make that state public to prepare for the next time step.\n\n### Environment\nThe `Environment` captures all simulation state that does not live in the agents.\nThis includes serving as a container for network or spatial information for determining neighbors.\n\n### Time\n`Time` drives the simulation and implements an iterator interface.\nIt can be fixed in length or infinite.\nTime steps can be fixed in length or variable.\nTime can be integer or floating point.\n\n### Space\nAgents can observe or interact with other agents based on neighborhoods.\nA neighborhood may be defined on a network using various graph frameworks like igraph or snap.\nA neighborhood can also be spatially defined on a grid or continuous space.\n\n### Terminator\nTo stop the simulation when some condition is met, use a `Terminator`.\n\n### Schedule\nThe order that agents update and which agents update is determined by the `Scheduler`.\nSome basic schedulers are provided for round robin updates in random order or uniformly sampling.\n\n### Observer\nAn `Observer` runs after each time step.\nIt is designed for capturing data for further processing.\nIt has access to the agents and the environment.\nMultiple observers can be chained together using `ChainedObserver`.\n\n### Simulation\nThe `Simulation` interface defines a single realization of an agent-based simulation.\nBasic implementations for single stage and double stage updates are provided.\nUsually, you will want to inherit from one of those to define your simulation.\n\n### Logging\nEach component has its own logger:\n```python\n self.logger.info(\"Agent {} set activity to {}\".format(self.agent_id, self.activity))\n```\nThe logging level can be controlled at the framework level:\n```python\n logging.getLogger('dworp').setLevel(logging.WARN)\n```\nor at the individual component level:\n```python\n logging.getLogger('dworp.agent').setLevel(logging.DEBUG)\n```\n\nFor more information on log levels or log configuration, read the [python logging docs](https://docs.python.org/3/library/logging.html).\n\nExamples\n------------\nThe best way to learn the framework is by looking at the example models and their documentation.\n\nTesting\n-------------\nInstall the test requirements:\n```bash\npip install -r test_requirements.txt\n```\nThen to run the tests (while in the base directory):\n\n```bash\nnosetests\n```\n\nThis will run all the tests.\nTo skip the plotting unit tests which require matplotlib, do this:\n```bash\nnosetests -a '!plot'\n```\n\nTo get a report on unit test coverage:\n```bash\nnosetests --with-coverage --cover-package=dworp\n```\n\nDevelopment\n-----------\nTo install in editable model so that changes to the framework are instantly reflected:\n```bash\npip install -e .\n```\n\nThe code mostly follows the [PEP8 coding standard](https://www.python.org/dev/peps/pep-0008/).\nIf you are using PyCharm, it will highlight PEP8 issues.\nYou can also manually run style checks with flake8 (pip install flake8):\n```bash\nflake8 dworp\n```\n\nThe docstrings are using the [Google standard](http://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html).\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ACI-ESP/dworp", "keywords": "agents ABM modeling simulation agent-based", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "dworp", "package_url": "https://pypi.org/project/dworp/", "platform": "", "project_url": "https://pypi.org/project/dworp/", "project_urls": { "Homepage": "https://github.com/ACI-ESP/dworp" }, "release_url": "https://pypi.org/project/dworp/0.1.0/", "requires_dist": [ "numpy", "matplotlib; extra == 'plot'" ], "requires_python": ">=3.5", "summary": "Agent-based modeling framework", "version": "0.1.0" }, "last_serial": 3848437, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "fe868a27f2b54ae550a7493c443e0cce", "sha256": "9d6feb937addd460c4750703006fa1d9b75f4d43acc868ab39aea0637f6e197e" }, "downloads": -1, "filename": "dworp-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "fe868a27f2b54ae550a7493c443e0cce", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 11795, "upload_time": "2018-05-09T19:07:49", "url": "https://files.pythonhosted.org/packages/2a/4e/510ca6ddddae8b0ea50917b62b630011d3a7a85610b67f002d91d7cf81e6/dworp-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8dc74eb0e033ef9e0ed803d90affd717", "sha256": "5cf8d4dcecf0d44dbd848b5fde807d10b3d35df4a374863754926f18dfa0fead" }, "downloads": -1, "filename": "dworp-0.1.0.tar.gz", "has_sig": false, "md5_digest": "8dc74eb0e033ef9e0ed803d90affd717", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 8248, "upload_time": "2018-05-09T19:07:50", "url": "https://files.pythonhosted.org/packages/9e/05/faf87dc7c94d6e4cb1e6c6a479eb0c3072a98710832c8404dd9fb6e2a076/dworp-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "fe868a27f2b54ae550a7493c443e0cce", "sha256": "9d6feb937addd460c4750703006fa1d9b75f4d43acc868ab39aea0637f6e197e" }, "downloads": -1, "filename": "dworp-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "fe868a27f2b54ae550a7493c443e0cce", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 11795, "upload_time": "2018-05-09T19:07:49", "url": "https://files.pythonhosted.org/packages/2a/4e/510ca6ddddae8b0ea50917b62b630011d3a7a85610b67f002d91d7cf81e6/dworp-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8dc74eb0e033ef9e0ed803d90affd717", "sha256": "5cf8d4dcecf0d44dbd848b5fde807d10b3d35df4a374863754926f18dfa0fead" }, "downloads": -1, "filename": "dworp-0.1.0.tar.gz", "has_sig": false, "md5_digest": "8dc74eb0e033ef9e0ed803d90affd717", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 8248, "upload_time": "2018-05-09T19:07:50", "url": "https://files.pythonhosted.org/packages/9e/05/faf87dc7c94d6e4cb1e6c6a479eb0c3072a98710832c8404dd9fb6e2a076/dworp-0.1.0.tar.gz" } ] }