Coder Social home page Coder Social logo

bca4abm's People

Contributors

bstabler avatar toliwaga avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bca4abm's Issues

terminology and model setup

@toliwaga and I decided on the following terminology and model setup.

base and build

The BCA tool will expect the user to provide a base folder location and a build folder location. The two folders will contain the same input files.

The four sets of alternatives are named as follows:

  1. basetrips_baselos
  2. basetrips_buildlos
  3. buildtrips_buildlos
  4. buildtrips_baselos

alt

Within the code and in the exposed expressions, alt and altlos is used.

  1. alt means the other scenario
  2. altlos means the LOS (skims) from the other scenario

need to implement multiyear processor capability?

The sandag bca tool takes scenario runs for multiple years and does some sort of interpolation/extrapolation between the years. Do we need to support anything like that? And if so, what is the spec for which columns are to be handled in what ways?

remove docs and tutorials folder?

I think we should remove the docs and tutorials folder. Maybe we move the tutorial to @toliwaga's account, or maybe branch it off, or move it to devtools, or maybe the doc folder.

need to break out ovt time for transit?

The sandag bca tool weights ovt differently for vot calculations but ovt isn't broken out for transit trips in bcatest6 sample db

Are we just going to ignore this for the initial version?

coc grouping for auto ownership

vehicle ownership is by households, but some coc determinations (age) are person-based and some are hh based (income)

to allocate auto ownership by coc, do we use the age of the oldest hh member?

Suppose there is a household with two members ages 35 and 85 and two cars, do we try and be really clever and allocate one car to each hh member? And what if there are three adults hh members and two cars?

need full scale dataset to test performance

Up until now we have only run this against the trivially small sample database.

We have no idea what the performance will be with a big dataset. It would be nice to find out.

Who is tasked with assembling a full scale dataset for testing?

aggregate_zone processor file handling

For the aggregate_zone processor, we will allow the analyst to specify a list of csv files that should be combined into a single table.

I am wondering whether to include the 1024 column cval table, and whether that needs to be special-cased. All the other zone files will have two versions, one for the build and one for the base scenario. I was thinking we could handle that by automatically prepending base_ or build_ to the column names, but we probably don’t want to create two versions of the 1024 cval columns (unless they can be different in build and base? In which case we also need two versions in the aggregate demographics processor?)

create example of groupby calculation based on link to_node

@VinceBernardin said "I think the logic to determine which nodes are intersections would be pretty basic. If the node is connected to a freeway link, it is not an intersection, and if the node is a centroid it is not an intersection. I think that would probably be good enough. Then we would just need to determine the number of legs and the max and min volume approaches which takes a little work, requiring a join between the links and nodes but isn’t really too difficult."

load_data_processor to import data into hdf5 store

It might be worthwhile to have a load_data_processor that reads the csv data files into an hdf5 store and then the individual processors could read their input from the store (a la activitysim.)

This might be a lot faster, as the load process wold only need to be run if the input data changed, which might be convenient while the model is being initially built, tweaked, and re-run with the same data, but revised specs and settings.

Also, it would make it more flexible because different versions of the load_data_processor could read data from different sources, including reading the data from, say, a MSSQL database.

read zone csvs in addition to omx matrices for the aggregate od processor

Sometimes we need to read a zone vector into the od processors as well. For example, parking cost at the destination. We should add the ability to also read in the zone data and specify if the zone vector is replicated to a full matrix by row or by column. For now you can pre-process the zone vector to create a matrix.

at statement considered harmful

The activitysim convention of prefixing expressions with an at sign to indicate that they should be evaluated with a python eval rather than pandas eval is a little bit inconvenient if you want to maintain your csv file of expressions in excel as those statement are interpreted as formulas. We might want to use a different method of tagging these expressions that plays better with excel.

screen shot 2016-02-24 at 12 56 43 pm

locals_OD_aggregate:

locals_OD_aggregate:

should be

locals_aggregate_od:

in example_4step/configs/settings.yaml

Python 3 support

Need to make sure bca4abm works for Python 3 (and update all related materials as well). Updating ActivitySim to work for both 2 and 3 wasn't a big deal, so updating bca4abm should be relatively straightforward.

how much ancillary info is carried into summary/analysis

The sandag bca tool carries a very large number of columns into the multiyear processor and final report. This greatly increases its complexity, and reduces its flexibility.

The more parsimonious we are in this area, the easier it will be for the tool to be adapted to different abm data sources. Also it will make it more flexible in terms of experimental modifications to the bca calculations.

My intent is to start by implementing the bare minimum and we can debate the tradeoffs inherent in adding more detailed reporting as we move forward.

Scream if you have a problem with this approach.

taxi mode in daysim

Sandag BCA tool maps taxi to auto. I'm looking at daysim TMODEDETP and MODE category codes and wondering how taxi trips are categorized in daysim.

Also wondering whether toll and fare are aggregated into travcost - and whether this is handled the same in CT-RAMP and daysim?

daysim purpose category codes

Which of the various daysim purpose category codes can appear as tour purposes (pdpurp)?

0 'home'
1 'work'
2 'school'
3 'escort'
4 'pers.bus'
5 'shop'
6 'meal'
7 'social/recreation'
10 'change mode (park and ride)

custom matrix handling for aggregate calculations

The specification that @jfdman provided for SANDAG includes special logic for dealing with the toll matrix since some of the OD pairs have a toll + 10000 to identify it as a special toll. @mabcal suggested using a SCALE column for calculating the auto operating cost since some agencies only use a distance matrix times a scalar. To support these types of customizations in the matrix specification, I think we should add an EXPRESSION column for each matrix read that supports a Python expression. This expression could be applied when the matrix is first read, or could be applied on demand. Exposing this flexibility in the form of a Python expression is the spirit of ActivitySim and would go a long way toward a more generic tool. @toliwaga and I decided to wait and implement this after we get the minimal operating solution up and running.

Signs reversed on link level benefits

Link level benefits are currently computed as : results = results['base'] - results['build']
should be : results['build'] - results['base']
Line 93 on link.py

Sandag BCA Tool code ownership/license?

What is the copyright/ownership status of the existing sandag bca tool - can I quote/excerpt from the MSSQL stored procedures in the bca4abm source or documentation?

Trip cost pro-rated across persons?

If the the travcost trip file variable is for an exploded person-trip, then has the trip travel cost been pro-rated or otherwise allocated across/to the appropriate persons travelling on that trip?

output od benefit trace data for districts pairs

We currently write out trace files for 4step as follows;

  • for demographic and zone processor - a taz csv file with all zones and calculations
  • for links - a link csv file with all links in the trace zones and calculations
  • for od - aggregation across columns (i.e rowSums) for all od calculations

What we want to do instead for the od processor is write a sum for each origin district to destination district pair. We will code the districts at the TAZ level, probably in the COCs definition file. We will then trace out a FROM DISTRICT, TO DISTRICT, aggregated calculation result for expression 1, aggregated calculation result for expression 2, etc. The output file will look something like this:

FROM DISTRICT TO DISTRICT TRIPS TIMES ...
zone-group-1 zone-group-1 5678 78 ...
zone-group-1 zone-group-2 456 34 ...
zone-group-2 zone-group-1 1234 234 ...
zone-group-2 zone-group-2 8786 222 ...

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.