lmdk_bgt.discount: Fixed bounds

This commit is contained in:
Manos Katsomallos 2021-07-26 18:28:08 +03:00
parent 836ac16f16
commit 7101a8eb5b

View File

@ -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):