This commit is contained in:
Timéo 2024-05-28 13:19:13 +02:00
parent 8ac8a92d0e
commit ae82901690
1 changed files with 18 additions and 13 deletions

View File

@ -122,7 +122,18 @@ public class Simulator extends Thread {
int[][] newWorld = new int[getWidth()][getHeight()];
ArrayList<Agent> newAgents = new ArrayList<>();
for(Agent agent : agents) {
ArrayList<Agent> 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<Agent> newAgents = new ArrayList<>();
for(Agent agent : agents) {
ArrayList<Agent> neighbors =
this.getNeighboringAnimals(
agent.getX(),
agent.getY(),
ANIMAL_AREA_RADIUS);}
//if(!agent.liveTurn(
// neighbors,
// this)) {
// agents.remove(agent);
//{
}
//then evolution of the field