collect grids instead
This commit is contained in:
@@ -75,13 +75,14 @@ impl Model {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut grids: Vec<Grid> = Vec::new();
|
let grids = (0..n_populations)
|
||||||
for _ in 0..n_populations {
|
.map(|_| {
|
||||||
let agents = (0..particles_per_grid)
|
let agents = (0..particles_per_grid)
|
||||||
.map(|_| Agent::new(width, height, &mut rng))
|
.map(|_| Agent::new(width, height, &mut rng))
|
||||||
.collect();
|
.collect();
|
||||||
grids.push(Grid::new(width, height, &mut rng, agents));
|
Grid::new(width, height, &mut rng, agents)
|
||||||
}
|
})
|
||||||
|
.collect();
|
||||||
|
|
||||||
Model {
|
Model {
|
||||||
population_grids: grids,
|
population_grids: grids,
|
||||||
|
|||||||
Reference in New Issue
Block a user