Coder Social home page Coder Social logo

cmap-repos / cmap_trip-based_model Goto Github PK

View Code? Open in Web Editor NEW
3.0 4.0 3.0 428.66 MB

CMAP's trip-based ("four-step") model source code

Batchfile 4.54% Python 86.85% Jupyter Notebook 6.47% P4 0.01% Raku 0.01% Lua 0.01% R 2.00% PowerShell 0.12%
travel-modeling emme

cmap_trip-based_model's Introduction

CMAP Trip-based Model

This repository contains the code needed to run the CMAP trip-based model's mode, destination and time-of-day model components.

Installation Instructions

  • First, if "conda" is not already installed and accessible by the current user on the target development machine, install it. An easy installation solution is using the "Mambaforge" installer, which can be downloaded for Windows here. Once downloaded, double-click and run the installer. Mamba is a somewhat faster implementation of the conda package installer, and can be used interchangably with conda - nearly any command you might run as conda foo can also be run as mamba foo.

  • Then if needed also install git and (optionally) the GitHub command line interface. From either the Anaconda Prompt or the Miniforge Prompt, run:

    mamba install git gh -c conda-forge 
  • Now clone the CMAP trip-based model code from GitHub, and checkout the CS2021 branch.

    gh repo clone camsys/cmap_trip-based_model  
    cd cmap_trip-based_model  
    git checkout CS2021  

    To clone into a different directory than the current directory (probably the user's home directory) change to that directory using cd first.

  • Next, create a conda environment to use for the mode, destination and time-of-day model components, which are written in Python.
    Creating a unique environment will ensure that all the necessary computational libraries are installed, and no conflicts are introduced with other tools (including Emme). A conda environment file is included in the GitHub repository, which installs everything you need into an environment called "CMAP-TRIP".

    conda env create --file src/Mode-Dest-TOD/conda-environment.yml

    Many of the necessary files for a basic run of the model using the default base year inputs are already in the repository, but not everything. The emmebank, skim data, and few other files are quite large and don't fit nicely into git. You can get the rest of these files from Amazon's S3 service.

    conda activate CMAP-TRIP
    python get_data/get_data.py

Execution Instructions

Running the Full Model (including Feedback Iterations)

Running the full model requires an active and properly licensed EMME installation, plus a conda package and environment manager (available as open source, described above under installation). Assuming these are available, run the batch script:

cd Database
Submit_Full_Regional_Model.bat

This batch script can be run from any flavor of conda terminal (Anaconda Prompt, Miniforge Prompt, etc) or from a plain Windows command prompt, which means it can also be run just by double-clicking the Submit_Full_Regional_Model.bat file in Windows Explorer.

Running Only the Mode, Destination and Time-of-Day Components

To run the mode, destination, and time-of-day components for the CMAP Trip-based model, first activate the correct conda environment. From either the Anaconda Prompt or the Miniforge Prompt, run:

conda activate CMAP-TRIP

(If you created an environment with some other name, activate that other environment instead.)

Then, you can run the model by calling its executable version right from that same command prompt, pointing at the correct Database directory:

cmap_modedest .\path\to\Database

The cmap_modedest command line tool has a number of available options. The most important of these include the number of jobs (--njobs N) and the maximum number of origin zones processed per chunk (--max_zone_chunk N), each of which needs to be set appropriately for the computer running the model to maximize resource usage (CPU's, RAM) without exceeding available resources, which can cause out-of-memory errors or processor thrashing that can slow the overall runtime. A complete list of other options can be reviewed in the online help:

cmap_modedest --help

cmap_trip-based_model's People

Contributors

jpn-- avatar nrferguson avatar tinleycraig avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

cmap_trip-based_model's Issues

Broken dependencies in `conda-environment.yml`

The .yml providing an environment configuration attempts to install package versions that are incompatible; some examples:

numba v0.53 doesn't work with tbb v2021.4
numba v0.53 doesn't work with numpy v1.21

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.