From e7881dcdcb7134a99e2bf2b0741ac9e1f9a99432 Mon Sep 17 00:00:00 2001 From: "jdlph@MBP" Date: Sat, 8 Apr 2023 15:09:27 -0400 Subject: [PATCH] update README for release - deprecate test_find_shortest_path_for_agents() in demo.py; - remove read_zones() and load_demand() from code snippet illustrating loading columns. --- README.md | 24 +++++++------ docs/source/usecases.md | 2 -- tests/demo.py | 74 ++++++++++++++++++++++------------------- 3 files changed, 52 insertions(+), 48 deletions(-) diff --git a/README.md b/README.md index e5329e2..a0a63db 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,14 @@ # Path4GMNS [![platform](https://img.shields.io/badge/platform-Windows%20%7C%20macOS%20%7C%20Linux-red)](https://img.shields.io/badge/platform-Windows%20%7C%20macOS%20%7C%20Linux-red) - [![Downloads](https://pepy.tech/badge/path4gmns)](https://pepy.tech/project/path4gmns) [![GitHub release](https://img.shields.io/badge/release-v0.9.2-brightgreen)](https://img.shields.io/badge/release-v0.8.2-brightgreen) ![Read the Docs](https://img.shields.io/readthedocs/path4gmns) + [![Downloads](https://pepy.tech/badge/path4gmns)](https://pepy.tech/project/path4gmns) [![GitHub release](https://img.shields.io/badge/release-v0.9.3-brightgreen)](https://img.shields.io/badge/release-v0.8.2-brightgreen) ![Read the Docs](https://img.shields.io/readthedocs/path4gmns) Path4GMNS is an open-source, cross-platform, lightweight, and fast Python path engine for networks encoded in [GMNS](https://github.com/zephyr-data-specs/GMNS). Besides finding static shortest paths for simple analyses, its main functionality is to provide an efficient and flexible framework for column-based (path-based) modeling and applications in transportation (e.g., activity-based demand modeling). Path4GMNS supports, in short, 1. finding (static) shortest path between two nodes, -2. constructing shortest paths for all individual agents, -3. performing path-based User-Equilibrium (UE) traffic assignment, -4. conducting dynamic traffic assignment (DTA) after UE. -5. evaluating multimodal accessibility and equity, -6. synthesizing zones and Origin-Destination (OD) demand for a given network. +2. performing path-based User-Equilibrium (UE) traffic assignment, +3. conducting dynamic traffic assignment (DTA) after UE. +4. evaluating multimodal accessibility and equity, +5. synthesizing zones and Origin-Destination (OD) demand for a given network. Path4GMNS also serves as an API to the C++-based [DTALite](https://github.com/jdlph/DTALite) to conduct various multimodal traffic assignments including, * Link-based UE, @@ -20,16 +19,16 @@ Path4GMNS also serves as an API to the C++-based [DTALite](https://github.com/jd ![Architecture](/docs/source/imgs/architecture.png) ## Installation -Path4GMNS has been published on [PyPI](https://pypi.org/project/path4gmns/0.9.2/), and can be installed using +Path4GMNS has been published on [PyPI](https://pypi.org/project/path4gmns/0.9.3/), and can be installed using ``` $ pip install path4gmns ``` -If you need a specific version of Path4GMNS, say, 0.9.2, +If you need a specific version of Path4GMNS, say, 0.9.3, ``` -$ pip install path4gmns==0.9.2 +$ pip install path4gmns==0.9.3 ``` -v0.9.2 improves the performance with faster and better UE convergency along with bug fix on loading columns. Please **update to or install the latest version** and **discard all old versions**. +v0.9.3 fixes the bug on handling link capacity reduction in traffic assignment and remove dependency on read_demand() for loading columns. Please **update to or install the latest version** and **discard all old versions**. ### Dependency The Python modules are written in **Python 3.x**, which is the minimum requirement to explore the most of Path4GMNS. Some of its functions require further run-time support, which we will go through along with the corresponding **[Use Cases](https://path4gmns.readthedocs.io/en/latest/)**. @@ -91,6 +90,9 @@ DTALite uses arrays rather than STL containers to store columns. These arrays ar 35. Fix the bug on updating the total system travel time (v0.9.2) 36. Resolve the potential issue on traversing the last through node in path engine (v0.9.2) 37. Fix the bug on loading columns where link path and node paths are not in the proper order (v0.9.2) +38. FiX the bug on handling link capacity reduction in traffic assignment (v0.9.3) +39. Remove dependency on demand.csv for loading columns (v0.9.3) +40. Deprecate find_path_for_agents() (v0.9.3) Detailed update information can be found in [Releases](https://github.com/jdlph/Path4GMNS/releases). @@ -104,7 +106,7 @@ You are encouraged to join our [Discord Channel](https://discord.gg/JGFMta7kxZ) ## How to Cite -Li, P. and Zhou, X. (2023, March 14). *Path4GMNS*. Retrieved from https://github.com/jdlph/Path4GMNS +Li, P. and Zhou, X. (2023, April 8). *Path4GMNS*. Retrieved from https://github.com/jdlph/Path4GMNS ## References Lu, C. C., Mahmassani, H. S., Zhou, X. (2009). Equivalent gap function-based reformulation and solution algorithm for the dynamic user equilibrium problem. Transportation Research Part B: Methodological, 43, 345-364. diff --git a/docs/source/usecases.md b/docs/source/usecases.md index db55b32..90e9a45 100644 --- a/docs/source/usecases.md +++ b/docs/source/usecases.md @@ -144,8 +144,6 @@ Starting from v0.7.0a1, Path4GMNS supports loading columns/paths from existing f import path4gmns as pg network = pg.read_network() -pg.read_zones(network) -pg.load_demand(network) # you can specify the input directory # e.g., pg.load_columns(network, 'data/Chicago_Sketch') pg.load_columns(network) diff --git a/tests/demo.py b/tests/demo.py index 79fcc40..8a79e46 100644 --- a/tests/demo.py +++ b/tests/demo.py @@ -23,40 +23,44 @@ def test_find_shortest_path(): def test_find_shortest_path_for_agents(): - network = pg.read_network(load_demand=True) - - st = time() - # find agent paths under a specific mode defined in settings.yaml, - # say, a (i.e., auto) - # network.find_path_for_agents('a') or network.find_path_for_agents('auto') - network.find_path_for_agents() - print('\nprocessing time of finding shortest paths for all agents: ' - f'{time()-st:.2f} s') - - agent_id = 300 - print('\norigin node id of agent is ' - f'{network.get_agent_orig_node_id(agent_id)}') - print('destination node id of agent is ' - f'{network.get_agent_dest_node_id(agent_id)}') - print('shortest path (node id) of agent, ' - f'{network.get_agent_node_path(agent_id)}') - print('shortest path (link id) of agent, ' - f'{network.get_agent_link_path(agent_id)}') - - agent_id = 1000 - print('\norigin node id of agent is ' - f'{network.get_agent_orig_node_id(agent_id)}') - print('destination node id of agent is ' - f'{network.get_agent_dest_node_id(agent_id)}') - print('shortest path (node id) of agent, ' - f'{network.get_agent_node_path(agent_id)}') - print('shortest path (link id) of agent, ' - f'{network.get_agent_link_path(agent_id)}') - - # output unique agent paths to a csv file - # if you do not want to include geometry info in the output file, - # you can do pg.output_agent_paths(network, False) - pg.output_agent_paths(network) + """ DEPRECATED """ + + print("DEPRECATED") + + # network = pg.read_network(load_demand=True) + + # st = time() + # # find agent paths under a specific mode defined in settings.yaml, + # # say, a (i.e., auto) + # # network.find_path_for_agents('a') or network.find_path_for_agents('auto') + # network.find_path_for_agents() + # print('\nprocessing time of finding shortest paths for all agents: ' + # f'{time()-st:.2f} s') + + # agent_id = 300 + # print('\norigin node id of agent is ' + # f'{network.get_agent_orig_node_id(agent_id)}') + # print('destination node id of agent is ' + # f'{network.get_agent_dest_node_id(agent_id)}') + # print('shortest path (node id) of agent, ' + # f'{network.get_agent_node_path(agent_id)}') + # print('shortest path (link id) of agent, ' + # f'{network.get_agent_link_path(agent_id)}') + + # agent_id = 1000 + # print('\norigin node id of agent is ' + # f'{network.get_agent_orig_node_id(agent_id)}') + # print('destination node id of agent is ' + # f'{network.get_agent_dest_node_id(agent_id)}') + # print('shortest path (node id) of agent, ' + # f'{network.get_agent_node_path(agent_id)}') + # print('shortest path (link id) of agent, ' + # f'{network.get_agent_link_path(agent_id)}') + + # # output unique agent paths to a csv file + # # if you do not want to include geometry info in the output file, + # # you can do pg.output_agent_paths(network, False) + # pg.output_agent_paths(network) def test_column_generation_py(): @@ -281,4 +285,4 @@ def demo_mode(mode): if __name__=="__main__": - demo_mode(5) \ No newline at end of file + demo_mode(3) \ No newline at end of file