correction in agent files
This commit is contained in:
parent
7fcb3b27be
commit
c2f9c4d976
|
|
@ -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);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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 {
|
||||||
|
|
|
||||||
|
|
@ -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 {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue