Trait AgentSet

Source
pub trait AgentSet {
    // Required methods
    fn call<D: DB, V: Validator, R: RngCore>(
        &mut self,
        rng: &mut R,
        env: &mut Env<D, V>,
    ) -> Vec<Transaction>;
    fn record<D: DB, V: Validator>(&mut self, env: &mut Env<D, V>);
    fn get_addresses(&self) -> Vec<Address>;
}
Expand description

A homogenous collection of agents

Designed to represent a group of agents of a uniform type and update and record the group state at each step of the simulation.

Required Methods§

Source

fn call<D: DB, V: Validator, R: RngCore>( &mut self, rng: &mut R, env: &mut Env<D, V>, ) -> Vec<Transaction>

Update all the agents in the set, collecting any EVM calls generated by the agents

§Arguments
  • rng - Random generate
  • env - Simulation environment
Source

fn record<D: DB, V: Validator>(&mut self, env: &mut Env<D, V>)

Record the state of all the agents

Source

fn get_addresses(&self) -> Vec<Address>

Get a vector of agent addresses contained in this set

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<R: 'static, A: Agent + RecordedAgent<R> + 'static> AgentSet for AgentVec<R, A>

Implementations of agent updates and recording.

Source§

impl<R: 'static, A: Agent + RecordedAgent<R> + 'static> AgentSet for SingletonAgent<R, A>

Implementations of agent updates and recording.