From 58d1b1994ceeb3f5a9eba85a839c5b9af3dfe637 Mon Sep 17 00:00:00 2001 From: Jeremy Rubin Date: Wed, 8 Apr 2020 12:43:42 -0700 Subject: BIP-0119: Use the same random seed across simulation runs; fix issue where a poisson was used in place of an exponential --- bip-0119/simulation.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'bip-0119') diff --git a/bip-0119/simulation.py b/bip-0119/simulation.py index ee06fee..e40d61e 100755 --- a/bip-0119/simulation.py +++ b/bip-0119/simulation.py @@ -24,6 +24,7 @@ def get_rate(phase): return 1.25**(phase)*TXNS_PER_SEC def normal(): + np.random.seed(0) print("Max Txns Per Sec %f"%TXNS_PER_SEC) backlog = 0 results_unconfirmed = [0]*SAMPLES @@ -43,6 +44,7 @@ def normal(): results_unconfirmed[i] = backlog/AVG_TX return results_unconfirmed, np.cumsum(total_time)/(60*60*24.0) def compressed(rate_multiplier = 1): + np.random.seed(0) print("Max Txns Per Sec %f"%TXNS_PER_SEC) backlog = 0 secondary_backlog = 0 @@ -54,7 +56,7 @@ def compressed(rate_multiplier = 1): total_time = [0]*(SAMPLES) for phase in range(PHASES): for i in range(PHASE_LENGTH*phase, PHASE_LENGTH*(1+phase)): - block_time = np.random.poisson(AVG_INTERVAL) + block_time = np.random.exponential(AVG_INTERVAL) total_time[i] = block_time txns = np.random.poisson(rate_multiplier*get_rate(phase)*block_time) postponed = txns * COMPRESSABLE -- cgit v1.2.3 From c03a8f0bb929c0a9ec2f0616453349beaa6d944b Mon Sep 17 00:00:00 2001 From: Jeremy Rubin Date: Wed, 8 Apr 2020 12:44:16 -0700 Subject: Update images for BIP-0119 --- bip-0119/fifty.png | Bin 372887 -> 399046 bytes bip-0119/five.png | Bin 324707 -> 334730 bytes 2 files changed, 0 insertions(+), 0 deletions(-) (limited to 'bip-0119') diff --git a/bip-0119/fifty.png b/bip-0119/fifty.png index 6917937..1f90c01 100644 Binary files a/bip-0119/fifty.png and b/bip-0119/fifty.png differ diff --git a/bip-0119/five.png b/bip-0119/five.png index 5cf741a..7baa568 100644 Binary files a/bip-0119/five.png and b/bip-0119/five.png differ -- cgit v1.2.3