|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectuchicago.src.repastdemos.life.LifeAgent
public class LifeAgent
The agent in this implementation of Life. Its sole behavoir is to check if the number of its neighbors is > 3 or < 2 and die if so. Dying here is the removal of the agent from the Space. Note that this removal doesn't actually occur until every agent has performed this check. See LifeModel for more.
| Constructor Summary | |
|---|---|
LifeAgent(int x,
int y,
Space space)
Creates this LifeAgent with the specified coordinates and space. |
|
| Method Summary | |
|---|---|
void |
draw(SimGraphics g)
Invoked when the object should draw itself |
int |
getX()
Gets the x coordinate of this drawable. |
int |
getY()
Gets the y coordinate of the this drawable. |
void |
step()
Check if the number of neighbors is > 3 or < 2 and die if so. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LifeAgent(int x,
int y,
Space space)
| Method Detail |
|---|
public void step()
public int getX()
Drawable
getX in interface Drawablepublic int getY()
Drawable
getY in interface Drawablepublic void draw(SimGraphics g)
Drawable
draw in interface Drawable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||