|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.turtlekit2.kernel.environment.Patch
public final class Patch
The Patch class
Field Summary | |
---|---|
boolean |
change
|
Color |
color
|
double |
diffusion
|
Patch[] |
neighbors
|
Collection<Turtle> |
turtlesHere
|
double[] |
variableValue
|
int |
x
|
int |
y
|
Constructor Summary | |
---|---|
Patch(TurtleEnvironment w,
int x,
int y)
|
Method Summary | |
---|---|
void |
addAgent(Turtle a)
|
void |
dropMark(String markName,
Object value)
Drop a mark on the patch |
Color |
getColor()
|
Object |
getMark(String markName)
get a mark deposed on the patch |
Patch[] |
getNeighbors()
|
Turtle[] |
getOtherTurtles(Turtle t)
|
Turtle[] |
getTurtles()
returns the turtles who are on the patch |
void |
incrementPatchVariable(String variableName,
double n)
add n to the value of the corresponding patch variable |
boolean |
isMarkPresent(String markName)
tests if the corresponding mark is present on the patch (true or false) |
void |
removeAgent(Turtle a)
|
void |
setColor(Color c)
|
void |
setNeighborhood(Patch[] acc)
|
void |
setPatchVariable(String variableName,
double n)
set the value of the corresponding patch variable to n, use it with observers in the setup method for example |
int |
size()
|
double |
smell(String variableName)
return the value of the corresponding variable |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public double diffusion
public double[] variableValue
public transient Patch[] neighbors
public Collection<Turtle> turtlesHere
public Color color
public boolean change
public int x
public int y
Constructor Detail |
---|
public Patch(TurtleEnvironment w, int x, int y)
Method Detail |
---|
public final void setNeighborhood(Patch[] acc)
public final void removeAgent(Turtle a)
public final void addAgent(Turtle a)
public final void setPatchVariable(String variableName, double n)
public final void incrementPatchVariable(String variableName, double n)
public final double smell(String variableName)
public final Color getColor()
public final void setColor(Color c)
public final Turtle[] getOtherTurtles(Turtle t)
public final int size()
public final void dropMark(String markName, Object value)
markName
- mark namevalue
- mark itself, can be any java objectpublic final Object getMark(String markName)
public final boolean isMarkPresent(String markName)
public final Turtle[] getTurtles()
public final Patch[] getNeighbors()
public final String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |