dstl / Stone-Soup

A software project to provide the target tracking community with a framework for the development and testing of tracking algorithms.
https://stonesoup.rtfd.io
MIT License
411 stars 138 forks source link

One to one Assignment for Association #664

Closed orosoman-dstl closed 1 year ago

orosoman-dstl commented 2 years ago

Created a new CompoundTimeRange class, a container class for TimeRange. This allows much greater flexibility for association objects, for example to associate two objects between the ranges [a,b] and [c,d] in a single TimeRangeAssociation.

New additions were made to the AssociationSet class mainly to reflect these changes.

The last main change was the new multidimensional_deconfliction algorithm. This is a very rudimentary but hopefully functional algorithm to ensure an AssociationSet has no associations that conflict - we can't have two different associations involving the same object at any given time. The algorithm is very basic, simply using the total length of an association as a proxy for strength of association, but I believe the groundwork has been laid to quickly implement something more advanced much more easily now.

orosoman-dstl commented 2 years ago

So TimeRange/s now inherits from Interval/s. I had to make a few changes to the latter classes due to a few edge cases not being accounted for - eg interval.isdisjoint(interval) was returning True, which is of course incorrect. I also changed the attribute names for both classes to "start" and "end", a good compromise hopefully between an implication of chronology for TimeRange/s, while still keeping it more generic for Interval/s. There may be further room to combine the classes - I will review tomorrow.

codecov[bot] commented 2 years ago

Codecov Report

Patch coverage: 83.48% and project coverage change: -0.34% :warning:

Comparison is base (7e654c3) 94.43% compared to head (c7430d9) 94.10%. Report is 441 commits behind head on main.

:exclamation: Current head c7430d9 differs from pull request most recent head 5045a47. Consider uploading reports for the commit 5045a47 to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #664 +/- ## ========================================== - Coverage 94.43% 94.10% -0.34% ========================================== Files 171 168 -3 Lines 8794 8531 -263 Branches 1707 1321 -386 ========================================== - Hits 8305 8028 -277 - Misses 352 359 +7 - Partials 137 144 +7 ``` | Flag | Coverage Δ | | |---|---|---| | integration | `68.13% <38.64%> (-1.23%)` | :arrow_down: | | unittests | `92.14% <83.48%> (+1.41%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dstl#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files Changed](https://app.codecov.io/gh/dstl/Stone-Soup/pull/664?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dstl) | Coverage Δ | | |---|---|---| | [stonesoup/metricgenerator/basicmetrics.py](https://app.codecov.io/gh/dstl/Stone-Soup/pull/664?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dstl#diff-c3RvbmVzb3VwL21ldHJpY2dlbmVyYXRvci9iYXNpY21ldHJpY3MucHk=) | `100.00% <ø> (ø)` | | | [stonesoup/dataassociator/tracktotrack.py](https://app.codecov.io/gh/dstl/Stone-Soup/pull/664?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dstl#diff-c3RvbmVzb3VwL2RhdGFhc3NvY2lhdG9yL3RyYWNrdG90cmFjay5weQ==) | `92.25% <50.00%> (-1.17%)` | :arrow_down: | | [stonesoup/metricgenerator/tracktotruthmetrics.py](https://app.codecov.io/gh/dstl/Stone-Soup/pull/664?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dstl#diff-c3RvbmVzb3VwL21ldHJpY2dlbmVyYXRvci90cmFja3RvdHJ1dGhtZXRyaWNzLnB5) | `98.44% <80.00%> (-1.56%)` | :arrow_down: | | [stonesoup/dataassociator/\_assignment.py](https://app.codecov.io/gh/dstl/Stone-Soup/pull/664?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dstl#diff-c3RvbmVzb3VwL2RhdGFhc3NvY2lhdG9yL19hc3NpZ25tZW50LnB5) | `88.88% <81.35%> (-2.19%)` | :arrow_down: | | [stonesoup/types/time.py](https://app.codecov.io/gh/dstl/Stone-Soup/pull/664?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dstl#diff-c3RvbmVzb3VwL3R5cGVzL3RpbWUucHk=) | `83.76% <83.33%> (-16.24%)` | :arrow_down: | | [stonesoup/types/association.py](https://app.codecov.io/gh/dstl/Stone-Soup/pull/664?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dstl#diff-c3RvbmVzb3VwL3R5cGVzL2Fzc29jaWF0aW9uLnB5) | `90.82% <86.30%> (-4.30%)` | :arrow_down: | | [stonesoup/types/interval.py](https://app.codecov.io/gh/dstl/Stone-Soup/pull/664?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dstl#diff-c3RvbmVzb3VwL3R5cGVzL2ludGVydmFsLnB5) | `96.45% <86.84%> (-2.74%)` | :arrow_down: | ... and [3 files with indirect coverage changes](https://app.codecov.io/gh/dstl/Stone-Soup/pull/664/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dstl)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

orosoman-dstl commented 1 year ago

Hopefully everything is now sorted - please have a peek when possible!