Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix hops equation and figure #95

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions rln-delay-simulations/message_hops.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@

def delay_last_hop(n, d, l):
# multiply by l for latencies
return ceil(log(n)/log(d))
numerator = log(((n - 1) * (d - 2) / d) + 1)
denominator = log(d - 1)
return ceil(numerator / denominator)

ds = np.arange(2,15)

ds = np.arange(3,15)
ls = np.ones(len(ds))*L

# astype(int) is ok since ceil() returns integers
Expand All @@ -39,8 +42,8 @@ def delay_last_hop(n, d, l):
ax2.set(**dict(ylabel='\nBandwidth amplification'))

# Set the limits of the x-axis and y-axis
ax1.set_xlim(2, 14)
ax1.set_ylim(2, ax1.get_ylim()[1]) # Ensure that the lower limit is 2
ax1.set_xlim(3, 14)
ax1.set_ylim(3, ax1.get_ylim()[1]) # Ensure that the lower limit is 2

# Set the limits of the second y-axis to match the first y-axis
ax2.set_ylim(ax1.get_ylim())
Expand Down
Loading