archABM


NamearchABM JSON
Version 0.4.1 PyPI version JSON
download
home_pagehttps://github.com/Vicomtech/ArchABM
SummaryAgent based simulation for architectural spaces
upload_time2023-01-26 15:46:49
maintainer
docs_urlNone
authorVicomtech
requires_python>=3.5, <4
licenseMIT license
keywords agent simulation architecture building workplace discrete-event
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <img src="https://raw.githubusercontent.com/Vicomtech/ArchABM/main/docs/source/_static/logo_4.png" width="550"/>


Agent-based model simulation for air quality and pandemic risk assessment in architectural spaces.


[![PyPI Status](https://img.shields.io/pypi/status/archABM?style=flat-square)](https://pypi.python.org/pypi/archABM)
[![PyPI Version](https://img.shields.io/pypi/v/archABM?style=flat-square)](https://pypi.python.org/pypi/archABM)
[![License](https://img.shields.io/github/license/Vicomtech/ArchABM?style=flat-square)](https://github.com/Vicomtech/ArchABM/blob/master/LICENSE)
[![Actions](https://img.shields.io/github/actions/workflow/status/Vicomtech/ArchABM/build-n-publish.yml?style=flat-square)](https://github.com/Vicomtech/ArchABM/actions)
[![](https://img.shields.io/pypi/dm/archABM?style=flat-square)](https://pepy.tech/project/archABM)
[![Top Language](https://img.shields.io/github/languages/top/Vicomtech/ArchABM?style=flat-square)](https://github.com/Vicomtech/ArchABM)
[![Github Issues](https://img.shields.io/github/issues/Vicomtech/ArchABM?style=flat-square)](https://github.com/Vicomtech/ArchABM)

## User Guide

**archABM** is a fast and open source agent-based modelling framework that simulates complex human-building-interaction patterns and estimates indoor air quality across an entire building, while taking into account potential airborne virus concentrations.

----

**Disclaimer**: archABM is an evolving research tool designed to familiarize the interested user with factors influencing the potential indoor airborne transmission of viruses (such as SARS-CoV-2) and the generation of carbon-dioxide (CO2) indoors. 
Calculations of virus and CO2 levels within ArchABM are based on recently published aerosol models [1,2], which however have not been validated in the context of agent-based modeling (ABM) yet. We note that uncertainty in and intrinsic variability of model parameters as well as underlying assumptions concerning model parameters may lead to errors regarding the simulated results.
Use of archABM is the sole responsibility of the user. It is being made available without guarantee or warranty of any kind. The authors do not accept any liability from its use.

[1] *Peng, Zhe, and Jose L. Jimenez. "Exhaled CO2 as a COVID-19 infection risk proxy for different indoor environments and activities." Environmental Science & Technology Letters 8.5 (2021): 392-397.*

[2] *Lelieveld, Jos, et al. "Model calculations of aerosol transmission and infection risk of COVID-19 in indoor environments." International journal of environmental research and public health 17.21 (2020): 8114.*

----

Installation
------------

As the compiled **archABM** package is hosted on the Python Package
Index (PyPI) you can easily install it with `pip`. To install
**archABM**, run this command in your terminal of choice:

``` {.sourceCode .shell-session}
$ pip install archABM
```

or, alternatively:

``` {.sourceCode .shell-session}
$ python -m pip install archABM
```

If you want to get **archABM**'s latest version, you can refer to the
repository hosted at github:

``` {.sourceCode .shell-session}
python -m pip install https://github.com/Vicomtech/ArchABM/archive/main.zip
```

----

Getting Started
---------------

Use the following template to run a simulation with archABM:

```python
# Import modules
import json
import pandas as pd
from archABM.engine import Engine

# Read configuration example
from archABM.config import config
# Alternatively, get configuration from "config.json" example

# Create ArchABM simulation engine
simulation = Engine(config)

# Run simulation
results = simulation.run()

# Create dataframes based on the results
df_people = pd.DataFrame(results["results"]["people"])
df_places = pd.DataFrame(results["results"]["places"])
```


This example uses the default configuration file built-in the library.
Alternatively, you can download and modify the [config.json](data/config.json) file found at the ``data`` directory of **archABM** repository.

----

Developers can also use the command-line interface with the [main.py](https://github.com/Vicomtech/ArchABM) file from the source code repository.


<img src="https://raw.githubusercontent.com/Vicomtech/ArchABM/main/docs/source/_static/command.png" width="500" align="center"/>

```console
$ python main.py config.json
```

Check the ``--help`` option to get more information about the optional parameters:

```
$ python main.py --help
Usage: main.py [OPTIONS] CONFIG_FILE

  ArchABM simulation helper

Arguments:
  CONFIG_FILE  The name of the configuration file  [required]

Options:
  -i, --interactive     Interactive CLI mode  [default: False]
  -l, --save-log        Save events logs  [default: False]
  -c, --save-config     Save configuration file  [default: True]
  -t, --save-csv        Export results to csv format  [default: True]
  -j, --save-json       Export results to json format  [default: False]
  -o, --return-output   Return results dictionary  [default: False]
  --install-completion  Install completion for the current shell.
  --show-completion     Show completion for the current shell, to copy it or
                        customize the installation.

  --help                Show this message and exit.
```

To run an example with the CLI, download the [config.json](data/config.json) file found at the ``data`` directory of **archABM** repository.

----

## Inputs 

In order to run a simulation, information about the `event` types,
`people`, `places`, and the `aerosol model` must be provided to the
ArchABM framework.

<details>
  <summary>Events</summary>
  
| Attribute | Description | Type |
|---|---|---|
| *name* | Event name | `string` |
| *schedule* | When an event is permitted to happen, in minutes | `list of tuples` |
| *duration* | Event duration lower and upper bounds, in minutes | `integer`,`integer` |
| *number of repetitions* | Number of repetitions lower and upper bounds | `integer`,`integer` |
| *mask efficiency* | Mask efficiency during an event [0-1] | `float` |
| *collective* | Event is invoked by one person but involves many | `boolean` |
| *allow* | Whether such event is allowed in the simulation | `boolean` |
 
</details>

<details>
  <summary>Places</summary>
  
| Attribute | Description | Type |
|:---:|:---:|:---:|
| *name* | Place name | `string` |
| *activity* | Activity or event occurring at that place | `string` |
| *department* | Department name | `string` |
| *building* | Building name | `string` |
| *area* | Room floor area in square meters | `float` |
| *height* | Room height in meters. | `float` |
| *capacity* | Room people capacity. | `integer` |
| *height* | Room height in meters. | `float` |
| *ventilation* | Passive ventilation in hours<sup>-1</sup> | `float` |
| *recirculated_flow_rate* | Active ventilation in cubic meters per hour | `float` |
| *allow* | Whether such place is allowed in the simulation | `boolean` |
 
</details>

<details>
  <summary>People</summary>
  
| Attribute | Description | Type |
|:---:|:---:|:---:|
| *department* | Department name | `string` |
| *building* | Building name | `string` |
| *num_people* | Number of people | `integer` |
 
</details>


<details>
  <summary>Aerosol Model</summary>
  
| Attribute | Description | Type |
|:---:|:---:|:---:|
| *pressure* | Ambient pressure in atm | `float` |
| *temperature* | Ambient temperature in Celsius degrees | `float` |
| *CO2_background* | Background CO2 concentration in ppm | `float` |
| *decay_rate* | Decay rate of virus in hours<sup>-1</sup> | `float` |
| *deposition_rate* | Deposition to surfaces in hours<sup>-1</sup> | `float` |
| *hepa_flow_rate* | Hepa filter flow rate in cubic meters per hour | `float` |
| *filter_efficiency* | Air conditioning filter efficiency | `float` |
| *ducts_removal* | Air ducts removal loss | `float` |
| *other_removal* | Extraordinary air removal | `float` |
| *fraction_immune* | Fraction of people immune to the virus | `float` |
| *breathing_rate* | Mean breathing flow rate in cubic meters per hour | `float` |
| *CO2_emission_person* | CO2 emission rate at 273K and 1atm | `float` |
| *quanta_exhalation* | Quanta exhalation rate in quanta per hour | `float` |
| *quanta_enhancement* | Quanta enhancement due to variants | `float` |
| *people_with_masks* | Fraction of people using mask | `float` |
 
</details>

<details>
  <summary>Options</summary>
  
| Attribute | Description | Type |
|:---:|:---:|:---:|
| *movement_buildings* | Allow people enter to other buildings | `boolean` |
| *movement_department* | Allow people enter to other departments | `boolean` |
| *number_runs* | Number of simulations runs to execute | `integer` |
| *save_log* | Save events logs | `boolean` |
| *save_config* | Save configuration file | `boolean` |
| *save_csv* | Export the results to csv format | `boolean` |
| *save_json* | Export the results to json format | `boolean` |
| *return_output* | Return a dictionary with the results | `boolean` |
| *directory* | Directory name to save results | `string` |
| *ratio_infected* | Ratio of infected to total number of people | `float` |
| *model* | Aerosol model to be used in the simulation | `string` |
 
</details>

#### Example config.json
<details>
  <summary>config.json</summary>
    
```json
{
    "events": [{
            "activity": "home",
            "schedule": [
                [0, 480],
                [1020, 1440]
            ],
            "repeat_min": 0,
            "repeat_max": null,
            "duration_min": 300,
            "duration_max": 360,
            "mask_efficiency": null,
            "collective": false,
            "shared": false,
            "allow": true
        },
        {
            "activity": "work",
            "schedule": [
                [480, 1020]
            ],
            "repeat_min": 0,
            "repeat_max": null,
            "duration_min": 30,
            "duration_max": 60,
            "mask_efficiency": 0.0,
            "collective": false,
            "shared": true,
            "allow": true
        },
        {
            "activity": "meeting",
            "schedule": [
                [540, 960]
            ],
            "repeat_min": 0,
            "repeat_max": 5,
            "duration_min": 20,
            "duration_max": 90,
            "mask_efficiency": 0.0,
            "collective": true,
            "shared": true,
            "allow": true
        },
        {
            "activity": "lunch",
            "schedule": [
                [780, 900]
            ],
            "repeat_min": 1,
            "repeat_max": 1,
            "duration_min": 20,
            "duration_max": 45,
            "mask_efficiency": 0.0,
            "collective": true,
            "shared": true,
            "allow": true
        },
        {
            "activity": "coffee",
            "schedule": [
                [600, 660],
                [900, 960]
            ],
            "repeat_min": 0,
            "repeat_max": 2,
            "duration_min": 5,
            "duration_max": 15,
            "mask_efficiency": 0.0,
            "collective": true,
            "shared": true,
            "allow": true
        },
        {
            "activity": "restroom",
            "schedule": [
                [480, 1020]
            ],
            "repeat_min": 0,
            "repeat_max": 4,
            "duration_min": 3,
            "duration_max": 6,
            "mask_efficiency": 0.0,
            "collective": false,
            "shared": true,
            "allow": true
        }
    ],
    "places": [{
            "name": "home",
            "activity": "home",
            "building": null,
            "department": null,
            "area": null,
            "height": null,
            "capacity": null,
            "ventilation": null,
            "recirculated_flow_rate": null,
            "allow": true
        },
        {
            "name": "open_office",
            "activity": "work",
            "building": "building1",
            "department": ["department1", "department2", "department3", "department4"],
            "area": 330.0,
            "height": 2.7,
            "capacity": 60,
            "ventilation": 1.5,
            "recirculated_flow_rate": 0,
            "allow": true
        },
        {
            "name": "it_office",
            "activity": "work",
            "building": "building1",
            "department": ["department4"],
            "area": 52.0,
            "height": 2.7,
            "capacity": 10,
            "ventilation": 1.5,
            "recirculated_flow_rate": 0,
            "allow": true
        },
        {
            "name": "chief_office_A",
            "activity": "work",
            "building": "building1",
            "department": ["department5", "department6", "department7"],
            "area": 21.0,
            "height": 2.7,
            "capacity": 5,
            "ventilation": 1.5,
            "recirculated_flow_rate": 0,
            "allow": true
        },
        {
            "name": "chief_office_B",
            "activity": "work",
            "building": "building1",
            "department": ["department5", "department6", "department7"],
            "area": 21.0,
            "height": 2.7,
            "capacity": 5,
            "ventilation": 1.5,
            "recirculated_flow_rate": 0,
            "allow": true
        },
        {
            "name": "chief_office_C",
            "activity": "work",
            "building": "building1",
            "department": ["department5", "department6", "department7"],
            "area": 24.0,
            "height": 2.7,
            "capacity": 5,
            "ventilation": 1.5,
            "recirculated_flow_rate": 0,
            "allow": true
        },
        {
            "name": "meeting_A",
            "activity": "meeting",
            "building": "building1",
            "department": ["department1", "department2", "department3", "department5", "department6", "department7"],
            "area": 16.0,
            "height": 2.7,
            "capacity": 6,
            "ventilation": 1.0,
            "recirculated_flow_rate": 0,
            "allow": true
        },
        {
            "name": "meeting_B",
            "activity": "meeting",
            "building": "building1",
            "department": ["department1", "department2", "department3", "department5", "department6", "department7"],
            "area": 16.0,
            "height": 2.7,
            "capacity": 6,
            "ventilation": 1.0,
            "recirculated_flow_rate": 0,
            "allow": true
        },
        {
            "name": "meeting_C",
            "activity": "meeting",
            "building": "building1",
            "department": ["department1", "department2", "department3", "department5", "department6", "department7"],
            "area": 11.0,
            "height": 2.7,
            "capacity": 4,
            "ventilation": 1.0,
            "recirculated_flow_rate": 0,
            "allow": true
        },
        {
            "name": "meeting_D",
            "activity": "meeting",
            "building": "building1",
            "department": null,
            "area": 66.0,
            "height": 2.7,
            "capacity": 24,
            "ventilation": 1.5,
            "recirculated_flow_rate": 0,
            "allow": true
        },
        {
            "name": "coffee_A",
            "activity": "coffee",
            "building": "building1",
            "department": null,
            "area": 25.0,
            "height": 2.7,
            "capacity": 10,
            "ventilation": 1.5,
            "recirculated_flow_rate": 0,
            "allow": true
        },
        {
            "name": "coffee_B",
            "activity": "coffee",
            "building": "building1",
            "department": null,
            "area": 55.0,
            "height": 2.7,
            "capacity": 20,
            "ventilation": 1.5,
            "recirculated_flow_rate": 0,
            "allow": true
        },
        {
            "name": "restroom_A",
            "activity": "restroom",
            "building": "building1",
            "department": null,
            "area": 20.0,
            "height": 2.7,
            "capacity": 4,
            "ventilation": 1.0,
            "recirculated_flow_rate": 0,
            "allow": true
        },
        {
            "name": "restroom_B",
            "activity": "restroom",
            "building": "building1",
            "department": ["department1", "department2", "department3", "department4", "department5", "department6"],
            "area": 20.0,
            "height": 2.7,
            "capacity": 4,
            "ventilation": 1.0,
            "recirculated_flow_rate": 0,
            "allow": true
        },
        {
            "name": "lunch",
            "activity": "lunch",
            "building": "building1",
            "department": null,
            "area": 150.0,
            "height": 2.7,
            "capacity": 60,
            "ventilation": 1.5,
            "recirculated_flow_rate": 0,
            "allow": true
        }
    ],
    "people": [{
            "department": "department1",
            "building": "building1",
            "num_people": 16
        },
        {
            "department": "department2",
            "building": "building1",
            "num_people": 16
        },
        {
            "department": "department3",
            "building": "building1",
            "num_people": 16
        },
        {
            "department": "department4",
            "building": "building1",
            "num_people": 7
        },
        {
            "department": "department5",
            "building": "building1",
            "num_people": 2
        },
        {
            "department": "department6",
            "building": "building1",
            "num_people": 2
        },
        {
            "department": "department7",
            "building": "building1",
            "num_people": 1
        }
    ],
    "options": {
        "movement_buildings": true,
        "movement_department": false,
        "number_runs": 1,
        "save_log": true,
        "save_config": true,
        "save_csv": false,
        "save_json": false,
        "return_output": false,
        "directory": null,
        "ratio_infected": 0.05,
        "model": "Colorado",
        "model_parameters": {
            "Colorado": {
                "pressure": 0.95,
                "temperature": 20,
                "CO2_background": 415,
                "decay_rate": 0.62,
                "deposition_rate": 0.3,
                "hepa_flow_rate": 0.0,
                "recirculated_flow_rate": 300,
                "filter_efficiency": 0.20,
                "ducts_removal": 0.10,
                "other_removal": 0.00,
                "fraction_immune": 0,
                "breathing_rate": 0.52,
                "CO2_emission_person": 0.005,
                "quanta_exhalation": 25,
                "quanta_enhancement": 1,
                "people_with_masks": 1.00
            }
        }
    }
}
```
</details>

----

## Outputs

Simulation outputs are stored by default in the `results` directory. The
subfolder with the results of an specific simulation have the date and
time of the moment when it was launched as a name in
`%Y-%m-%d_%H-%M-%S-%f` format.

By default, three files are saved after a simulation:

-   `config.json` stores a copy of the input configuration.
-   `people.csv` stores every person's state along time.
-   `places.csv` stores every places's state along time.

**archABM** offers the possibility of exporting the results in *JSON*
and *CSV* format. To export in *JSON* format, use the `--save-json`
parameter when running archABM. By default, the `--save-csv` parameter
is set to true.

Alternatively, **archABM** can also be configured to yield more detailed
information. The `app.log` file saves the log of the actions and events
occurred during the simulation. To export this file, use the
`--save-log` parameter when running archABM.

----

## Citing archABM

If you use ArchABM in your work or project, please cite the following article, published in the
[Building and Environment](https://www.sciencedirect.com/journal/building-and-environment) journal. 
(https://doi.org/10.1016/j.buildenv.2021.108495): 

Bibtex entry:

```bibtex
@article{MARTINEZ2021108495,
    title = {ArchABM: An agent-based simulator of human interaction with the built environment. CO2 and viral load analysis for indoor air quality},
    journal = {Building and Environment},
    pages = {108495},
    year = {2021},
    issn = {0360-1323},
    doi = {https://doi.org/10.1016/j.buildenv.2021.108495},
    url = {https://www.sciencedirect.com/science/article/pii/S036013232100891X},
    author = {IƱigo Martinez and Jan L. Bruse and Ane M. Florez-Tapia and Elisabeth Viles and Igor G. Olaizola},
    keywords = {Agent-based modeling, Indoor air quality, Building ventilation, Aerosol model, Building design, Simulation}
}
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Vicomtech/ArchABM",
    "name": "archABM",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.5, <4",
    "maintainer_email": "",
    "keywords": "agent simulation,architecture,building,workplace,discrete-event",
    "author": "Vicomtech",
    "author_email": "info@vicomtech.org",
    "download_url": "https://files.pythonhosted.org/packages/5b/cd/bf2f2976163fc79a54bd31f688faf9b3cf84d3644739d1d18db99fb2a357/archABM-0.4.1.tar.gz",
    "platform": null,
    "description": "<img src=\"https://raw.githubusercontent.com/Vicomtech/ArchABM/main/docs/source/_static/logo_4.png\" width=\"550\"/>\n\n\nAgent-based model simulation for air quality and pandemic risk assessment in architectural spaces.\n\n\n[![PyPI Status](https://img.shields.io/pypi/status/archABM?style=flat-square)](https://pypi.python.org/pypi/archABM)\n[![PyPI Version](https://img.shields.io/pypi/v/archABM?style=flat-square)](https://pypi.python.org/pypi/archABM)\n[![License](https://img.shields.io/github/license/Vicomtech/ArchABM?style=flat-square)](https://github.com/Vicomtech/ArchABM/blob/master/LICENSE)\n[![Actions](https://img.shields.io/github/actions/workflow/status/Vicomtech/ArchABM/build-n-publish.yml?style=flat-square)](https://github.com/Vicomtech/ArchABM/actions)\n[![](https://img.shields.io/pypi/dm/archABM?style=flat-square)](https://pepy.tech/project/archABM)\n[![Top Language](https://img.shields.io/github/languages/top/Vicomtech/ArchABM?style=flat-square)](https://github.com/Vicomtech/ArchABM)\n[![Github Issues](https://img.shields.io/github/issues/Vicomtech/ArchABM?style=flat-square)](https://github.com/Vicomtech/ArchABM)\n\n## User Guide\n\n**archABM** is a fast and open source agent-based modelling framework that simulates complex human-building-interaction patterns and estimates indoor air quality across an entire building, while taking into account potential airborne virus concentrations.\n\n----\n\n**Disclaimer**: archABM is an evolving research tool designed to familiarize the interested user with factors influencing the potential indoor airborne transmission of viruses (such as SARS-CoV-2) and the generation of carbon-dioxide (CO2) indoors. \nCalculations of virus and CO2 levels within ArchABM are based on recently published aerosol models [1,2], which however have not been validated in the context of agent-based modeling (ABM) yet. We note that uncertainty in and intrinsic variability of model parameters as well as underlying assumptions concerning model parameters may lead to errors regarding the simulated results.\nUse of archABM is the sole responsibility of the user. It is being made available without guarantee or warranty of any kind. The authors do not accept any liability from its use.\n\n[1] *Peng, Zhe, and Jose L. Jimenez. \"Exhaled CO2 as a COVID-19 infection risk proxy for different indoor environments and activities.\" Environmental Science & Technology Letters 8.5 (2021): 392-397.*\n\n[2] *Lelieveld, Jos, et al. \"Model calculations of aerosol transmission and infection risk of COVID-19 in indoor environments.\" International journal of environmental research and public health 17.21 (2020): 8114.*\n\n----\n\nInstallation\n------------\n\nAs the compiled **archABM** package is hosted on the Python Package\nIndex (PyPI) you can easily install it with `pip`. To install\n**archABM**, run this command in your terminal of choice:\n\n``` {.sourceCode .shell-session}\n$ pip install archABM\n```\n\nor, alternatively:\n\n``` {.sourceCode .shell-session}\n$ python -m pip install archABM\n```\n\nIf you want to get **archABM**'s latest version, you can refer to the\nrepository hosted at github:\n\n``` {.sourceCode .shell-session}\npython -m pip install https://github.com/Vicomtech/ArchABM/archive/main.zip\n```\n\n----\n\nGetting Started\n---------------\n\nUse the following template to run a simulation with archABM:\n\n```python\n# Import modules\nimport json\nimport pandas as pd\nfrom archABM.engine import Engine\n\n# Read configuration example\nfrom archABM.config import config\n# Alternatively, get configuration from \"config.json\" example\n\n# Create ArchABM simulation engine\nsimulation = Engine(config)\n\n# Run simulation\nresults = simulation.run()\n\n# Create dataframes based on the results\ndf_people = pd.DataFrame(results[\"results\"][\"people\"])\ndf_places = pd.DataFrame(results[\"results\"][\"places\"])\n```\n\n\nThis example uses the default configuration file built-in the library.\nAlternatively, you can download and modify the [config.json](data/config.json) file found at the ``data`` directory of **archABM** repository.\n\n----\n\nDevelopers can also use the command-line interface with the [main.py](https://github.com/Vicomtech/ArchABM) file from the source code repository.\n\n\n<img src=\"https://raw.githubusercontent.com/Vicomtech/ArchABM/main/docs/source/_static/command.png\" width=\"500\" align=\"center\"/>\n\n```console\n$ python main.py config.json\n```\n\nCheck the ``--help`` option to get more information about the optional parameters:\n\n```\n$ python main.py --help\nUsage: main.py [OPTIONS] CONFIG_FILE\n\n  ArchABM simulation helper\n\nArguments:\n  CONFIG_FILE  The name of the configuration file  [required]\n\nOptions:\n  -i, --interactive     Interactive CLI mode  [default: False]\n  -l, --save-log        Save events logs  [default: False]\n  -c, --save-config     Save configuration file  [default: True]\n  -t, --save-csv        Export results to csv format  [default: True]\n  -j, --save-json       Export results to json format  [default: False]\n  -o, --return-output   Return results dictionary  [default: False]\n  --install-completion  Install completion for the current shell.\n  --show-completion     Show completion for the current shell, to copy it or\n                        customize the installation.\n\n  --help                Show this message and exit.\n```\n\nTo run an example with the CLI, download the [config.json](data/config.json) file found at the ``data`` directory of **archABM** repository.\n\n----\n\n## Inputs \n\nIn order to run a simulation, information about the `event` types,\n`people`, `places`, and the `aerosol model` must be provided to the\nArchABM framework.\n\n<details>\n  <summary>Events</summary>\n  \n| Attribute | Description | Type |\n|---|---|---|\n| *name* | Event name | `string` |\n| *schedule* | When an event is permitted to happen, in minutes | `list of tuples` |\n| *duration* | Event duration lower and upper bounds, in minutes | `integer`,`integer` |\n| *number of repetitions* | Number of repetitions lower and upper bounds | `integer`,`integer` |\n| *mask efficiency* | Mask efficiency during an event [0-1] | `float` |\n| *collective* | Event is invoked by one person but involves many | `boolean` |\n| *allow* | Whether such event is allowed in the simulation | `boolean` |\n \n</details>\n\n<details>\n  <summary>Places</summary>\n  \n| Attribute | Description | Type |\n|:---:|:---:|:---:|\n| *name* | Place name | `string` |\n| *activity* | Activity or event occurring at that place | `string` |\n| *department* | Department name | `string` |\n| *building* | Building name | `string` |\n| *area* | Room floor area in square meters | `float` |\n| *height* | Room height in meters. | `float` |\n| *capacity* | Room people capacity. | `integer` |\n| *height* | Room height in meters. | `float` |\n| *ventilation* | Passive ventilation in hours<sup>-1</sup> | `float` |\n| *recirculated_flow_rate* | Active ventilation in cubic meters per hour | `float` |\n| *allow* | Whether such place is allowed in the simulation | `boolean` |\n \n</details>\n\n<details>\n  <summary>People</summary>\n  \n| Attribute | Description | Type |\n|:---:|:---:|:---:|\n| *department* | Department name | `string` |\n| *building* | Building name | `string` |\n| *num_people* | Number of people | `integer` |\n \n</details>\n\n\n<details>\n  <summary>Aerosol Model</summary>\n  \n| Attribute | Description | Type |\n|:---:|:---:|:---:|\n| *pressure* | Ambient pressure in atm | `float` |\n| *temperature* | Ambient temperature in Celsius degrees | `float` |\n| *CO2_background* | Background CO2 concentration in ppm | `float` |\n| *decay_rate* | Decay rate of virus in hours<sup>-1</sup> | `float` |\n| *deposition_rate* | Deposition to surfaces in hours<sup>-1</sup> | `float` |\n| *hepa_flow_rate* | Hepa filter flow rate in cubic meters per hour | `float` |\n| *filter_efficiency* | Air conditioning filter efficiency | `float` |\n| *ducts_removal* | Air ducts removal loss | `float` |\n| *other_removal* | Extraordinary air removal | `float` |\n| *fraction_immune* | Fraction of people immune to the virus | `float` |\n| *breathing_rate* | Mean breathing flow rate in cubic meters per hour | `float` |\n| *CO2_emission_person* | CO2 emission rate at 273K and 1atm | `float` |\n| *quanta_exhalation* | Quanta exhalation rate in quanta per hour | `float` |\n| *quanta_enhancement* | Quanta enhancement due to variants | `float` |\n| *people_with_masks* | Fraction of people using mask | `float` |\n \n</details>\n\n<details>\n  <summary>Options</summary>\n  \n| Attribute | Description | Type |\n|:---:|:---:|:---:|\n| *movement_buildings* | Allow people enter to other buildings | `boolean` |\n| *movement_department* | Allow people enter to other departments | `boolean` |\n| *number_runs* | Number of simulations runs to execute | `integer` |\n| *save_log* | Save events logs | `boolean` |\n| *save_config* | Save configuration file | `boolean` |\n| *save_csv* | Export the results to csv format | `boolean` |\n| *save_json* | Export the results to json format | `boolean` |\n| *return_output* | Return a dictionary with the results | `boolean` |\n| *directory* | Directory name to save results | `string` |\n| *ratio_infected* | Ratio of infected to total number of people | `float` |\n| *model* | Aerosol model to be used in the simulation | `string` |\n \n</details>\n\n#### Example config.json\n<details>\n  <summary>config.json</summary>\n    \n```json\n{\n    \"events\": [{\n            \"activity\": \"home\",\n            \"schedule\": [\n                [0, 480],\n                [1020, 1440]\n            ],\n            \"repeat_min\": 0,\n            \"repeat_max\": null,\n            \"duration_min\": 300,\n            \"duration_max\": 360,\n            \"mask_efficiency\": null,\n            \"collective\": false,\n            \"shared\": false,\n            \"allow\": true\n        },\n        {\n            \"activity\": \"work\",\n            \"schedule\": [\n                [480, 1020]\n            ],\n            \"repeat_min\": 0,\n            \"repeat_max\": null,\n            \"duration_min\": 30,\n            \"duration_max\": 60,\n            \"mask_efficiency\": 0.0,\n            \"collective\": false,\n            \"shared\": true,\n            \"allow\": true\n        },\n        {\n            \"activity\": \"meeting\",\n            \"schedule\": [\n                [540, 960]\n            ],\n            \"repeat_min\": 0,\n            \"repeat_max\": 5,\n            \"duration_min\": 20,\n            \"duration_max\": 90,\n            \"mask_efficiency\": 0.0,\n            \"collective\": true,\n            \"shared\": true,\n            \"allow\": true\n        },\n        {\n            \"activity\": \"lunch\",\n            \"schedule\": [\n                [780, 900]\n            ],\n            \"repeat_min\": 1,\n            \"repeat_max\": 1,\n            \"duration_min\": 20,\n            \"duration_max\": 45,\n            \"mask_efficiency\": 0.0,\n            \"collective\": true,\n            \"shared\": true,\n            \"allow\": true\n        },\n        {\n            \"activity\": \"coffee\",\n            \"schedule\": [\n                [600, 660],\n                [900, 960]\n            ],\n            \"repeat_min\": 0,\n            \"repeat_max\": 2,\n            \"duration_min\": 5,\n            \"duration_max\": 15,\n            \"mask_efficiency\": 0.0,\n            \"collective\": true,\n            \"shared\": true,\n            \"allow\": true\n        },\n        {\n            \"activity\": \"restroom\",\n            \"schedule\": [\n                [480, 1020]\n            ],\n            \"repeat_min\": 0,\n            \"repeat_max\": 4,\n            \"duration_min\": 3,\n            \"duration_max\": 6,\n            \"mask_efficiency\": 0.0,\n            \"collective\": false,\n            \"shared\": true,\n            \"allow\": true\n        }\n    ],\n    \"places\": [{\n            \"name\": \"home\",\n            \"activity\": \"home\",\n            \"building\": null,\n            \"department\": null,\n            \"area\": null,\n            \"height\": null,\n            \"capacity\": null,\n            \"ventilation\": null,\n            \"recirculated_flow_rate\": null,\n            \"allow\": true\n        },\n        {\n            \"name\": \"open_office\",\n            \"activity\": \"work\",\n            \"building\": \"building1\",\n            \"department\": [\"department1\", \"department2\", \"department3\", \"department4\"],\n            \"area\": 330.0,\n            \"height\": 2.7,\n            \"capacity\": 60,\n            \"ventilation\": 1.5,\n            \"recirculated_flow_rate\": 0,\n            \"allow\": true\n        },\n        {\n            \"name\": \"it_office\",\n            \"activity\": \"work\",\n            \"building\": \"building1\",\n            \"department\": [\"department4\"],\n            \"area\": 52.0,\n            \"height\": 2.7,\n            \"capacity\": 10,\n            \"ventilation\": 1.5,\n            \"recirculated_flow_rate\": 0,\n            \"allow\": true\n        },\n        {\n            \"name\": \"chief_office_A\",\n            \"activity\": \"work\",\n            \"building\": \"building1\",\n            \"department\": [\"department5\", \"department6\", \"department7\"],\n            \"area\": 21.0,\n            \"height\": 2.7,\n            \"capacity\": 5,\n            \"ventilation\": 1.5,\n            \"recirculated_flow_rate\": 0,\n            \"allow\": true\n        },\n        {\n            \"name\": \"chief_office_B\",\n            \"activity\": \"work\",\n            \"building\": \"building1\",\n            \"department\": [\"department5\", \"department6\", \"department7\"],\n            \"area\": 21.0,\n            \"height\": 2.7,\n            \"capacity\": 5,\n            \"ventilation\": 1.5,\n            \"recirculated_flow_rate\": 0,\n            \"allow\": true\n        },\n        {\n            \"name\": \"chief_office_C\",\n            \"activity\": \"work\",\n            \"building\": \"building1\",\n            \"department\": [\"department5\", \"department6\", \"department7\"],\n            \"area\": 24.0,\n            \"height\": 2.7,\n            \"capacity\": 5,\n            \"ventilation\": 1.5,\n            \"recirculated_flow_rate\": 0,\n            \"allow\": true\n        },\n        {\n            \"name\": \"meeting_A\",\n            \"activity\": \"meeting\",\n            \"building\": \"building1\",\n            \"department\": [\"department1\", \"department2\", \"department3\", \"department5\", \"department6\", \"department7\"],\n            \"area\": 16.0,\n            \"height\": 2.7,\n            \"capacity\": 6,\n            \"ventilation\": 1.0,\n            \"recirculated_flow_rate\": 0,\n            \"allow\": true\n        },\n        {\n            \"name\": \"meeting_B\",\n            \"activity\": \"meeting\",\n            \"building\": \"building1\",\n            \"department\": [\"department1\", \"department2\", \"department3\", \"department5\", \"department6\", \"department7\"],\n            \"area\": 16.0,\n            \"height\": 2.7,\n            \"capacity\": 6,\n            \"ventilation\": 1.0,\n            \"recirculated_flow_rate\": 0,\n            \"allow\": true\n        },\n        {\n            \"name\": \"meeting_C\",\n            \"activity\": \"meeting\",\n            \"building\": \"building1\",\n            \"department\": [\"department1\", \"department2\", \"department3\", \"department5\", \"department6\", \"department7\"],\n            \"area\": 11.0,\n            \"height\": 2.7,\n            \"capacity\": 4,\n            \"ventilation\": 1.0,\n            \"recirculated_flow_rate\": 0,\n            \"allow\": true\n        },\n        {\n            \"name\": \"meeting_D\",\n            \"activity\": \"meeting\",\n            \"building\": \"building1\",\n            \"department\": null,\n            \"area\": 66.0,\n            \"height\": 2.7,\n            \"capacity\": 24,\n            \"ventilation\": 1.5,\n            \"recirculated_flow_rate\": 0,\n            \"allow\": true\n        },\n        {\n            \"name\": \"coffee_A\",\n            \"activity\": \"coffee\",\n            \"building\": \"building1\",\n            \"department\": null,\n            \"area\": 25.0,\n            \"height\": 2.7,\n            \"capacity\": 10,\n            \"ventilation\": 1.5,\n            \"recirculated_flow_rate\": 0,\n            \"allow\": true\n        },\n        {\n            \"name\": \"coffee_B\",\n            \"activity\": \"coffee\",\n            \"building\": \"building1\",\n            \"department\": null,\n            \"area\": 55.0,\n            \"height\": 2.7,\n            \"capacity\": 20,\n            \"ventilation\": 1.5,\n            \"recirculated_flow_rate\": 0,\n            \"allow\": true\n        },\n        {\n            \"name\": \"restroom_A\",\n            \"activity\": \"restroom\",\n            \"building\": \"building1\",\n            \"department\": null,\n            \"area\": 20.0,\n            \"height\": 2.7,\n            \"capacity\": 4,\n            \"ventilation\": 1.0,\n            \"recirculated_flow_rate\": 0,\n            \"allow\": true\n        },\n        {\n            \"name\": \"restroom_B\",\n            \"activity\": \"restroom\",\n            \"building\": \"building1\",\n            \"department\": [\"department1\", \"department2\", \"department3\", \"department4\", \"department5\", \"department6\"],\n            \"area\": 20.0,\n            \"height\": 2.7,\n            \"capacity\": 4,\n            \"ventilation\": 1.0,\n            \"recirculated_flow_rate\": 0,\n            \"allow\": true\n        },\n        {\n            \"name\": \"lunch\",\n            \"activity\": \"lunch\",\n            \"building\": \"building1\",\n            \"department\": null,\n            \"area\": 150.0,\n            \"height\": 2.7,\n            \"capacity\": 60,\n            \"ventilation\": 1.5,\n            \"recirculated_flow_rate\": 0,\n            \"allow\": true\n        }\n    ],\n    \"people\": [{\n            \"department\": \"department1\",\n            \"building\": \"building1\",\n            \"num_people\": 16\n        },\n        {\n            \"department\": \"department2\",\n            \"building\": \"building1\",\n            \"num_people\": 16\n        },\n        {\n            \"department\": \"department3\",\n            \"building\": \"building1\",\n            \"num_people\": 16\n        },\n        {\n            \"department\": \"department4\",\n            \"building\": \"building1\",\n            \"num_people\": 7\n        },\n        {\n            \"department\": \"department5\",\n            \"building\": \"building1\",\n            \"num_people\": 2\n        },\n        {\n            \"department\": \"department6\",\n            \"building\": \"building1\",\n            \"num_people\": 2\n        },\n        {\n            \"department\": \"department7\",\n            \"building\": \"building1\",\n            \"num_people\": 1\n        }\n    ],\n    \"options\": {\n        \"movement_buildings\": true,\n        \"movement_department\": false,\n        \"number_runs\": 1,\n        \"save_log\": true,\n        \"save_config\": true,\n        \"save_csv\": false,\n        \"save_json\": false,\n        \"return_output\": false,\n        \"directory\": null,\n        \"ratio_infected\": 0.05,\n        \"model\": \"Colorado\",\n        \"model_parameters\": {\n            \"Colorado\": {\n                \"pressure\": 0.95,\n                \"temperature\": 20,\n                \"CO2_background\": 415,\n                \"decay_rate\": 0.62,\n                \"deposition_rate\": 0.3,\n                \"hepa_flow_rate\": 0.0,\n                \"recirculated_flow_rate\": 300,\n                \"filter_efficiency\": 0.20,\n                \"ducts_removal\": 0.10,\n                \"other_removal\": 0.00,\n                \"fraction_immune\": 0,\n                \"breathing_rate\": 0.52,\n                \"CO2_emission_person\": 0.005,\n                \"quanta_exhalation\": 25,\n                \"quanta_enhancement\": 1,\n                \"people_with_masks\": 1.00\n            }\n        }\n    }\n}\n```\n</details>\n\n----\n\n## Outputs\n\nSimulation outputs are stored by default in the `results` directory. The\nsubfolder with the results of an specific simulation have the date and\ntime of the moment when it was launched as a name in\n`%Y-%m-%d_%H-%M-%S-%f` format.\n\nBy default, three files are saved after a simulation:\n\n-   `config.json` stores a copy of the input configuration.\n-   `people.csv` stores every person's state along time.\n-   `places.csv` stores every places's state along time.\n\n**archABM** offers the possibility of exporting the results in *JSON*\nand *CSV* format. To export in *JSON* format, use the `--save-json`\nparameter when running archABM. By default, the `--save-csv` parameter\nis set to true.\n\nAlternatively, **archABM** can also be configured to yield more detailed\ninformation. The `app.log` file saves the log of the actions and events\noccurred during the simulation. To export this file, use the\n`--save-log` parameter when running archABM.\n\n----\n\n## Citing archABM\n\nIf you use ArchABM in your work or project, please cite the following article, published in the\n[Building and Environment](https://www.sciencedirect.com/journal/building-and-environment) journal. \n(https://doi.org/10.1016/j.buildenv.2021.108495): \n\nBibtex entry:\n\n```bibtex\n@article{MARTINEZ2021108495,\n    title = {ArchABM: An agent-based simulator of human interaction with the built environment. CO2 and viral load analysis for indoor air quality},\n    journal = {Building and Environment},\n    pages = {108495},\n    year = {2021},\n    issn = {0360-1323},\n    doi = {https://doi.org/10.1016/j.buildenv.2021.108495},\n    url = {https://www.sciencedirect.com/science/article/pii/S036013232100891X},\n    author = {I\u00f1igo Martinez and Jan L. Bruse and Ane M. Florez-Tapia and Elisabeth Viles and Igor G. Olaizola},\n    keywords = {Agent-based modeling, Indoor air quality, Building ventilation, Aerosol model, Building design, Simulation}\n}\n```\n",
    "bugtrack_url": null,
    "license": "MIT license",
    "summary": "Agent based simulation for architectural spaces",
    "version": "0.4.1",
    "split_keywords": [
        "agent simulation",
        "architecture",
        "building",
        "workplace",
        "discrete-event"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e1b882c0d1791fcb7dc611c70de834c9f2eb9f2e4cd0aee33f987ed416fa9c4c",
                "md5": "7c2f792a15c68e7980b5735d6fced771",
                "sha256": "491bf49759056d1bb1a5179e2baedf925082b7e1dc6aa9bac9e12fcd82c433cb"
            },
            "downloads": -1,
            "filename": "archABM-0.4.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7c2f792a15c68e7980b5735d6fced771",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.5, <4",
            "size": 34256,
            "upload_time": "2023-01-26T15:46:46",
            "upload_time_iso_8601": "2023-01-26T15:46:46.608078Z",
            "url": "https://files.pythonhosted.org/packages/e1/b8/82c0d1791fcb7dc611c70de834c9f2eb9f2e4cd0aee33f987ed416fa9c4c/archABM-0.4.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5bcdbf2f2976163fc79a54bd31f688faf9b3cf84d3644739d1d18db99fb2a357",
                "md5": "264b135f0cf035a4d843f52886c2dded",
                "sha256": "344633b9533a5fee7daa5117b1f5070f332a1a7fbbdfdbd7572edc0bfa6a1e8f"
            },
            "downloads": -1,
            "filename": "archABM-0.4.1.tar.gz",
            "has_sig": false,
            "md5_digest": "264b135f0cf035a4d843f52886c2dded",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.5, <4",
            "size": 31379,
            "upload_time": "2023-01-26T15:46:49",
            "upload_time_iso_8601": "2023-01-26T15:46:49.198276Z",
            "url": "https://files.pythonhosted.org/packages/5b/cd/bf2f2976163fc79a54bd31f688faf9b3cf84d3644739d1d18db99fb2a357/archABM-0.4.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-26 15:46:49",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "Vicomtech",
    "github_project": "ArchABM",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "archabm"
}
        
Elapsed time: 0.07611s