this isn't good
This commit is contained in:
@@ -161,14 +161,14 @@ impl Model {
|
||||
println!("Doing some population stuff...");
|
||||
let time_1 = Instant::now();
|
||||
let mut i_pop: Vec<Vec<usize>> = Vec::new();
|
||||
for i in (0..(self.grids.len())) {
|
||||
for _i in 0..(self.grids.len()) {
|
||||
i_pop.push(vec![]);
|
||||
}
|
||||
for agent in self.agents.iter() {
|
||||
i_pop[agent.population_id].push(agent.i);
|
||||
}
|
||||
|
||||
for i in (0..(self.grids.len())) {
|
||||
for i in 0..(self.grids.len()) {
|
||||
self.grids[i].i = i_pop[i].clone();
|
||||
}
|
||||
println!("Took {}ms", time_1.elapsed().as_millis());
|
||||
@@ -244,7 +244,7 @@ impl Model {
|
||||
if use_exp_deposit {
|
||||
let agent_list = self.agents.clone();
|
||||
self.grids.par_iter_mut().for_each(|grid|{
|
||||
for i in (0..grid.i.len()) {
|
||||
for i in 0..grid.i.len() {
|
||||
let agent = &agent_list[i];
|
||||
grid.deposit(agent.x, agent.y);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user