activitysim icon indicating copy to clipboard operation
activitysim copied to clipboard

Can a skim time period label be used twice?

Open stefancoe opened this issue 2 years ago • 1 comments

We are using the skim time period label 'EA' twice in our network los configuration. Is this skim/time period configuration supported? If not, how should it be configured without having to create two sets of (the same) skims with different labels?

https://github.com/psrc/psrc_activitysim/blob/main/configs_dev/network_los.yaml#L24

**Edit: Perhaps this is the proper way to do it: periods: [20, 0, 5, 9, 15, 18] labels: ['EA', 'AM', 'MD', 'PM', 'EV']

stefancoe avatar Sep 12 '23 18:09 stefancoe

  • periods: [20, 0, 5, 9, 15, 18] labels: ['EA', 'AM', 'MD', 'PM', 'EV']

    I don't think this will work because the periods list needs to be monotonically increasing, otherwise you will get a pandas error on this line complaining "ValueError: bins must increase monotonically".

  • periods: [0, 5, 9, 15, 18, 20, 24] labels: ['EA', 'AM', 'MD', 'PM', 'EV', 'EA']

    Having EA at the end of labels could be problematic. The mandatory tour scheduling model uses the order of labels to create in_period and out_period combination when calculating logsum. See the trace file below, notice how AM-EA, MD-EA, PM-EA, and EV-EA combinations are created. This could be what you want if you are modeling overnight travel. But note that if you do not update the tour_departure_and_duration_segments.csv, which is used to look up the start and end time for logsum calculation, you will end up having negative duration. (Edit: duration is naively calculated in the ActivitySim source code using end - start, which can cause negative values.) You probably want to double check to make sure this is not happening.

    image

i-am-sijia avatar Sep 12 '23 21:09 i-am-sijia