org.nlogo.agent
Class Patch
java.lang.Object
java.util.Observable
org.nlogo.agent.Agent
org.nlogo.agent.Patch
- All Implemented Interfaces:
- Comparable, Agent, Patch
- Direct Known Subclasses:
- Patch3D
public class Patch
- extends Agent
- implements Patch
Method Summary |
String |
classDisplayName()
|
Patch |
fastGetPatchAt(int x,
int y)
|
int |
getAgentBit()
|
Class |
getAgentClass()
|
Object |
getBreedVariable(String name)
|
static List |
getImplicitVariables()
|
Object |
getLinkBreedVariable(String name)
|
Object |
getLinkVariable(int vn)
|
double |
getLinkVariableDouble(int vn)
|
AgentSet |
getNeighbors()
|
AgentSet |
getNeighbors4()
|
Object |
getObserverVariable(int vn)
|
Patch |
getPatchAtOffsets(double dx,
double dy)
|
Patch |
getPatchEast()
|
Patch |
getPatchNorth()
|
Patch |
getPatchNorthEast()
|
Patch |
getPatchNorthWest()
|
Patch |
getPatchSouth()
|
Patch |
getPatchSouthEast()
|
Patch |
getPatchSouthWest()
|
Object |
getPatchVariable(int vn)
|
double |
getPatchVariableDouble(int vn)
|
Patch |
getPatchWest()
|
Object |
getTurtleOrLinkVariable(String varName)
|
Object |
getTurtleVariable(int vn)
|
double |
getTurtleVariableDouble(int vn)
|
Object |
getVariable(int vn)
|
boolean |
hasLabel()
|
static boolean |
isDoubleVariable(int vn)
|
static boolean |
isSpecialVariable(int vn)
|
Object |
label()
|
void |
label(Object label)
|
Object |
labelColor()
|
void |
labelColor(double labelColor)
|
void |
labelColor(Double labelColor)
|
void |
labelColor(LogoList rgb,
int varIndex)
|
String |
labelString()
|
Object |
pcolor()
|
void |
pcolor(double pcolor)
|
void |
pcolor(Double boxedColor)
|
void |
pcolor(LogoList rgb)
|
void |
pcolor(LogoList rgb,
int varIndex)
|
double |
pcolorDouble()
|
void |
pcolorDoubleUnchecked(Double boxedColor)
|
void |
setBreedVariable(String name,
Object value)
|
void |
setLinkBreedVariable(String name,
Object value)
|
void |
setLinkVariable(int vn,
double value)
|
void |
setLinkVariable(int vn,
Object value)
|
void |
setObserverVariable(int vn,
Object value)
|
void |
setPatchVariable(int vn,
double value)
|
void |
setPatchVariable(int vn,
Object value)
|
void |
setTurtleOrLinkVariable(String varName,
Object value)
|
void |
setTurtleVariable(int vn,
double value)
|
void |
setTurtleVariable(int vn,
Object value)
|
void |
setVariable(int vn,
Object value)
|
Turtle |
sprout(int c,
int heading,
AgentSet breed)
|
String |
toString()
|
VAR_PXCOR
public static final int VAR_PXCOR
- See Also:
- Constant Field Values
VAR_PYCOR
public static final int VAR_PYCOR
- See Also:
- Constant Field Values
VAR_PCOLOR
public static final int VAR_PCOLOR
- See Also:
- Constant Field Values
VAR_PLABEL
public static final int VAR_PLABEL
- See Also:
- Constant Field Values
VAR_PLABELCOLOR
public static final int VAR_PLABELCOLOR
- See Also:
- Constant Field Values
LAST_PREDEFINED_VAR
public static final int LAST_PREDEFINED_VAR
- See Also:
- Constant Field Values
NUMBER_PREDEFINED_VARS
public int NUMBER_PREDEFINED_VARS
turtlesHere
public final List turtlesHere
patchNeighbors
public AgentSet patchNeighbors
patchNeighbors4
public AgentSet patchNeighbors4
pxcor
public final int pxcor
pycor
public final int pycor
BIT
public static final int BIT
- See Also:
- Constant Field Values
getImplicitVariables
public static List getImplicitVariables()
isDoubleVariable
public static boolean isDoubleVariable(int vn)
isSpecialVariable
public static boolean isSpecialVariable(int vn)
getObserverVariable
public Object getObserverVariable(int vn)
- Specified by:
getObserverVariable
in class Agent
getTurtleVariable
public Object getTurtleVariable(int vn)
throws AgentException
- Specified by:
getTurtleVariable
in class Agent
- Throws:
AgentException
getTurtleVariableDouble
public double getTurtleVariableDouble(int vn)
throws AgentException
- Specified by:
getTurtleVariableDouble
in class Agent
- Throws:
AgentException
getLinkVariable
public Object getLinkVariable(int vn)
throws AgentException
- Specified by:
getLinkVariable
in class Agent
- Throws:
AgentException
getLinkVariableDouble
public double getLinkVariableDouble(int vn)
throws AgentException
- Specified by:
getLinkVariableDouble
in class Agent
- Throws:
AgentException
getTurtleOrLinkVariable
public Object getTurtleOrLinkVariable(String varName)
throws AgentException
- Specified by:
getTurtleOrLinkVariable
in class Agent
- Throws:
AgentException
getLinkBreedVariable
public Object getLinkBreedVariable(String name)
throws AgentException
- Specified by:
getLinkBreedVariable
in class Agent
- Throws:
AgentException
getBreedVariable
public Object getBreedVariable(String name)
throws AgentException
- Specified by:
getBreedVariable
in class Agent
- Throws:
AgentException
getVariable
public Object getVariable(int vn)
- Specified by:
getVariable
in class Agent
setObserverVariable
public void setObserverVariable(int vn,
Object value)
throws AgentException,
LogoException
- Specified by:
setObserverVariable
in class Agent
- Throws:
AgentException
LogoException
setTurtleVariable
public void setTurtleVariable(int vn,
Object value)
throws AgentException
- Specified by:
setTurtleVariable
in class Agent
- Throws:
AgentException
setTurtleVariable
public void setTurtleVariable(int vn,
double value)
throws AgentException
- Specified by:
setTurtleVariable
in class Agent
- Throws:
AgentException
setBreedVariable
public void setBreedVariable(String name,
Object value)
throws AgentException
- Specified by:
setBreedVariable
in class Agent
- Throws:
AgentException
setLinkVariable
public void setLinkVariable(int vn,
Object value)
throws AgentException
- Specified by:
setLinkVariable
in class Agent
- Throws:
AgentException
setLinkVariable
public void setLinkVariable(int vn,
double value)
throws AgentException
- Specified by:
setLinkVariable
in class Agent
- Throws:
AgentException
setTurtleOrLinkVariable
public void setTurtleOrLinkVariable(String varName,
Object value)
throws AgentException
- Specified by:
setTurtleOrLinkVariable
in class Agent
- Throws:
AgentException
setLinkBreedVariable
public void setLinkBreedVariable(String name,
Object value)
throws AgentException
- Specified by:
setLinkBreedVariable
in class Agent
- Throws:
AgentException
setVariable
public void setVariable(int vn,
Object value)
throws AgentException
- Specified by:
setVariable
in class Agent
- Throws:
AgentException
setPatchVariable
public void setPatchVariable(int vn,
Object value)
throws AgentException
- Specified by:
setPatchVariable
in class Agent
- Throws:
AgentException
setPatchVariable
public void setPatchVariable(int vn,
double value)
throws AgentException
- Specified by:
setPatchVariable
in class Agent
- Throws:
AgentException
getPatchVariable
public Object getPatchVariable(int vn)
- Specified by:
getPatchVariable
in class Agent
getPatchVariableDouble
public double getPatchVariableDouble(int vn)
- Specified by:
getPatchVariableDouble
in class Agent
getPatchAtOffsets
public Patch getPatchAtOffsets(double dx,
double dy)
throws AgentException
- Specified by:
getPatchAtOffsets
in class Agent
- Throws:
AgentException
fastGetPatchAt
public Patch fastGetPatchAt(int x,
int y)
getNeighbors
public AgentSet getNeighbors()
getNeighbors4
public AgentSet getNeighbors4()
sprout
public Turtle sprout(int c,
int heading,
AgentSet breed)
pcolorDouble
public double pcolorDouble()
pcolor
public Object pcolor()
pcolor
public void pcolor(double pcolor)
pcolor
public void pcolor(Double boxedColor)
pcolorDoubleUnchecked
public void pcolorDoubleUnchecked(Double boxedColor)
pcolor
public void pcolor(LogoList rgb)
throws AgentException
- Throws:
AgentException
pcolor
public void pcolor(LogoList rgb,
int varIndex)
throws AgentException
- Throws:
AgentException
label
public Object label()
hasLabel
public boolean hasLabel()
labelString
public String labelString()
label
public void label(Object label)
labelColor
public Object labelColor()
labelColor
public void labelColor(double labelColor)
labelColor
public void labelColor(Double labelColor)
labelColor
public void labelColor(LogoList rgb,
int varIndex)
throws AgentException
- Throws:
AgentException
toString
public String toString()
- Overrides:
toString
in class Object
classDisplayName
public String classDisplayName()
- Specified by:
classDisplayName
in class Agent
getAgentClass
public Class getAgentClass()
- Specified by:
getAgentClass
in class Agent
getAgentBit
public int getAgentBit()
- Specified by:
getAgentBit
in class Agent
getPatchNorth
public Patch getPatchNorth()
getPatchSouth
public Patch getPatchSouth()
getPatchEast
public Patch getPatchEast()
getPatchWest
public Patch getPatchWest()
getPatchNorthWest
public Patch getPatchNorthWest()
getPatchSouthWest
public Patch getPatchSouthWest()
getPatchSouthEast
public Patch getPatchSouthEast()
getPatchNorthEast
public Patch getPatchNorthEast()