Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify uncertainty reward so sensors measure all tracks together #691

Merged
merged 1 commit into from
Aug 17, 2022

Conversation

sdhiscocks
Copy link
Member

This can be important in case of sensor handling obscuration, or limited resolution. It also offers a small performance benefit.

This can be important in case of sensor handling obscuration, or limited
resolution. It also offers a small performance benefit.
@sdhiscocks sdhiscocks requested a review from a team as a code owner August 11, 2022 08:01
@sdhiscocks sdhiscocks requested review from orosoman-dstl and removed request for a team August 11, 2022 08:01
@codecov
Copy link

codecov bot commented Aug 11, 2022

Codecov Report

Merging #691 (f15c7a8) into main (0879945) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #691      +/-   ##
==========================================
- Coverage   94.62%   94.62%   -0.01%     
==========================================
  Files         171      171              
  Lines        8576     8574       -2     
  Branches     1663     1662       -1     
==========================================
- Hits         8115     8113       -2     
  Misses        339      339              
  Partials      122      122              
Flag Coverage Δ
integration 68.48% <100.00%> (+0.01%) ⬆️
unittests 92.18% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
stonesoup/sensormanager/reward.py 97.77% <100.00%> (-0.10%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Comment on lines +98 to +99
predicted_track.states = copy.copy(predicted_track.states)
predicted_track.metadatas = copy.copy(predicted_track.metadatas)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need to copy everything separately here and why are they copies of themselves? (Probably just me not understanding!)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When you append states it'll modify the original list (and metadatas list), which you don't want. But if you deep copy the entire track to avoid this, it'll also copy all the states of the track which isn't required and super slow for any track with a lengthy history.

I should add a comment to make this clear in the code.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In fact, having thought about this, I think we should implement a proper shallow copy method like a list/dictionary would have. I'll create a new PR for this once this is merged. It'll be same as here effectively, but part of the class, so a plain copy.copy(track) will ensure you get a shallow copy, and adding/removing states won't effect the original.

@sdhiscocks sdhiscocks merged commit ce16944 into main Aug 17, 2022
@sdhiscocks sdhiscocks deleted the unc_reward_mod branch August 17, 2022 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants