try make step agent
This commit is contained in:
parent
68f4106a43
commit
73662f1c0c
|
|
@ -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()];
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue