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

Feature request: Onetoall/AlltoOne mode with polygons in the point file. #311

Open
luroy opened this issue Aug 9, 2021 · 10 comments
Open
Assignees

Comments

@luroy
Copy link

luroy commented Aug 9, 2021

Dear all,

I tried using Circuitscape on Julia with to connect only some focal node pairs (for which the Euclidean distance is less than a given threshold theshold).

From a given input, I ran Circuiscape in all-to-one mode with a file indicating focal node pairs to include following the example file "listofpairstoinclude.txt" in the examples directory. I got the following error when running ini file in R using “JuliaCall” package:

> Error happens in Julia.
> BoundsError: attempt to access 7025949-element Vector{Float64} at index [7039487]
> Stacktrace:
>   [1] (::Base.var"#837#839")(x::Task)
>     @ Base .\asyncmap.jl:177
>   [2] foreach(f::Base.var"#837#839", itr::Vector{Any})
>     @ Base .\abstractarray.jl:2141
>   [3] maptwice(wrapped_f::Function, chnl::Channel{Any}, worker_tasks::Vector{Any}, c::UnitRange{Int64})
>     @ Base .\asyncmap.jl:177
>   [4] wrap_n_exec_twice
>     @ .\asyncmap.jl:153 [inlined]
>   [5] #async_usemap#822
>     @ .\asyncmap.jl:103 [inlined]
>   [6] #asyncmap#821
>     @ .\asyncmap.jl:81 [inlined]
>   [7] pmap(f::Function, p::Distributed.WorkerPool, c::UnitRange{Int64}; distributed::Bool, batch_size::Int64, on_error::Nothing, retry_delays::Vector{Any}, retry_check::Nothing)
>     @ Distributed C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Distributed\src\pmap.jl:126
>   [8] pmap(f::Function, p::Distributed.WorkerPool, c::UnitRange{Int64})
>     @ Distributed C:\buildbot\worker\package_win64

Please find all input files and the .ini file associated at the following link: https://drive.google.com/drive/folders/1wdBCJvFvKUArEZjF4MaRfYS9NPawzo-q?usp=sharing

Thank you for your attention to this matter,

Léa

@vlandau
Copy link
Member

vlandau commented Aug 11, 2021

Hi @luroy, I think part of the issue might be that you are trying to include pairs in all-to-one mode. If you want to look at pairwise connections, the appropriate Circuitscape mode would be "pairwise". In all to one or one to all, it's similar to pairwise, but each node is connected to all other nodes for each solve. There is a great explanation of this in the docs.

Let me know if pairwise mode might be what you're looking for. If so, try changing the mode to pairwise and see if things work for you.

@luroy
Copy link
Author

luroy commented Aug 13, 2021

Dear @vlandau,
Thanks for responding so quickly !
I use the all-to-one mode can be as an alternative to the pairwise mode to use less memory.
With this approach, I want Circuitscape to connect one focal node to ground and all other nearby focal nodes (for which the Euclidean distance to the ground-connected focal node is less than a given threshold) to 1 amp current sources.
Hoping that it is possible :-)
All the best,
Léa

@vlandau
Copy link
Member

vlandau commented Aug 13, 2021

Ah you're right -- I've just used all-to-one typically for only one node so I was confused. @ranjanan do all-to-one and one-to-all support the include pairs file input?

@vlandau vlandau self-assigned this Oct 12, 2021
@vlandau
Copy link
Member

vlandau commented Oct 13, 2021

Hi @luroy, apologies for the delay in following up on this. I have looked into the Circuitscape source code and all-to-one mode should handle specifying included pairs just fine, so I'm now going to reproduce the problem to see if I can figure out what is going on. Thanks for your patience!

@vlandau
Copy link
Member

vlandau commented Oct 13, 2021

I was able to reproduce this error. I'm still not sure what is causing it but I'll continue to dig in.

@vlandau
Copy link
Member

vlandau commented Oct 14, 2021

@ranjanan it looks like the issue is that the number of elements in nodemap is larger than the size of G. I'm wondering if this is happening because the input nodes are polygons as opposed to points. Nothing in the docs suggests that this shouldn't work, but maybe it hasn't been implemented? I'm going to cross reference with the pariwise mode code to see if the same correction for the polygons case is being done in all-to-one mode.

@vlandau
Copy link
Member

vlandau commented Oct 14, 2021

I think there may not be support for "polygon" nodes in all-to-one mode. @ranjanan please confirm.

@ranjanan
Copy link
Member

ranjanan commented Oct 18, 2021

I believe polygons are supported in one to all mode. It could be that if point files contain polygons, that isn't supported in one to all mode. That may need to be implemented.

The more I work with Circuitscape, the more I realise there are just so many corner cases and features. These will all need to be documented and listed.

@ranjanan
Copy link
Member

I am going to rename this issue to: "Feature request: one-to-all and all-to-one mode with polygons in the point file".

@ranjanan ranjanan changed the title BoundsError: attempt to access 7025949-element Vector{Float64} at index [7039487] Feature request: Onetoall/AlltoOne mode with polygons in the point file. Dec 28, 2022
@FaustiniG
Copy link

Hi, I also ran Circuiscape in all-to-one mode with a file indicating focal node pairs (which are actually regions).
I encountered the same problem reported here (BoundsError).

Do you know if the possibility to run all-to-one mode with pairs of polygons was implemented?

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants