From 7101a8eb5b8f9ee2a3984d3590df6a7daea08288 Mon Sep 17 00:00:00 2001 From: Manos Katsomallos Date: Mon, 26 Jul 2021 18:28:08 +0300 Subject: [PATCH] lmdk_bgt.discount: Fixed bounds --- code/lib/lmdk_bgt.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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):