Skip to content

Commit

Permalink
error out of infinite loop
Browse files Browse the repository at this point in the history
  • Loading branch information
dhensle committed Mar 7, 2024
1 parent 6d817be commit 5518ca4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions activitysim/abm/models/joint_tour_participation.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,10 @@ def participants_chooser(
probs[choice_col] = np.where(probs[choice_col] > 0, 1, 0)
non_choice_col = [col for col in probs.columns if col != choice_col][0]
probs[non_choice_col] = 1 - probs[choice_col]
if iter > MAX_ITERATIONS + 1:
raise RuntimeError(
f"{num_tours_remaining} tours could not be satisfied even with forcing participation"
)
else:
raise RuntimeError(
f"{num_tours_remaining} tours could not be satisfied after {iter} iterations"
Expand Down

0 comments on commit 5518ca4

Please sign in to comment.