You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- add exception handling to set_capacity_ratio of Assignment;
- update use case on loading columns to reflect the latest change on
removing the dependency of load_demand().
Copy file name to clipboardExpand all lines: docs/source/usecases.md
-59Lines changed: 0 additions & 59 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -114,63 +114,6 @@ pg.output_columns(network)
114
114
pg.output_link_performance(network)
115
115
```
116
116
117
-
## Find Shortest Paths for All Individual Agents
118
-
Path4GMNS is capable of calculating and constructing the (static) shortest paths for all agents. Individual agents will be automatically set up using the aggregated travel demand between each OD pair (i.e., demand.csv) within find_path_for_agents() on its first call. If you have zone information specified in node.csv, you can also follow the legacy way to load demand and zone info (see [Tutorial](https://github.com/jdlph/Path4GMNS/blob/dev/tests/tutorial.ipynb) for details).
119
-
120
-
The unique agent paths can be output to a csv file as shown in the example below.
121
-
```python
122
-
import path4gmns as pg
123
-
124
-
network = pg.read_network()
125
-
# it reads zone.csv by default
126
-
pg.read_zones(network)
127
-
# it reads demand.csv by default
128
-
pg.load_demand(network)
129
-
network.find_path_for_agents()
130
-
131
-
agent_id =300
132
-
print('\norigin node id of agent is '
133
-
f'{network.get_agent_orig_node_id(agent_id)}')
134
-
print('destination node id of agent is '
135
-
f'{network.get_agent_dest_node_id(agent_id)}')
136
-
print('shortest path (node id) of agent, '
137
-
f'{network.get_agent_node_path(agent_id)}')
138
-
print('shortest path (link id) of agent, '
139
-
f'{network.get_agent_link_path(agent_id)}')
140
-
141
-
agent_id =1000
142
-
print('\norigin node id of agent is '
143
-
f'{network.get_agent_orig_node_id(agent_id)}')
144
-
print('destination node id of agent is '
145
-
f'{network.get_agent_dest_node_id(agent_id)}')
146
-
print('shortest path (node id) of agent, '
147
-
f'{network.get_agent_node_path(agent_id)}')
148
-
print('shortest path (link id) of agent, '
149
-
f'{network.get_agent_link_path(agent_id)}')
150
-
151
-
# output unique agent paths to a csv file
152
-
# if you do not want to include geometry info in the output file,
153
-
# use pg.output_agent_paths(network, False)
154
-
pg.output_agent_paths(network)
155
-
```
156
-
157
-
v0.7.2 or higher features finding agent paths under a specific mode defined in settings.yml. The following example demonstrates this new functionality under mode walk (i.e., w).
158
-
```python
159
-
import path4gmns as pg
160
-
161
-
network = pg.read_network()
162
-
pg.read_zones(network)
163
-
pg.load_demand(network)
164
-
165
-
network.find_path_for_agents()
166
-
167
-
# or equivalently network.find_path_for_agents('walk')
168
-
network.find_path_for_agents('w')
169
-
170
-
# retrieving the origin, the destination, and the shortest path of a given agent
171
-
# is exactly the same as before as well as outputting all unique agent paths
172
-
```
173
-
174
117
## Perform Path-Based UE Traffic Assignment using the Python Column-Generation Module
175
118
The Python column-generation module only implements path-based UE. If you need other assignment modes, e.g., link-based UE or DTA, please use perform_network_assignment_DTALite().
176
119
@@ -532,8 +475,6 @@ If you have agent.csv (i.e.columns) from a previous run or DTALite, you can bypa
0 commit comments