Struct djinn::Updates
[−]
[src]
pub struct Updates<S: Simulation> { /* fields omitted */ }
A container for queuing and synchronizing agent updates.
Updates for agents local to the worker will be directly routed to those agents. Updates for remote agents will be synchronized via Redis.
Methods
impl<S: Simulation> Updates<S>
[src]
fn new(hasher: WHasher) -> Updates<S>
fn queue(&mut self, id: u64, update: S::Update)
Queue a single update for an agent with the specified id.
fn queue_world(&mut self, update: S::Update)
Queue an update for the world.
fn spawn(&mut self, state: S::State) -> u64
Create a new agent with the specified state, returning the new agent's id.
This does not actually spawn the agent, it just queues it.
Run the update
method to execute it (and other queued updates).
fn kill(&mut self, agent: &Agent<S::State>)
Deletes an agent by id.
This does not actually execute the kill, it just queues it.
Run the update
method to execute it (and other queued updates).