Skip to main content

add_agent_random

Function add_agent_random 

Source
pub fn add_agent_random<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 an agent to the model at a random position in the space.

The agent must not already exist in the store. If the space rejects the position, returns InteractionError::Space.