ActivitySim / activitysim

An Open Platform for Activity-Based Travel Modeling
https://activitysim.github.io
BSD 3-Clause "New" or "Revised" License
191 stars 98 forks source link

create TM2 test example for 3 zones and TVPB #334

Closed bstabler closed 3 years ago

bstabler commented 4 years ago
lmz commented 4 years ago

See also: https://github.com/ActivitySim/activitysim/wiki/MTC-TVPB-Test-Data

I'm converting skims to OMX and posting on Box (@bstabler and @toliwaga already have edit access)

For next steps, how do I setup the test run to use these files?

bstabler commented 4 years ago

Thanks @lmz. It looks like the data inputs are coming along. Can you also post your scripts for converting the files since we may need to make some updates once we start testing these. For now, I'll setup the test environment since I need to develop the expression files to go with these inputs. Once I get it basically working, which may require a bit of back and forth between us, I'll post it for you to try. How does that sound?

lmz commented 3 years ago

Sure, any preference where they ought to go? I can put them in travel-model-two or in this repo.

bstabler commented 3 years ago

Or maybe the box account folder for now? Any of the locations is fine....if this repo then create a new folder under other_resources. Thanks.

lmz commented 3 years ago

To continue on from our conversation today - I need some clarity about what actually needs to be done for this (which is why I thought it would be easier to understand if something is runnable to see what fails). For example:

bstabler commented 3 years ago

Sure. Here's what I think still needs to be done:

In terms of formats, see the examples referenced at https://github.com/ActivitySim/activitysim/wiki/MTC-TVPB-Test-Data. Thanks.

lmz commented 3 years ago

When running this example, what's the mechanism used to read the tour files (instead of generating them with the other submodels)? I would think it would be something like a submodel (or more than one) that reads these files rather than doing the cdap / school_location / workplace_location , etc. As such, I think it would make sense for that submodel to read the files as is and do some limited processing, consistent with the original submodel(s). I would think that would need to do processing anyway, so why not make it read the raw tm2 files as they are and do all the work, rather than having some pre-processing scripting and some work in there?

Where is the settings.yml / setup so far for a 3 zone mtc/tam example ?

bstabler commented 3 years ago

For now, the mechanism to read the tour file will be to restart the pipeline at tour mode choice. To do so, we'll create a pipeline file of pandas DataFrames from the TM2 CSV files. Longer term, @toliwaga and I discussed creating an initialize_tours submodel to read this table from disk (like initialize_households). I like the idea of putting the pre-processing logic into an initialize_tours expression file, but we don't have that functionality currently, so I was thinking we'd write a script. Once we have the script, then we could convert the logic into an expressions file.

Here is the current example 3 zone setup. I'm working on building a TM2 example setup based on the data you're posting.

lmz commented 3 years ago

Ok, forgive me for my dumb questions (I'm still an ActivitySim noob), but I don't understand what triggers the model to "restart the pipeline at tour mode choice". What command would I run? Where is this reflected in a settings.yaml? This one doesn't include the models section

bstabler commented 3 years ago

@lmz - I'm concerned we're missing each other a bit on this. I'm thinking you provide the reasonably well formatted data inputs and then I'll build and test the example (and possibly make revisions to the inputs if needed (and/or in coordination with you)). We currently don't have out-of-the-box functionality for this exact use case so I'm going to have to put something together for now. Once I get the example working, I'm planning to share it with you and @toliwaga and the rest of the team. Thanks.

P.S. Here is an example with the ability to restart.

toliwaga commented 3 years ago

@lmz  The link @bstabler provided above was broken when I moved the branch from rsg to activitysim repo. Here is the correct link.

lmz commented 3 years ago

Hi @bstabler - I think I understand your approach but I don't agree with it. I think it makes sense to develop the code in tandem with the inputs, because it will help us to understand how the inputs should work (and if there might be a more elegant way to do this, like the way I proposed above) Having a skeleton and then fixing input files in response to error messages (rather than scanning a UEC and guessing what needs to be updated) makes more sense to me.

lmz commented 3 years ago

@lmz  The link @bstabler provided above was broken when I moved the branch from rsg to activitysim repo. Here is the correct link.

Is it the resume_after line? I searched the documentation for more about how to make this work (e.g. what's the input file for this functionality?) but couldn't find much

toliwaga commented 3 years ago

I am sure it (and everything in asim) could be better documented.

On the other hand, I do agree with Ben that all we want is a 3-zone input dataset we can work with.

On Thu, Sep 17, 2020 at 7:30 PM Lisa Zorn notifications@github.com wrote:

@lmz https://github.com/lmz The link @bstabler https://github.com/bstabler provided above was broken when I moved the branch from rsg to activitysim repo. Here is the correct link.

Is it the resume_after line? I searched the documentation https://activitysim.github.io/activitysim/search.html?q=resume&check_keywords=yes&area=default for more about how to make this work (e.g. what's the input file for this functionality?) but couldn't find much

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ActivitySim/activitysim/issues/334#issuecomment-694351193, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAOMQCSPPXWCUMPYC453SDSGI2R5ANCNFSM4QNH6U2A .

lmz commented 3 years ago

I am sure it (and everything in asim) could be better documented.

Ok, so I am requesting now that you document this feature and how to use it now, since it's relevant for this task Thank you.

lmz commented 3 years ago

Based on this note, it looks like the relevant command would be something like the following?

python simulation.py -c configs_local -c configs_3_zone -c configs -d data_3 -o output_3

And so is the plan to create a directory alongside configs_3_zone called configs_3_zone_mtc?

bstabler commented 3 years ago

Hi @lmz, that's correct. Here's basically what I'm thinking, which we can discuss in more detail on the call:

bstabler commented 3 years ago

regarding resume_after, see https://activitysim.github.io/activitysim/abmexample.html#pipeline

lmz commented 3 years ago

The referenced documentation says "These model steps must be registered orca steps, as noted below. If you provide a resume_after argument to activitysim.core.pipeline.run() the pipeliner will load checkpointed tables from the checkpoint store and resume pipeline processing on the next model step after the specified checkpoint."

What's the "checkpoint store"? How does one create this file? If this is the recommended way to restart the model/skip some submodels, then there needs to be documentation on this.

lmz commented 3 years ago

Hi @lmz, that's correct. Here's basically what I'm thinking, which we can discuss in more detail on the call:

  • copy configs_3_zone and rename as configs_3_zone_mtc
  • first run the example through tour mode choice since we need the pipeline file at this point in time in order to jump in at tour mode choice

This sounds to me to be a cumbersome way to setup a model to just test the tour mode choice submodel. I don't believe this is user-friendly skip-model functionality. It sounds like this is a topic to discuss tomorrow morning.

bstabler commented 3 years ago

I agree, it's cumbersome and it's something we should improve. We don't have a recommended way to skip submodels so that's why we're pivoting off a previous run. The checkpoint store is also known as the data store and the pipeline file. It's in the output folder from the previous run.

bstabler commented 3 years ago

Here's some additional helpful info on the very simple examples being used so far - https://github.com/ActivitySim/activitysim/wiki/TVPB-Design

bstabler commented 3 years ago

@toliwaga finished creating the Marin example this week. I'm going to create a new issue for performance tuning/pre-computing/caching.

bstabler commented 3 years ago

this is now in the release as example_3_marin_full