Skip to content

Commit 843dbc6

Browse files
authored
Merge pull request #81 from NREL/yep/release-preparation
Updating README for public release
2 parents 385e67d + e7c6e7e commit 843dbc6

File tree

1 file changed

+35
-41
lines changed

1 file changed

+35
-41
lines changed

README.md

Lines changed: 35 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Demographic Microsimulator (DEMOS)
22

3-
[![Docs](https://github.com/NREL/DEMOS_NREL/actions/workflows/docs.yml/badge.svg)](https://nrel.github.io/DEMOS_NREL/)
3+
[![Docs](https://github.com/NREL/DEMOS_NREL/actions/workflows/docs.yml/badge.svg)](https://nrel.github.io/DEMOS/)
44

55
## Overview
66
The Demographic Microsimulator (DEMOS) is an agent-based simulation framework used to model the evolution of population demographic characteristics and lifecycle events, such as education attainment, marital status, and other key transitions. DEMOS modules are designed to capture the interdependencies between short-term and long-term lifecycle events, which are often influential in downstream transportation and land-use modeling.
@@ -14,32 +14,53 @@ A technical memorandum describing DEMOS is available [here](./DEMOS_Technical_Me
1414
*Sun, Bingrong, Shivam Sharda, Venu M. Garikapati, Mohamed Amine Bouzaghrane, Juan Caicedo, Srinath Ravulaparthy, Isabel Viegas de Lima, Ling Jin, C. Anna Spurlock, and Paul Waddell. "Demographic Microsimulator for Integrated Urban Systems: Adapting Panel Survey of Income Dynamics to Capture the Continuum of Life." Transportation Research Record (2025): 03611981251333339.*
1515

1616
## Usage
17-
> A public Docker image of DEMOS has been released. Please follow the `From Source` instructions.
1817

19-
### Docker Container
20-
The docker image for demos is stored in `registry/demos:latest`. The input data and configuration file are fed to the container through volumes. Alternatively, we provide a `docker-compose` workflow that can be used.
18+
### Docker Compose (recommended)
19+
The latest docker image for demos is stored in `ghcr.io/nrel/demos:latest`. The input data and configuration file are fed to the container through volumes. Alternatively, we provide a `docker-compose` workflow that can be used.
20+
21+
#### Prepare the configuration file and data folder
2122

22-
For running the `docker-compose` workflow:
2323
```bash
24-
DEMOS_CONFIG_PATH=<path-to-config> DEMOS_DATA_DIR=<path-to-data-dir> docker-compose up
24+
# Create a directory where to run DEMOS from
25+
mkdir demos
26+
cd demos
27+
28+
# Create the configuration folder and retrieve an example configuration
29+
mkdir configuration
30+
cd configuration
31+
curl -L -o demos_config_sfbay.toml https://raw.githubusercontent.com/nrel/DEMOS/main/configuration/demos_config_sfbay.toml
32+
33+
# Create the data folder for the output to be stored
34+
cd ..
35+
mkdir data
36+
# Populate the data folder
37+
38+
# Finally, retrieve the docker-compose.yml file
39+
curl -L -o docker-compose.yml https://raw.githubusercontent.com/nrel/DEMOS/main/docker-compose.yml
2540
```
2641

27-
By default `DEMOS_CONFIG_PATH` is set to `./demos_config.toml` and `DEMOS_DATA_DIR` is set to `./data`, so if `data` and `demos_config.toml` are part of the current directory, no additional input is needed.
28-
29-
Alternatively,
42+
Now you can run docker as follows:
3043
```bash
31-
docker run --volume <path-to-config>:/demos/config.toml:ro --volume <path-to-data-dir>:/demos/data --platform=linux/amd64 demos
44+
docker compose up
3245
```
33-
3446
#### IMPORTANT for MacOS and Windows users
3547
> Docker imposes a global limit on how much RAM containers can allocate. DEMOS easily surpases those limits, so in order to run DEMOS in Docker, users need to access the Docker Desktop GUI and `Preferences → Resources → Memory → Increase it (at least 16-20gb)`
3648
37-
#### Building the docker image (development only)
49+
Documentation for custom data requirements, configuration and overall functionality of demos can be found [in the Docs](https://nrel.github.io/DEMOS/).
50+
51+
## Other ways to run DEMOS
52+
53+
If you need to change either the data or configuration path:
3854
```bash
39-
docker build -t demos:0.0.1 --platform=linux/amd64 -f Dockerfile .
55+
DEMOS_CONFIG_PATH=<path-to-config> DEMOS_DATA_DIR=<path-to-data-dir> docker compose up
4056
```
4157

42-
### From Source
58+
Alternatively, if you prefer not to use docker compose, you can specify the ccreation of volumes to your data and configuration as follows:
59+
```bash
60+
docker run --volume <path-to-config>:/demos/config.toml:ro --volume <path-to-data-dir>:/demos/data --platform=linux/amd64 ghcr.io/nrel/demos:latest
61+
```
62+
63+
### Running from Source
4364

4465
1. Clone this repository
4566
```
@@ -59,30 +80,3 @@ docker build -t demos:0.0.1 --platform=linux/amd64 -f Dockerfile .
5980
conda activate demos-env
6081
pip install .
6182
```
62-
63-
## Running DEMOS
64-
65-
DEMOS requires a series of input tables. Example tables are provided [here](https://app.box.com/s/tox2nflumia2g4n6rk2i0navca9pskep) for internal NREL use. It is recommended to store all the input values in the folder `data` in root of the project, but absolute values can be used by specifying them in the configuration file. You may also refer to the data description [here](https://cloud.urbansim.com/docs/general/documentation/urbansim%20block%20model%20data.html)
66-
67-
To run demos:
68-
```
69-
python simulate.py -cfg {configuration_file}
70-
```
71-
72-
73-
74-
A default configuration file is provided in `configuration/demos_config.toml`. The `[[tables]]` entries outline tables to be loaded. For example, we can load the `persons` and `households` table from an H5 source:
75-
76-
```toml
77-
[[tables]]
78-
file_type = "h5"
79-
table_name = "persons"
80-
filepath = "../data/custom_mpo_06197001_model_data.h5"
81-
h5_key = "persons"
82-
83-
[[tables]]
84-
file_type = "h5"
85-
table_name = "households"
86-
filepath = "../data/custom_mpo_06197001_model_data.h5"
87-
h5_key = "households"
88-
```

0 commit comments

Comments
 (0)