correction in agent files

This commit is contained in:
Laure BEL 2024-05-29 18:27:57 +02:00
parent 7fcb3b27be
commit c2f9c4d976
3 changed files with 3 additions and 3 deletions

View File

@ -34,7 +34,7 @@ public abstract class Agent {
// then returns a boolean // then returns a boolean
// if false, agent dies at end of turn // if false, agent dies at end of turn
// see step function in Simulator // see step function in Simulator
public abstract boolean liveTurn(ArrayList<Agent> neighbors, World world); public abstract boolean liveTurn(ArrayList<Agent> neighbors, Simulator world);
} }

View File

@ -29,7 +29,7 @@ public class Sheep extends Agent {
* it can interact with the cells or with other animals * it can interact with the cells or with other animals
* as you wish * as you wish
*/ */
public boolean liveTurn(ArrayList<Agent> neighbors, World world) { public boolean liveTurn(ArrayList<Agent> neighbors, Simulator world) {
if(world.getCell(x, y)==1) { if(world.getCell(x, y)==1) {
world.setCell(x, y, 0); world.setCell(x, y, 0);
} else { } else {

View File

@ -25,7 +25,7 @@ public class Wolf extends Agent {
* it can interact with the cells or with other animals * it can interact with the cells or with other animals
* as you wish * as you wish
*/ */
public boolean liveTurn(ArrayList<Agent> neighbors, World world) { public boolean liveTurn(ArrayList<Agent> neighbors, Simulator world) {
if(world.getCell(x, y)==1) { if(world.getCell(x, y)==1) {
world.setCell(x, y, 0); world.setCell(x, y, 0);
} else { } else {