|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmadkit.kernel.AbstractAgent
madkit.kernel.Watcher
edu.turtlekit2.kernel.agents.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 | |
---|---|
XMLAttributes |
attrib
|
int |
envHeight
|
int |
envWidth
|
ArrayList<PatchVariable> |
flavors
|
Map<String,GridVariable> |
gridValues
|
Patch[][] |
patchGrid
|
protected edu.turtlekit2.kernel.agents.EnvProbe |
probe1
|
protected edu.turtlekit2.kernel.agents.EnvProbe |
probe2
|
String |
simulationGroup
|
Constructor Summary | |
---|---|
Observer()
|
Method Summary | |
---|---|
void |
activate()
MadKit kernel usage |
boolean |
flavorsContains(String name)
|
double[][] |
getAllValues(String variableName)
|
XMLAttributes |
getAttrib()
|
boolean |
getBooleanParam(String key)
|
boolean |
getBooleanParam(String key,
boolean defaultValue)
|
Color |
getColorParam(String key)
|
Color |
getColorParam(String key,
Color defaultValue)
|
double |
getDoubleParam(String key)
|
double |
getDoubleParam(String key,
double defaultValue)
|
PatchVariable |
getFlavor(int i)
|
String |
getFlavorName(int i)
|
ArrayList<PatchVariable> |
getFlavors()
PatchVariables Methods for obs |
float |
getFloatParam(String key)
|
float |
getFloatParam(String key,
float defaultValue)
|
int |
getIntParam(String key)
|
int |
getIntParam(String key,
int defaultValue)
|
String |
getParam(String key)
|
String |
getParam(String key,
String defaultValue)
|
String |
getSimulationGroup()
|
String |
getStringParam(String key)
|
String |
getStringParam(String key,
String defaultValue)
|
void |
setAttrib(XMLAttributes attrib)
|
void |
setFlavors(ArrayList<PatchVariable> flavors)
|
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 madkit.kernel.AbstractAgent |
---|
broadcastMessage, broadcastMessage, connectedWithCommunity, createGroup, createGroup, debug, disposeMyGUI, foundGroup, getAddress, getAgentInformation, getAgentsWithRole, getAgentsWithRole, getAgentWithRole, getAgentWithRole, getAvailableCommunities, getBean, getController, getCurrentKernelAddress, getDebug, getExistingGroups, getExistingGroups, getExistingRoles, getExistingRoles, getGroups, getGUIObject, getMessageBoxSize, getMyGroups, getMyGroups, getMyRoles, getMyRoles, getName, getRoles, hasGUI, hashCode, initGUI, isBelongingToGroup, isBelongingToGroup, isCommunity, isGroup, isGroup, isMemberOf, isMemberOf, isMessageBoxEmpty, isRole, isRole, joinGroup, killAgent, launchAgent, launchAgent, leaveGroup, leaveGroup, leaveRole, leaveRole, nextMessage, print, println, receiveMessage, redisplayMyGUI, requestRole, requestRole, requestRole, restoreAgent, sendMessage, sendMessage, sendMessage, setBean, setController, setDebug, setGUIObject, setName, setOutput, setOutputWriter, toString, windowClosing |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public String simulationGroup
public Patch[][] patchGrid
public Map<String,GridVariable> gridValues
public int envWidth
public int envHeight
public XMLAttributes attrib
public ArrayList<PatchVariable> flavors
protected edu.turtlekit2.kernel.agents.EnvProbe probe1
protected edu.turtlekit2.kernel.agents.EnvProbe probe2
Constructor Detail |
---|
public Observer()
Method Detail |
---|
public void activate()
activate
in class madkit.kernel.AbstractAgent
public double[][] getAllValues(String variableName)
public final String getSimulationGroup()
public void watch()
public void setup()
public XMLAttributes getAttrib()
public void setAttrib(XMLAttributes attrib)
public ArrayList<PatchVariable> getFlavors()
public PatchVariable getFlavor(int i)
public String getFlavorName(int i)
public boolean flavorsContains(String name)
public void setFlavors(ArrayList<PatchVariable> flavors)
flavors
- The flavors to set.public int getIntParam(String key)
public int getIntParam(String key, int defaultValue)
public double getDoubleParam(String key)
public double getDoubleParam(String key, double defaultValue)
public float getFloatParam(String key)
public float getFloatParam(String key, float defaultValue)
public String getStringParam(String key)
public String getStringParam(String key, String defaultValue)
public String getParam(String key)
public String getParam(String key, String defaultValue)
public boolean getBooleanParam(String key)
public boolean getBooleanParam(String key, boolean defaultValue)
public Color getColorParam(String key)
public Color getColorParam(String key, Color defaultValue)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |