gflow / GFlow

Software for modeling circuit theory-based connectivity
GNU General Public License v3.0
22 stars 5 forks source link

Cells connected to four or eight neighbors? #18

Closed RMarrec closed 7 years ago

RMarrec commented 7 years ago

Hi. I am wondering if gflow may allow to choose between the use of four or eight neighbors to connect cells together? If not, what is the implemented choice? Thank you. Ronan.

pbleonard commented 7 years ago

@RMarrec, I do not believe we currently have an option. The default is 8 neighbors. Are you up against a problem or setup where you'd like to use 4?

Cheers, Paul

RMarrec commented 7 years ago

@Pbleonard - I guess 8 neighbors is more realistic, but in some cases, considering 8 neighbors may remove the role as barriers of some elements (especially linear features). Particularly at coarser resolutions. For instance here with roads considered at a coarser resolution: example In this case, I wonder if considering only 4 neighbors will not be more realistic. At least it would be interesting to compare the two connectivity outputs.

RMarrec commented 7 years ago

On the picture, black areas are the less resistant. It is not intuitive, sorry.

eduffy commented 7 years ago

As a quick resolution, you can remove these five lines that check the diagonals: https://github.com/Pbleonard/GFlow/blob/master/gflow.c#L285-L289

RMarrec commented 7 years ago

@eduffy - Thank you for your answer. It is worth a try, I will do it asap and will let you know.

RMarrec commented 7 years ago

@eduffy - The solution you proposed works. I tested it on one single window, and the results were not highly different. It would be good to test for more landscapes and larger extents to evaluate "statistically" the interest of using 4 instead of 8 neighbors. Especially to compare the barrier effect of linear features.

pbleonard commented 7 years ago

@RMarrec, given your example above, would you mind posting the 4 connection comparison? Could be useful to others with similar questions.