updated reset

This commit is contained in:
Timéo 2024-05-30 12:44:41 +02:00
parent 0cfe8fc9b5
commit b8b1b0cc93
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;