Skip to content

Commit

Permalink
Correct GaussianMixturePrediction coverting to GaussianStatePrediction
Browse files Browse the repository at this point in the history
  • Loading branch information
jswright-dstl committed Dec 13, 2023
1 parent ee84253 commit 2d449aa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 6 additions & 2 deletions stonesoup/dataassociator/tests/test_mfa.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from ...types.detection import Detection
from ...types.mixture import GaussianMixture
from ...types.numeric import Probability
from ...types.state import TaggedWeightedGaussianState
from ...types.state import TaggedWeightedGaussianState, GaussianState
from ...types.track import Track
from ...types.update import GaussianMixtureUpdate
try:
Expand All @@ -34,7 +34,11 @@ def update_tracks(associations, updater):
def generate_detections(tracks, timestamp, predictor, measurement_model, n=2):
return {
Detection(
measurement_model.function(predictor.predict(track, timestamp), noise=True),
measurement_model.function(predictor.predict(
GaussianState(
track.mean,
track.covar,
track.timestamp), timestamp), noise=True),
timestamp=timestamp)
for track in tracks for _ in range(n)} # n detections per track; pseudo clutter

Expand Down
2 changes: 0 additions & 2 deletions stonesoup/types/mixture.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from .base import Type
from .array import StateVectors
from .numeric import Probability
from .prediction import Prediction, GaussianStatePrediction
from .state import GaussianState, TaggedWeightedGaussianState, WeightedGaussianState


Expand Down Expand Up @@ -128,4 +127,3 @@ def component_tags(self):


GaussianState.register(GaussianMixture)
Prediction.class_mapping[Prediction][GaussianMixture] = GaussianStatePrediction

0 comments on commit 2d449aa

Please sign in to comment.