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

get_*_dense_index() do not return expected value? #164

Open
alaindanet opened this issue Nov 20, 2024 · 0 comments
Open

get_*_dense_index() do not return expected value? #164

alaindanet opened this issue Nov 20, 2024 · 0 comments

Comments

@alaindanet
Copy link
Contributor

get_producers_dense_index() and get_consumers_dense_index() do not return the expected values.

While get_producers_sparse_index() and get_consumers_sparse_index() return the right indices.

vegan = Foodweb([:ours => :plant])
m = default_model(vegan)

# Ours is one, plant is two
julia> get_species_names(m)
2-element EcologicalNetworksDynamics.SpeciesNames:
 :ours
 :plant

# *_dense_index is wrong
julia> get_producers_dense_index(m)
OrderedCollections.OrderedDict{Symbol, Int64} with 1 entry:
  :plant => 1
julia> get_producers_sparse_index(m)
OrderedCollections.OrderedDict{Symbol, Int64} with 1 entry:
  :plant => 2
vegan = Foodweb([0 0; 0 1]);
m = default_model(vegan, Species([:plant, :ours]));

# Plant is one, ours is two
julia> get_species_names(m)
2-element EcologicalNetworksDynamics.SpeciesNames:
 :plant
 :ours

# *_dense_index is wrong
julia> get_consumers_dense_index(m)
OrderedCollections.OrderedDict{Symbol, Int64} with 1 entry:
  :ours => 1

julia> get_consumers_sparse_index(m)
OrderedCollections.OrderedDict{Symbol, Int64} with 1 entry:
  :ours => 2

It is a very minor issue I guess.

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

1 participant