Skip to content

Commit

Permalink
Add instance check for reward function
Browse files Browse the repository at this point in the history
Current reward function assumes a single detection per track
This adds an instance check to manage clutter.
  • Loading branch information
jswright-dstl committed Sep 22, 2022
1 parent f88c394 commit 9a81537
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion stonesoup/sensormanager/reward.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import numpy as np

from stonesoup.types.detection import TrueDetection
from ..base import Base, Property
from ..predictor.kalman import KalmanPredictor
from ..updater.kalman import ExtendedKalmanUpdater
Expand Down Expand Up @@ -102,7 +103,8 @@ def __call__(self, config: Mapping[Sensor, Sequence[Action]], tracks: Set[Track]

# Assumes one detection per track
detections = {detection.groundtruth_path: detection
for detection in sensor.measure(predicted_tracks, noise=False)}
for detection in sensor.measure(predicted_tracks, noise=False)
if isinstance(detection, TrueDetection)}

for predicted_track, detection in detections.items():
# Generate hypothesis based on prediction/previous update and detection
Expand Down

0 comments on commit 9a81537

Please sign in to comment.