|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmadkit.kernel.AbstractAgent
madkit.kernel.Watcher
turtlekit.kernel.Observer
public abstract class Observer
Observer is an abstract class that have to be extended in order to initialize patches or make some observations. To observe turtle, create TurtleProbe on a special role and then add it using addProbe(); walkers = new TurtleProbe(getSimulationGroup(),"walker"); addProbe(walkers); You can specially create Turtle[] variables using TurtleProbe's getTurtles() method. This method permits to obtain an array of turtle regarding the role they play. MoreOver this agent has access to the patchGrid variable in order to observe or initialize the patches.
TurtleProbe
,
Serialized FormField Summary | |
---|---|
int |
envHeight
|
int |
envWidth
|
Patch[][] |
patchGrid
|
Constructor Summary | |
---|---|
Observer()
|
Method Summary | |
---|---|
void |
activate()
MadKit kernel usage |
java.lang.String |
getSimulationGroup()
|
void |
setup()
override this method to make other initializations,not in constructor |
void |
watch()
override this method to observe the state of the world using turtle tables or/and the patchGrid variable |
Methods inherited from class madkit.kernel.Watcher |
---|
addProbe, addProbe, end, getProbes, removeAllProbes, removeProbe, update |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public Patch[][] patchGrid
public int envWidth
public int envHeight
Constructor Detail |
---|
public Observer()
Method Detail |
---|
public void activate()
activate
in class AbstractAgent
public final java.lang.String getSimulationGroup()
public void watch()
public void setup()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |