Expand description
Space interaction API - add, remove, move, and query agents in space.
This module provides the ergonomic helper functions that mirror Julia
Agents.jl’s model_accessing_API.jl and space_interaction_API.jl:
add_agent,add_agent_random- insert an agent into both the store and the space.remove_agent- remove an agent from both the store and the space.move_agent- change an agent’s position in the space.nearby_ids,nearby_ids_except- query agents near a position.nearby_agents,nearby_agents_except- query agent references near a position.random_agent,random_id- pick a random agent.all_ids- list all agent IDs.
These functions operate on StandardModel and require the agent type to
implement PositionedAgent and the space to implement SpaceInteraction.
Enums§
- Interaction
Error - Errors that can occur during space interaction operations.
Traits§
- Positioned
Agent - Extension trait for agents that have a spatial position.
- Space
Interaction - Trait that spaces implement to support agent lifecycle and neighbor queries.
Functions§
- add_
agent - Add a positioned agent to both the store and the space.
- add_
agent_ random - Add an agent to the model at a random position in the space.
- all_ids
- Get a vector of all agent IDs in the model.
- move_
agent - Move an agent to a new position in the space.
- nearby_
agents - Query agent references near a position, using the space’s distance metric.
- nearby_
agents_ except - Query agent references near a position, excluding a specific agent.
- nearby_
ids - Query agent IDs near a position, using the space’s distance metric.
- nearby_
ids_ except - Query agent IDs near a position, excluding a specific agent.
- random_
agent - Pick a random agent reference from the model.
- random_
id - Pick a random agent ID from the model.
- remove_
agent - Remove a positioned agent from both the store and the space.
- validate_
space_ index - Validate that every positioned agent in the store is present exactly once in the spatial index at its stored position.