Skip to content

Commit

Permalink
Merge pull request ActivitySim#772 from SANDAG/BayDAG_cont6_jtp_infin…
Browse files Browse the repository at this point in the history
…ite_loop

BayDAG Contribution #6: Joint Tour Participation Infinite Loop
  • Loading branch information
jpn-- authored Mar 19, 2024
2 parents 4c766b6 + 5518ca4 commit 85615e4
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 85615e4

Please sign in to comment.