Skip to content

Commit

Permalink
Merge pull request #717 from dstl/remove_assign
Browse files Browse the repository at this point in the history
Change 2d assignment implementation to SciPy version
  • Loading branch information
sdhiscocks authored Sep 15, 2022
2 parents 501294b + 38449c4 commit 2b69b97
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 263 deletions.
257 changes: 0 additions & 257 deletions stonesoup/dataassociator/_assignment.py

This file was deleted.

10 changes: 4 additions & 6 deletions stonesoup/dataassociator/neighbour.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import itertools

import numpy as np
from scipy.optimize import linear_sum_assignment

from ._assignment import assign2D
from .base import DataAssociator
from ..base import Property
from ..hypothesiser import Hypothesiser
Expand Down Expand Up @@ -234,11 +234,9 @@ def associate(self, tracks, detections, timestamp, **kwargs):
# to assign tracks to nearest detection
# Maximise flag = true for probability instance
# (converts minimisation problem to maximisation problem)
gain, col4row, row4col = assign2D(
distance_matrix, probability_flag)

# Ensure the problem was feasible
if gain is None:
try:
row4col, col4row = linear_sum_assignment(distance_matrix, probability_flag)
except ValueError:
raise RuntimeError("Assignment was not feasible")

# Generate dict of key/value pairs
Expand Down

0 comments on commit 2b69b97

Please sign in to comment.