Skip to main content

add_agent

Function add_agent 

Source
pub fn add_agent<S, A, Store, Props, R, Sch>(
    model: &mut StandardModel<S, A, Store, Props, R, Sch>,
    agent: A,
) -> Result<(), InteractionError<S::Error>>
where A: PositionedAgent, S: SpaceInteraction<A>, Store: AgentStore<A>, R: RngCore, Sch: Scheduler<StandardModel<S, A, Store, Props, R, Sch>>,
Expand description

Add a positioned agent to both the store and the space.

Returns InteractionError::DuplicateId if an agent with the same ID already exists, or InteractionError::Space if the space rejects the position.