The volume delay functions used in tm2py should align with the methods used in TM1, as defined here. It appears that the translation to tm2py did not account for the change in the facility types. In TM1, the facility types are as follows:
Freeway-to-freeway connector (BPR)
Freeway (BPR)
Expressway (Akcelik)
Collector (Akcelik)
Freeway ramp (Akcelik)
Dummy link (N/A)
Major arterial (Akcelik)
Managed Freeway (BPR)
Special facility (BPR)
Toll plaza (Akcelik)
For the new TM2 networks, the facility types are as follows:
Freeway
Expressway
Ramp
Divided Arterial
Undivided Arterial
Collector
Local
Dummy
It appears from this code that Akceliks are being applied to the old facility types -- see this snippet:
This retains the magic number problem, but fixes the bug. It's also not clear where in the code the BPR parameters are applied for the other facility types.
@arashasadabadi It looks like the critical speeds you have defined here are not correct. See here for the correct values. These need to be mapped to the correct facility types. Please reference a commit here that fixes this problem.
Describe the bug
The volume delay functions used in tm2py should align with the methods used in TM1, as defined here. It appears that the translation to tm2py did not account for the change in the facility types. In TM1, the facility types are as follows:
For the new TM2 networks, the facility types are as follows:
It appears from this code that Akceliks are being applied to the old facility types -- see this snippet:
akcelik_vdfs = [3, 4, 5, 7, 8, 10, 11, 12, 13, 14]
-->
Progress:
To Reproduce
Magic number error
Failing tests
Triggering line of code
(https://github.com/BayAreaMetro/tm2py/blob/develop/tm2py/components/network/highway/highway_network.py#L264)
Thoughts on resolution
This array should be:
akcelik_vdfs = [2, 3, 4, 5, 6, 7]
This retains the magic number problem, but fixes the bug. It's also not clear where in the code the BPR parameters are applied for the other facility types.
Full stack trace
Environment
Operating system: Context (conda, jupyter, etc): Environment (e.g. output from
conda list
):