Skip to content

Commit

Permalink
Keeping the new version of transit costs in impedance transformer
Browse files Browse the repository at this point in the history
  • Loading branch information
hsl-petrhaj committed Dec 16, 2024
1 parent fd618dc commit 389c911
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Scripts/transform/impedance_transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,14 @@ def transform(self, purpose, impedance):
day_imp[mode][mtx_type] += share[0] * imp[rows, cols]
day_imp[mode][mtx_type] += share[1] * imp[cols, rows].T

# transit cost to eur per day
day_imp['transit']['cost'] = transit_cost_to_per_day(day_imp['transit']['cost'], purpose)

# Process possible extra transformers (eg. P&R impedance)
for transformer in self._extra_transformers:
extra_results = transformer.transform(purpose, impedance)
for result_name, result in extra_results.items():
day_imp[result_name] = result
# transit cost to eur per day
trips_month = (param.transit_trips_per_month
[purpose.area][assignment_classes[purpose.name]])
trips_per_month = numpy.full_like(
day_imp["transit"]["cost"], trips_month[0])
for i in range(1, len(purpose.sub_bounds)):
trips_per_month[purpose.sub_bounds[i], :] = trips_month[i]
day_imp["transit"]["cost"] /= trips_per_month

# Add parking time to car matrices
if parking_time is not None:
Expand Down

0 comments on commit 389c911

Please sign in to comment.