diff --git a/code/lib/lmdk_bgt.py b/code/lib/lmdk_bgt.py index 8f372db..e86e814 100644 --- a/code/lib/lmdk_bgt.py +++ b/code/lib/lmdk_bgt.py @@ -445,12 +445,12 @@ def discount(seq, lmdks, epsilon): # Initialize the sampling rate samp_rt = .5 for i, p in enumerate(seq): - # Adjust the sampling rate - if len(lmdks) > 1: - samp_rt = lmdks[lmdk_cur][3] / lmdks[len(lmdks) - 1][3] # Check if current point is a landmark if lmdk_lib.is_landmark(p, lmdks): lmdk_cur += 1 + # Adjust the sampling rate + if len(lmdks) > 1: + samp_rt = lmdks[lmdk_cur - 1][3] / lmdks[len(lmdks) - 1][3] # Get coordinates loc = (p[1], p[2]) if i == 0 or lmdk_lib.should_sample(samp_rt):