hugomflavio / actel

Standardised analysis of acoustic telemetry data from fish moving through receiver arrays
https://hugomflavio.github.io/actel-website
26 stars 6 forks source link

actel is missing efficiency peers on some situations #72

Closed hugomflavio closed 1 year ago

hugomflavio commented 2 years ago

In a situation with:

A -- B A -- C A -- D B -- C B -- D C -- D

With all the fish coming from before A, all of B, C and D (and any subsequent arrays) should be valid efficiency peers. Yet actel assigned no valid peers to A.

Need to investigate what is the underlying cause.

hugomflavio commented 1 year ago

Looked a bit further into this issue:

Take a study area that looks like this

  R --- A ----- B --- E
        | \   / |
        |   D   |
         \  |  /
          \ | / 
            C

 -- expected direction ->

The respective dot file is:

R -- A -- B -- E
A -- D -- B
A -- C -- B
D -- C

Expected: All of B, C, D and E should be valid peers of A. Currently: Only D is recognized as a valid peer of A.

I can understand why this happens. D is the only array to only have A as a direct predecessor in the dot file. When looking at e.g B, D would also be marked as an entry point (second line in the dot file: D -- B). This tricks actel into thinking that A is not the only way to reach B. This is technically right, since D is, in fact, a second point of entry for B. What actel can't see is that the only way to get to D is through A, so ultimately both B and D can only be reached by passing through A. The exact same thing happens for C, and eventually E. The tricky part now is teaching actel to trace back the connections to "see" these things.

hugomflavio commented 1 year ago

After some digging I ended up at the function findPeers (which I had already forgot even existed). This was a very old function, so it was very interesting to return here. After some playing around I have developed a new method to find the peers that does not suffer from the limitations above. Appending my notes in case I ever need to return here:

png_notes.pdf

hugomflavio commented 1 year ago

Tests passed. Closing.