Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove 999999 replacements for time values #367

Merged
merged 2 commits into from
Sep 1, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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