From 80c0c8c194879802f8b25075c5e015ead363c9a1 Mon Sep 17 00:00:00 2001 From: Simon Gardling Date: Thu, 1 Apr 2021 14:06:29 -0400 Subject: [PATCH] clean --- src/model.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/model.rs b/src/model.rs index 6e47c0e..7f42ee3 100644 --- a/src/model.rs +++ b/src/model.rs @@ -76,12 +76,14 @@ impl Model { } let mut grids: Vec = Vec::new(); - for _ in 0..n_populations { + for pop in 0..n_populations { let agents = (0..particles_per_grid) - .map(|i| Agent::new(width, height, i / particles_per_grid, &mut rng, i)).collect(); + .map(|i| { + Agent::new(width, height, pop, &mut rng, i) + }).collect(); grids.push(Grid::new(width, height, &mut rng, agents)); - } + Model { grids, attraction_table,