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

Bugfix for trip scheduling choice #884

Merged
merged 5 commits into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
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
2 changes: 1 addition & 1 deletion activitysim/abm/models/trip_scheduling_choice.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ def run_trip_scheduling_choice(
alternatives=schedules,
spec=spec,
choice_column=SCHEDULE_ID,
allow_zero_probs=True,
allow_zero_probs=False,
zero_prob_choice_val=-999,
log_alt_losers=False,
want_logsums=False,
Expand Down
29 changes: 16 additions & 13 deletions activitysim/core/simulate.py
Original file line number Diff line number Diff line change
Expand Up @@ -722,19 +722,22 @@ def eval_utilities(
offsets = np.nonzero(list(trace_targets))[0]

# trace sharrow
if sh_flow is not None:
try:
data_sh = sh_flow.load(
sh_tree.replace_datasets(
df=choosers.iloc[offsets],
),
dtype=np.float32,
)
expression_values_sh = pd.DataFrame(data=data_sh.T, index=spec.index)
except ValueError:
expression_values_sh = None
else:
expression_values_sh = None
# TODO: This block of code is sometimes extremely slow or hangs for no apparent
# reason. It is temporarily disabled until the cause can be identified, so
# that most tracing can be still be done with sharrow enabled.
# if sh_flow is not None:
# try:
# data_sh = sh_flow.load(
# sh_tree.replace_datasets(
# df=choosers.iloc[offsets],
# ),
# dtype=np.float32,
# )
# expression_values_sh = pd.DataFrame(data=data_sh.T, index=spec.index)
# except ValueError:
# expression_values_sh = None
# else:
expression_values_sh = None

# get array of expression_values
# expression_values.shape = (len(spec), len(choosers))
Expand Down