We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f511168 commit f533872Copy full SHA for f533872
simulation/parameters.py
@@ -609,11 +609,13 @@ def validate_routing(self, obj_name):
609
continue
610
611
# Check that probabilities sum to 1
612
+ # Note: In the article, rehab other is 88% and 13%, so have
613
+ # allowed deviation of 1%
614
total_prob = sum(value.values())
- if total_prob != 1:
615
+ if total_prob < 0.99 or total_prob > 1.01:
616
raise ValueError(
617
f"Routing probabilities for '{key}' in '{obj_name}' " +
- f"should sum to 1 but sum to: {total_prob}")
618
+ f"should sum to apx. 1 but sum to: {total_prob}")
619
620
# Check that probabilities are between 0 and 1
621
for sub_key, sub_value in value.items():
0 commit comments