diff --git a/carnot/carnot_simulation_psuedocode.py b/carnot/carnot_simulation_psuedocode.py index 0999b3f..496842e 100644 --- a/carnot/carnot_simulation_psuedocode.py +++ b/carnot/carnot_simulation_psuedocode.py @@ -52,9 +52,9 @@ def simulate_message_passing(committee, latency): int: The number of levels the message passed through. """ # Base case: if the committee is the root (no parent), return 0 (the message reached the root) + time.sleep(latency) if committee.parent_committee is None: return 0 - time.sleep(latency) # Simulate the message passing to the parent committee and get its result parent_result = simulate_message_passing(committee.parent_committee,latency) diff --git a/carnot/test_carnot_simulation.py b/carnot/test_carnot_simulation.py index 4821375..6d24cba 100644 --- a/carnot/test_carnot_simulation.py +++ b/carnot/test_carnot_simulation.py @@ -16,7 +16,7 @@ def test_message_passing(): result = simulate_message_passing(leaf_committee, latency) end_time = time.time() - expected_result = num_levels - 1 + expected_result = num_levels assert result == expected_result, f"Test Case 1 failed. Expected: {expected_result}, Got: {result}" print(f"Test Case 1: Number of Levels Message Passed: {result}, Elapsed Time: {end_time - start_time:.4f} seconds")