Skip to content

Commit

Permalink
getting closer to all pair public transport running
Browse files Browse the repository at this point in the history
  • Loading branch information
behrisch committed Dec 20, 2022
1 parent 43ea909 commit c77559f
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 10 deletions.
6 changes: 3 additions & 3 deletions assign.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,10 @@ def run_oneshot(options, first_depart, last_depart, trip_file, weight_file, meso
@benchmark
def run_bulk(options, first_depart, last_depart, trip_file, weight_file):
base = trip_file[:-4]
input_files = [trip_file] + list(sorted(glob.glob(os.path.join(os.path.dirname(options.net_file), 'pt*.xml*'))))
pt_files = list(sorted(glob.glob(os.path.join(os.path.dirname(options.net_file), 'pt*.xml*'))))
input_files = [trip_file] + pt_files[-1:]
route_file = base + ".rou.xml.gz"
additional = [options.vtype_file]
additional = [options.vtype_file] + pt_files[:-1]
if options.bidi_taz_file:
additional.append(options.bidi_taz_file)
if os.path.exists(route_file) and options.resume:
Expand All @@ -253,7 +254,6 @@ def run_bulk(options, first_depart, last_depart, trip_file, weight_file):
'--output', route_file,
'--alternatives-output', 'NUL',
'--write-costs',
# '--exit-times',
'--route-length',
'--ignore-errors',
'--verbose'
Expand Down
8 changes: 5 additions & 3 deletions install_scenario_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def build_taz_etc(scenario_pre_dir, net_path):
tmp_output_dir = ensure_tmp(scenario_template_dir)
for cfg in glob.glob(os.path.join(gtfs_dir, "*.cfg")):
gtfs_call = ['-c', cfg, '-n', os.path.abspath(net_path),
'--additional-output', os.path.join(scenario_template_dir, 'pt_routes.add.xml.gz'),
'--additional-output', os.path.join(scenario_template_dir, 'pt_stops.add.xml.gz'),
'--route-output', os.path.join(scenario_template_dir, 'pt_vehicles.add.xml.gz'),
'--map-output', os.path.join(tmp_output_dir, 'output'),
'--network-split', os.path.join(tmp_output_dir, 'resources'),
Expand Down Expand Up @@ -270,10 +270,12 @@ def build_taz_etc(scenario_pre_dir, net_path):
print("importing shapes from %s ..." % dbf)
polyReader = sumolib.shapes.polygon.PolygonReader(True)
polyFile = os.path.join(scenario_template_dir, prefix + ".poly.xml.gz")
subprocess.call([polyconvert, "-n", net_path, "-o", polyFile,
call = [polyconvert, "-n", net_path, "-o", polyFile,
"--shapefile-prefixes", os.path.join(shapes_dir, prefix),
"--shapefile.add-param", "--shapefile.traditional-axis-mapping",
"--shapefile.id-column", idCol.get(prefix, idCol["*"])])
"--shapefile.id-column", idCol.get(prefix, idCol["*"])]
print(" ".join(call))
subprocess.call(call)
if options.verbose:
print("calculating contained edges for %s ..." % polyFile)
parse(sumolib.openz(polyFile), polyReader)
Expand Down
8 changes: 4 additions & 4 deletions tests/tsc/template/public_transport/catalogue.tsc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
The following new files/directories were created:
<Test Directory>
----__pycache__
--------tscdefs.cpython-38.pyc
--------tscdefs.cpython-310.pyc
----core.db
----data
--------tsc.log
Expand All @@ -14,7 +14,7 @@ The following new files/directories were created:
----------------landmarks.csv.gz
----------------net.net.xml.gz
----------------ptVtypes.xml
----------------pt_routes.add.xml.gz
----------------pt_stops.add.xml.gz
----------------pt_vehicles.add.xml.gz
----------------vtypes.xml
----------------iteration000
Expand Down Expand Up @@ -63,9 +63,9 @@ The following new files/directories were created:
------------------------t2s_rectify_twoPersonsOnly.log
--------test_templates
------------__pycache__
----------------__init__.cpython-38.pyc
----------------__init__.cpython-310.pyc
------------mitte_net
----------------__pycache__
--------------------__init__.cpython-38.pyc
--------------------__init__.cpython-310.pyc
----public.db
----tmp.db
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit c77559f

Please sign in to comment.