try make step agent

This commit is contained in:
Laure BEL 2024-05-29 17:37:56 +02:00
parent 68f4106a43
commit 73662f1c0c
1 changed files with 4 additions and 10 deletions

View File

@ -158,18 +158,12 @@ public class Simulator extends Thread {
// in agent classes // in agent classes
/*ArrayList<Agent> newAgents = new ArrayList<>(); ArrayList<Agent> newAgents = new ArrayList<>();
for(Agent agent : agents) { for(Agent agent : agents) {
ArrayList<Agent> neighbors = ArrayList<Agent> neighbors =this.getNeighboringAnimals(agent.getX(),agent.getY(),ANIMAL_AREA_RADIUS);}
this.getNeighboringAnimals( if(!agent.liveTurn(neighbors,this)) {
agent.getX(),
agent.getY(),
ANIMAL_AREA_RADIUS);}
if(!agent.liveTurn(
neighbors,
this)) {
agents.remove(agent); agents.remove(agent);
}*/ }
int[][] nextWorld = new int[getWidth()][getHeight()]; int[][] nextWorld = new int[getWidth()][getHeight()];