GithubHelp home page GithubHelp logo

zhwlxl / python-tdm Goto Github PK

View Code? Open in Web Editor NEW

This project forked from joshchea/python-tdm

0.0 0.0 0.0 1.01 MB

Python modules for typical travel demand modeling calculations

License: MIT License

Python 100.00%

python-tdm's Introduction

python-tdm

Python modules for typical travel demand modeling calculations

Contributors: Chetan Joshi, Portland OR

Requires: Python with standard modules and numpy

Tested With: Data from DVRPC and Waterloo demand models

License: The MIT License (MIT)

License URI: https://opensource.org/licenses/MIT

Description: These are some python scripts that can be used as modules for performing typical calculations in a travel demand model. The expected usage is to put the py file in the site packages or other directory and then to use the import command in python to load the functions in the modules. The documentation for usage of each of the functions is shown in the python scripts and it should also show up in the help as you type the function.

Distribution functions:

a) CalcFratar : Calculates a Fratar/IPF on a seed matrix given row and column (P and A) totals

b) CalcSinglyConstrained : Calculates a singly constrained trip distribution for given P/A vectors and a friction factor matrix

c) CalcDoublyConstrained : Calculates a doubly constrained trip distribution for given P/A vectors and a friction factor matrix (P and A should be balanced before usage, if not then A is scaled to P)

d) CalcMultiFratar : Applies fratar model to given set of trip matrices with multiple target production vectors and one attraction vector

e) CalcMultiDistribute : Applies gravity model to a given set of friction matrices with multiple production vectors and one target attraction vector

Choice functions:

a) CalcMultinomialChoice : Calculates a multinomial choice model probability given a dictionary of mode utilities

b) CalcPivotPoint : Calculates pivot point choice probability given base utilities, current utilities and base proabilities

c) CalcNestedChoice : Calculates n-level nested mode choice probabilities given dictionary with tree definition, matrix references and number of zones

d) CalcNestedChoiceFlat : Calculate nested choice on flat array so it can be used for stuff like microsim ABM etc. usage is same as c) but inputs are flat arrays instead of square matrices and length of vector/s instead of number of zones

Matrix estimation (ODME):

a) MatEstimateGradient : Performs synthetic matrix estimation using a least squares formulation. The solution algorithm is gradient descent (see Spiess, H., "A GRADIENT APPROACH FOR THE O-D MATRIX ADJUSTMENT PROBLEM", Publication 693, CRT, University of Montreal, 1990.)

If you use some of the components or code in this repo, please consider citing as shown below. Have fun!

Joshi. C, python-tdm, (2015), GitHub repository, https://github.com/joshchea/python-tdm#python-tdm

python-tdm's People

Contributors

joshchea avatar

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.