Skip to content

Commit

Permalink
Remove 999999 replacements for time values (#367)
Browse files Browse the repository at this point in the history
* Remove truncation of time values
  • Loading branch information
Jens West committed Sep 1, 2021
1 parent 3e5f7f7 commit ea8a83d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Scripts/assignment/assignment_period.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,12 @@ def assign(self, matrices, iteration):

mtxs = {imp_type: self._get_emmebank_matrices(imp_type, iteration=="last")
for imp_type in ("time", "cost", "dist")}
# fix the emme path analysis results (dist and cost zero if path not found)
for mtx_type in mtxs:
# fix the emme path analysis results
# (dist and cost zero if path not found)
for mtx_type in ("cost", "dist"):
for mtx_class in mtxs[mtx_type]:
mtxs[mtx_type][mtx_class][ mtxs["time"][mtx_class] > 999999 ] = 999999
path_not_found = mtxs["time"][mtx_class] > 999999
mtxs[mtx_type][mtx_class][path_not_found] = 999999
# adjust impedance
mtxs["time"]["bike"] = mtxs["time"]["bike"].clip(None, 9999.)
for ass_class in ("car_work", "car_leisure"):
Expand Down

0 comments on commit ea8a83d

Please sign in to comment.