This commit is contained in:
Laure BEL 2024-05-30 12:47:06 +02:00
commit 167f10a913
1 changed files with 4 additions and 0 deletions

View File

@ -588,6 +588,10 @@ public class Simulator extends Thread {
for (int i = 0; i < getHeight(); i++) {
for (int j = 0 ; j < getWidth() ; j++) {
setCell(i,j,0);
ArrayList<Agent> nearby = getNeighboringAnimals(i, j, 1);
for (Agent animal:nearby) {
agents.remove(animal);
}
}
}
this.stepCount = 0;