Skip to content

Commit f533872

Browse files
committed
fix(validation): allow 0.99-1.01 for routing probabilities (as per paper values)
1 parent f511168 commit f533872

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

simulation/parameters.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -609,11 +609,13 @@ def validate_routing(self, obj_name):
609609
continue
610610

611611
# Check that probabilities sum to 1
612+
# Note: In the article, rehab other is 88% and 13%, so have
613+
# allowed deviation of 1%
612614
total_prob = sum(value.values())
613-
if total_prob != 1:
615+
if total_prob < 0.99 or total_prob > 1.01:
614616
raise ValueError(
615617
f"Routing probabilities for '{key}' in '{obj_name}' " +
616-
f"should sum to 1 but sum to: {total_prob}")
618+
f"should sum to apx. 1 but sum to: {total_prob}")
617619

618620
# Check that probabilities are between 0 and 1
619621
for sub_key, sub_value in value.items():

0 commit comments

Comments
 (0)