From 80511c0e4d97f42e82e7b812fbfd8c0348ef7e4e Mon Sep 17 00:00:00 2001 From: Sijia Wang Date: Wed, 18 Aug 2021 11:27:46 -0400 Subject: [PATCH] modify write_roadway_as_fixed_width to not use tokens #128 --- lasso/parameters.py | 1 + lasso/roadway.py | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lasso/parameters.py b/lasso/parameters.py index 1245f45..c92afa4 100644 --- a/lasso/parameters.py +++ b/lasso/parameters.py @@ -752,6 +752,7 @@ def __init__(self, **kwargs): self.fare_matrix_output_variables = ["faresystem", "origin_farezone", "destination_farezone", "price"] + self.zones = 4756 """ Create all the possible headway variable combinations based on the cube time periods setting """ diff --git a/lasso/roadway.py b/lasso/roadway.py index c2aa5c5..3995c02 100644 --- a/lasso/roadway.py +++ b/lasso/roadway.py @@ -1768,7 +1768,7 @@ def write_roadway_as_fixedwidth( # write out cube script s = 'RUN PGM = NETWORK MSG = "Read in network from fixed width file" \n' - s += "FILEI LINKI[1] = %LINK_DATA_PATH%," + s += 'FILEI LINKI[1] = "{}",'.format(output_link_txt) start_pos = 1 for i in range(len(link_max_width_df)): s += " VAR=" + link_max_width_df.header.iloc[i] @@ -1791,7 +1791,7 @@ def write_roadway_as_fixedwidth( s = s[:-1] s += "\n" - s += "FILEI NODEI[1] = %NODE_DATA_PATH%," + s += 'FILEI NODEI[1] = "{}",'.format(output_node_txt) start_pos = 1 for i in range(len(node_max_width_df)): s += " VAR=" + node_max_width_df.header.iloc[i] @@ -1814,7 +1814,7 @@ def write_roadway_as_fixedwidth( s = s[:-1] s += "\n" - s += 'FILEO NETO = "%SCENARIO_DIR%/complete_network.net" \n\n ZONES = %zones% \n\n' + s += 'FILEO NETO = "complete_network.net" \n\n ZONES = {} \n\n'.format(self.parameters.zones) s += ';ROADWAY = LTRIM(TRIM(ROADWAY)) \n' s += ';NAME = LTRIM(TRIM(NAME)) \n' s += '\n \nENDRUN'