From ae829016904df2df72179d1977b835379e6be7f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=C3=A9o?= Date: Tue, 28 May 2024 13:19:13 +0200 Subject: [PATCH] rien --- src/backend/Simulator.java | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/src/backend/Simulator.java b/src/backend/Simulator.java index c8e86df..bd12141 100644 --- a/src/backend/Simulator.java +++ b/src/backend/Simulator.java @@ -122,7 +122,18 @@ public class Simulator extends Thread { int[][] newWorld = new int[getWidth()][getHeight()]; - + ArrayList newAgents = new ArrayList<>(); + for(Agent agent : agents) { + ArrayList neighbors = + this.getNeighboringAnimals( + agent.getX(), + agent.getY(), + ANIMAL_AREA_RADIUS);} + //if(!agent.liveTurn( + // neighbors, + // this)) { + // agents.remove(agent); + //{ // Apply Game of Life rules @@ -136,24 +147,18 @@ public class Simulator extends Thread { // } // } //} + + + + + world = newWorld; - ArrayList newAgents = new ArrayList<>(); - for(Agent agent : agents) { - ArrayList neighbors = - this.getNeighboringAnimals( - agent.getX(), - agent.getY(), - ANIMAL_AREA_RADIUS);} - //if(!agent.liveTurn( - // neighbors, - // this)) { - // agents.remove(agent); - //{ + } //then evolution of the field