Function run

Source
pub fn run<S: SimState, D: DB, V: Validator>(
    env: &mut Env<D, V>,
    agents: &mut S,
    seed: u64,
    n_steps: usize,
)
Expand description

Simulation execution function

Run a simulation for a fixed number of steps, each step of the simulation:

  • Updates the state of all the agents and collects transactions to be submitted into the next block
  • Sort the transactions
  • Update the block number and timestamp
  • Process the transactions
  • Record the state of the agents

ยงArguments

  • env - Reference to an Env simulation environment
  • agents - Reference to a set of agents implementing the SimState trait
  • seed - Random seed
  • n_steps - Number of simulation steps