Getting Started¶
This page describes how to install and run PopulationSim with the provided example.
Installation¶
Install Anaconda 64bit Python 3. Anaconda Python is required for PopulationSim.
If you access the internet from behind a firewall, then you will need to configure your proxy server. To do so, create a .condarc file in your Anaconda installation folder (i.e.
C:\ProgramData\Anaconda3
), such as:
proxy_servers:
http: http://myproxy.org:8080
https: https://myproxy.org:8080
ssl_verify: false
Create and activate an Anaconda environment (basically a Python install just for this project)
conda create -n popsim python=3.7
#Windows
activate popsim
#Mac
conda activate popsim
Get and install the PopulationSim package on the activated conda Python environment:
pip install populationsim
Python 2 or 3?¶
Note
PopulationSim is a 64bit Python 2 or 3 library that uses a number of packages from the scientific Python ecosystem, most notably pandas and numpy. It relies heavily on the ActivitySim package. Both ActivitySim and PopulationSim currently support Python 2, but Python 2 will be retired at the end of 2019 so Python 3 is recommended.
The recommended way to get your own scientific Python installation is to install 64 bit Anaconda, which contains many of the libraries upon which ActivitySim depends + some handy Python installation management tools.
For more information on Anaconda and ActivitySim, see ActivitySim’s getting started guide.
Run Examples¶
There are three examples for running PopulationSim, two created using data from the Corvallis-Albany-Lebanon Modeling (CALM) region in Oregon and the other using data from the Metro Vancouver region in British Columbia. The example_calm set-up runs PopulationSim in base mode, where a synthetic population is created for the entire modeling region. This takes approximately 12 minutes on a laptop with an Intel i7-4800MQ CPU @ 2.70GHz and 16 GB of RAM. The example_calm_repop set-up runs PopulationSim in the repop mode, which updates the synthetic population for a small part of the region. The example_survey_weighting set-up runs PopulationSim for the case of developing final weights for a household travel survey. More information on the configuration of PopulationSim can be found in the Application & Configuration section.
Example_calm¶
Follow the steps below to run example_calm set up:
Open a command prompt in the example_calm folder
Run the following commands:
activate popsim python run_populationsim.py
Review the outputs in the output folder
Example_calm_repop¶
The repop configuration requires outputs from a base run. Therefore, the base configuration must be run before running the repop configuration. Follow the steps below to run example_calm_repop set up:
Copy the pipeline.h5 file from the example_calm\output directory to example_calm_repop\output directory (all PopulationSim files are stored in pipeline.h5 file)
Open a command prompt in the example_calm_repop folder
Run the following commands:
activate popsim python run_populationsim.py
Review the outputs in the output folder
Example_survey_weighting¶
Follow the steps below to run example_survey_weighting set up:
Open a command prompt in the example_survey_weighting folder
Run the following commands:
activate popsim python run_populationsim.py
Review the outputs in the output folder