Ecological networks types follow the iteration interface, allowing them to be used within a loop. Iteration is done on interactions (species are already arrays), and return a named tuple with various information.

Network length

Base.lengthFunction
Base.length(N::T) where {T <: AbstractEcologicalNetwork}

The length of a network is the number of non-zero elements in it.

source

Iteration

Base.iterateFunction
Base.iterate(N::T) where {T <: AbstractEcologicalNetwork}

Returns the interactions in a network (this uses less memory than interactions but is a bit slower).

source
Base.iterate(N::T) where {T <: AbstractEcologicalNetwork}

Returns the interactions in a network (this uses less memory than interactions but is a bit slower).

source