Skip to content

Commit 2bf1c8f

Browse files
committed
set up argtypes for shortest_path_n()
- it was for shortest_path(), which is not the path engine used for the current Path4GMNS; - remove some deprecated functions, calls and comments in classes.py; - update docstrings for class Column and class ColumnVec (for better understanding of these two data structures); - change version number to 0.7.5.
1 parent e9f59b6 commit 2bf1c8f

File tree

4 files changed

+13
-9
lines changed

4 files changed

+13
-9
lines changed

path4gmns/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from .utils import *
55

66

7-
__version__ = '0.7.4'
7+
__version__ = '0.7.5'
88

99

1010
# print out the current version

path4gmns/classes.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ def allocate_for_CAPI(self):
305305
to_node_no_array = [link.to_node_seq_no for link in self.link_list]
306306
link_cost_array = [link.cost for link in self.link_list]
307307

308-
# initialize others as numpy arrays directly
308+
# initialize others
309309
queue_next = [0] * node_size
310310
first_link_from = [-1] * node_size
311311
last_link_from = [-1] * node_size
@@ -324,8 +324,6 @@ def allocate_for_CAPI(self):
324324
last_link_from[i] = j
325325

326326
# setup allowed uses
327-
# allowed_uses = [''] * link_size
328-
# self._setup_allowed_use(allowed_uses)
329327
allowed_uses = [link.allowed_uses for link in self.link_list]
330328

331329
# set up arrays using ctypes
@@ -569,7 +567,7 @@ def set_agent_type_name(self, at_name):
569567

570568

571569
class Column:
572-
570+
""" column is path """
573571
def __init__(self, seq_no=-1):
574572
self.seq_no = seq_no
575573
self.vol = 0
@@ -656,7 +654,13 @@ def set_geometry(self, g):
656654

657655

658656
class ColumnVec:
657+
""" column pool for (at, dp, oz, dz)
659658
659+
where, at is agent type id,
660+
dp is demand period id,
661+
oz is origin zone id,
662+
dz is destination zone id.
663+
"""
660664
def __init__(self):
661665
self.od_vol = 0
662666
self.route_fixed = False
@@ -1257,7 +1261,7 @@ def get_agent_orig_node_id(self, agent_id):
12571261
return self.network.get_agent_orig_node_id(agent_id)
12581262

12591263
def get_agent_dest_node_id(self, agent_id):
1260-
""" return the destnation node id of an agent
1264+
""" return the destination node id of an agent
12611265
12621266
exception will be handled by _get_agent() in class Network
12631267
"""
@@ -1451,7 +1455,7 @@ def get_agent_orig_node_id(self, agent_id):
14511455
return self._base_assignment.get_agent_orig_node_id(agent_id)
14521456

14531457
def get_agent_dest_node_id(self, agent_id):
1454-
""" return the destnation node id of an agent """
1458+
""" return the destination node id of an agent """
14551459
return self._base_assignment.get_agent_dest_node_id(agent_id)
14561460

14571461
def get_agent_node_path(self, agent_id):

path4gmns/path.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
_cdll = ctypes.cdll.LoadLibrary(_dll_file)
3939

4040
# set up the argument types for the shortest path function in dll.
41-
_cdll.shortest_path.argtypes = [
41+
_cdll.shortest_path_n.argtypes = [
4242
ctypes.c_int,
4343
ctypes.c_int,
4444
ctypes.POINTER(ctypes.c_int),

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setuptools.setup(
77
name="path4gmns",
8-
version="0.7.4",
8+
version="0.7.5",
99
author="Dr. Xuesong Zhou, Dr. Peiheng Li",
1010
author_email="xzhou74@asu.edu, jdlph@hotmail.com",
1111
description="An open-source, cross-platform, lightweight, and fast Python\

0 commit comments

Comments
 (0)