From 128b20b64878888445dbe75992b8d20e47550f14 Mon Sep 17 00:00:00 2001 From: Anton Kullberg <anton.kullberg@liu.se> Date: Fri, 12 Nov 2021 10:36:45 +0100 Subject: [PATCH] refactor: removed obsolete code --- src/trackers.py | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/src/trackers.py b/src/trackers.py index 555e14b..9f4ed2f 100644 --- a/src/trackers.py +++ b/src/trackers.py @@ -804,29 +804,3 @@ def get_association_matrix(meas, tracks, logic_params, gater): py = stats.multivariate_normal.pdf(val_meas.squeeze().T, mean=yhat.flatten(), cov=H@track['P'][-1]@H.T+track['filt'].sensor_model['R']) association_matrix[validation_matrix[:, ti], ti] = np.log(track['filt'].sensor_model['PD']*py/(1-track['filt'].sensor_model['PD'])) # PG assumed = 1 return association_matrix, validation_matrix - -### Obsolete -def compute_prob(association_matrix, validation_matrix, logic_params): - # Association matrix is assumed to consist of tracks and FA, no NT. - ny = association_matrix.shape[0] - ntracks = association_matrix.shape[1]-ny - P = np.zeros((ny, ntracks)) - - def rec_find_associations(association_matrix, assoc_done, logic_params): - inds = np.where(association_matrix[0, :] != -np.inf)[0] # These are the nodes necessary to look at - this_assoc = [] - for k, i in enumerate(inds): - if i not in assoc_done: - if association_matrix.shape[0] != 1: - assoc = rec_compute_prob(association_matrix[1:, :], [[i]], logic_params) - this_assoc.extend(assoc) - else: - this_assoc.append([i]) - result = [] - for assoc in assoc_done: - for th_assoc in this_assoc: - result.append(assoc + th_assoc) - return result - - possible_associations = rec_find_associations(association_matrix, [[]], logic_params) # Recursively finds possible measurement hypothesis - return res -- GitLab