Skip to content

Commit

Permalink
Merge pull request #258 from galenseilis/patch-25
Browse files Browse the repository at this point in the history
Update Probabilistic in routing.py
  • Loading branch information
geraintpalmer authored Jun 19, 2024
2 parents bde8342 + 826e16f commit f7068cb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ciw/routing/routing.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,11 @@ def __init__(self, destinations, probs):
"""
for p in probs:
if not isinstance(p, float):
raise ValueError("Routing probabilities must be between 0 and 1, and sum to less than 1.")
raise ValueError("Routing probabilities must be a float.")
if p < 0 or p > 1:
raise ValueError("Routing probabilities must be between 0 and 1, and sum to less than 1.")
raise ValueError("Routing probabilities must be between 0 and 1.")
if sum(probs) > 1.0:
raise ValueError("Routing probabilities must be between 0 and 1, and sum to less than 1.")
raise ValueError("Routing probabilities must sum to 1 or less.")
self.destinations = destinations + [-1]
self.probs = probs + [1 - sum(probs)]

Expand Down

0 comments on commit f7068cb

Please sign in to comment.