Skip to content

Use NoSpaceAgent alongside space agents #719

@veddox

Description

@veddox

Is your feature request related to a problem? Please describe.
I have a model with multiple agent types, some of which require (grid-)space, and others for which a position argument doesn't really make sense. I would like to be able to use NoSpaceAgent as the base type for the latter, but this causes agent_validator() and do_checks() to throw an ArgumentError: "Second field of Agent struct must be pos when using a space."

Describe the solution you'd like
I'm wondering whether agent_validator() is still necessary, since creating one's own agents structs has been deprecated? It also gives me an annoying warning about a non-concrete Agent type, as I use a Union type for my multi-agent model.

Describe alternatives you've considered
If it's important to keep agent_validator(), it would be nice to include a check for whether the checked agent type extends NoSpaceAgent, and if so, exclude it from the spatial checks. However, I'm not sure how to do this, as agent types created with @agent only have AbstractAgent as a supertype, even if created with NoSpaceAgent as a base type.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions