Skip to content

Optional Struct-of-Arrays layout for agents #1146

@Tortar

Description

@Tortar

While currently Agents.jl uses an Array-of-Structs (AoS) layout for Agents, it would be useful in some situations to have a Struct-of-Arrays (SoA), in particular when many operations are easily vectorizable, and the number of operations which are not are a small part of the total number of operations. I think it should be possible to use AoS or SoA just by building agents under the hood differently, but without changing any interface, or even any functions operating on agents inside the library. And we also have a precedent for this in #492. If @fbanning would like to share their opinion on this given that he worked on this (albeit a lot of time ago) it would be really appreciated. I think that SoA is bad when removal of agents are allowed, but even now we have a version of ABM models which don't allow for removals and have their uses. And actually not having removals is fine for my use case for SoA which is mainly to refactor BeforeIT.jl to be based on Agents.jl with an easier transition and without incurring any perf penalty.

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-constructionAbout making agentsmodelRelated to an existing or new model implementationperformance

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions