public abstract class AbstractObserver
Type | Name and description |
---|---|
Context |
context |
String |
observerID |
DenseDoubleMatrix2D |
patchVarMatrix |
Type Params | Return Type | Name and description |
---|---|---|
|
AgentSet<Link> |
allLinks() {@inheritDoc} |
|
boolean |
allQ(Collection a, Closure closure) Queries if all agents in a collection are true for a boolean closure. |
|
void |
ask(AgentSet<? extends ReLogoAgent> a, Closure askBlock) Executes a set of commands for an agentset in random order. |
|
void |
ask(Collection<? extends ReLogoAgent> c, Closure askBlock) Executes a set of commands for a collection of agents. |
|
void |
ask(Turtle t, Closure askBlock) Executes a set of commands for a turtle. |
|
void |
ask(Patch p, Closure askBlock) Executes a set of commands for a patch. |
|
void |
ask(Link l, Closure askBlock) Executes a set of commands for a link. |
|
void |
askCollection(Collection<? extends ReLogoAgent> c, Closure cl) |
|
void |
ca() Clears the world to the default state. |
|
void |
clearAll() Clears the world to the default state. |
|
void |
clearLinks() Removes all links. |
|
void |
clearPatches() Sets all standard and diffusible patch variables to their default values. |
|
void |
clearTrackingNetwork() |
|
void |
clearTurtles() Removes all turtles. |
|
void |
cp() Sets all standard and diffusible patch variables to their default values. |
|
AgentSet<Turtle> |
createOrderedTurtles(int number, Closure closure, String type) Makes a number of uniformly fanned turtles of a specific type then executes a set of commands on the turtles. |
|
AgentSet<Turtle> |
createOrderedTurtles(int number, Closure closure, Class type) Makes a number of uniformly fanned turtles of a specific type then executes a set of commands on the turtles. |
|
AgentSet<Turtle> |
createOrderedTurtles(int number) Makes a number of uniformly fanned turtles. |
|
AgentSet<Turtle> |
createOrderedTurtles(int number, Closure closure) Makes a number of uniformly fanned turtles then executes a set of commands on the turtles. |
|
void |
createPatchVar(DiffusiblePatchVariable var) |
|
AgentSet<Turtle> |
createTurtles(int number, Closure closure, String type) Makes a number of randomly oriented turtles of a specific type then executes a set of commands on the turtles. |
|
AgentSet<Turtle> |
createTurtles(int number, Closure closure, Class type) Makes a number of randomly oriented turtles of a specific type then executes a set of commands on the turtles. |
|
AgentSet<Turtle> |
createTurtles(int number) Makes a number of randomly oriented turtles. |
|
AgentSet<Turtle> |
createTurtles(int number, Closure closure) Makes a number of randomly oriented turtles then executes a set of commands on the turtles. |
|
AgentSet<Turtle> |
cro(int number) Makes a number of uniformly fanned turtles. |
|
AgentSet<Turtle> |
cro(int number, Closure closure) Makes a number of uniformly fanned turtles then executes a set of commands on the turtles. |
|
AgentSet<Turtle> |
cro(int number, Closure closure, String type) Makes a number of uniformly fanned turtles of a specific type then executes a set of commands on the turtles. |
|
AgentSet<Turtle> |
cro(int number, Closure closure, Class type) Makes a number of uniformly fanned turtles of a specific type then executes a set of commands on the turtles. |
|
AgentSet<Turtle> |
crt(int number) Makes a number of randomly oriented turtles. |
|
AgentSet<Turtle> |
crt(int number, Closure closure) Makes a number of randomly oriented turtles then executes a set of commands on the turtles. |
|
AgentSet<Turtle> |
crt(int number, Closure closure, String type) Makes a number of randomly oriented turtles of a specific type then executes a set of commands on the turtles. |
|
AgentSet<Turtle> |
crt(int number, Closure closure, Class type) Makes a number of randomly oriented turtles of a specific type then executes a set of commands on the turtles. |
|
void |
ct() Removes all turtles. |
|
void |
diffuse(String patchVariable, double number) Diffuses to the eight neighboring patches a fraction number of the patch variable. |
|
void |
diffuse4(String patchVariable, double number) Diffuses to the four neighboring patches a fraction number of the patch variable. |
|
void |
diffusibleAdd(String patchVariable, Number number) Add a number to a diffusible patch variable of all patches. |
|
void |
diffusibleApply(String patchVariable, DoubleFunction function) Apply a function to a diffusible patch variable of all patches. |
|
void |
diffusibleDivide(String patchVariable, Number number) Divide a diffusible patch variable of all patches by a number. |
|
void |
diffusibleMultiply(String patchVariable, Number number) Multiply a diffusible patch variable of all patches by a number. |
|
void |
diffusibleSubtract(String patchVariable, Number number) Subtract a number from a diffusible patch variable of all patches. |
|
void |
fileShow(Object value) Prints value with agent identifier to current file with a newline. |
|
Context |
getContext() |
|
Grid |
getGrid() |
|
LinkFactory |
getLinkFactory() |
|
int |
getMaxPxcor() Returns the maximum x coordinate for all patches. |
|
int |
getMaxPycor() Returns the maximum y coordinate for all patches. |
|
int |
getMinPxcor() Returns the minimum x coordinate for all patches. |
|
int |
getMinPycor() Returns the minimum y coordinate for all patches. |
|
Network |
getNetwork(String name) |
|
String |
getObserverID() |
|
DenseDoubleMatrix2D |
getPatchVarMatrix(String varName) |
|
RLWorldDimensions |
getRLDimensions() |
|
ContinuousSpace |
getSpace() |
|
TurtleFactory |
getTurtleFactory() |
|
void |
initializeBaseObserver(String observerID, Context context, TurtleFactory tf, PatchFactory pf, LinkFactory lf, RLWorldDimensions rLD) |
|
Link |
link(Number oneEnd, Number otherEnd) Returns the link between two turtles. |
|
Link |
link(Turtle oneEnd, Turtle otherEnd) Returns the link between two turtles. |
|
AgentSet<Link> |
links() {@inheritDoc} |
|
AgentSet |
maxNOf(int number, Collection<? extends ReLogoAgent> a, Closure closure) Returns an agentset consisting of a specified number of agents which have the greatest value when operated on by a set of commands. |
|
ReLogoAgent |
maxOneOf(Collection<? extends ReLogoAgent> a, Closure closure) Returns the ReLogoAgent with the largest value when operated on by a set of commands. |
|
AgentSet |
minNOf(int number, Collection<? extends ReLogoAgent> a, Closure closure) Returns an agentset consisting of a specified number of agents which have the lowest value when operated on by a set of commands. |
|
ReLogoAgent |
minOneOf(Collection<? extends ReLogoAgent> a, Closure closure) Returns the ReLogoAgent with the smallest value when operated on by a set of commands. |
|
Stop |
oldStop() Stops an observer executing within a command closure. |
|
Patch |
patch(Number nX, Number nY) Returns the patch containing a point. |
|
AgentSet<Patch> |
patches() Returns an agentset containing all patches. |
|
void |
projectionEventOccurred(ProjectionEvent p) |
|
int |
randomPxcor() Returns a random x coordinate for patches. |
|
int |
randomPycor() Returns a random y coordinate for patches. |
|
double |
randomXcor() Returns a random x coordinate for turtles. |
|
double |
randomYcor() Returns a random y coordinate for turtles. |
|
void |
registerModelParameterListener(String varName, Closure closure) {@inheritDoc} |
|
void |
run(String string) Interprets a string as commands then runs the commands. |
|
Object |
runresult(String string) Interprets a string as a command then returns the result. |
|
void |
setContext(Context context) |
|
void |
setDefaultShape(String turtleType, String shape) Sets the default shape for new turtleType turtles to shape. |
|
void |
setDefaultShape(Class turtleType, String shape) Sets the default shape for new turtleType turtles to shape. |
|
void |
setObserverID(String observerID) |
|
void |
setPatchVarMatrix(String varName, DenseDoubleMatrix2D mat) |
|
void |
setRLWorldDimensions(RLWorldDimensions rLD) |
|
void |
show(Object value) Prints value with agent identifier to the console. |
|
String |
toString() This method provides a human-readable name for the agent. |
|
Turtle |
turtle(Number number) Returns the turtle of the given number. |
|
AgentSet<Turtle> |
turtles() Returns an agentset containing all turtles. |
|
AgentSet<Turtle> |
turtlesOn(Patch p) Returns an agentset of turtles on a given patch. |
|
AgentSet<Turtle> |
turtlesOn(Turtle t) Returns an agentset of turtles on the same patch as a turtle. |
|
AgentSet<Turtle> |
turtlesOn(Collection a) Returns an agentset of turtles on the patches in a collection or on the patches that a collection of turtles are. |
|
int |
worldHeight() Returns the height of the world. |
|
int |
worldWidth() Returns the width of the world. |
Queries if all agents in a collection are true for a boolean closure.
a
- a collection of ReLogoAgentsclosure
- a boolean closureExecutes a set of commands for an agentset in random order.
a
- an agentsetaskBlock
- a set of commandsExecutes a set of commands for a collection of agents.
c
- a collection of agentsaskBlock
- a set of commandsExecutes a set of commands for a turtle.
t
- a turtleaskBlock
- a set of commandsExecutes a set of commands for a patch.
p
- a patchaskBlock
- a set of commandsExecutes a set of commands for a link.
l
- a linkaskBlock
- a set of commandsClears the world to the default state.
Clears the world to the default state.
Removes all links.
Sets all standard and diffusible patch variables to their default values.
Removes all turtles.
Sets all standard and diffusible patch variables to their default values.
Makes a number of uniformly fanned turtles of a specific type then executes a set of commands on the turtles.
number
- an integerclosure
- a set of commandstype
- a turtle typeMakes a number of uniformly fanned turtles of a specific type then executes a set of commands on the turtles.
number
- an integerclosure
- a set of commandstype
- a turtle typeMakes a number of uniformly fanned turtles.
number
- an integerMakes a number of uniformly fanned turtles then executes a set of commands on the turtles.
number
- an integerclosure
- a set of commandsMakes a number of randomly oriented turtles of a specific type then executes a set of commands on the turtles.
number
- an integerclosure
- a set of commandstype
- a turtle typeMakes a number of randomly oriented turtles of a specific type then executes a set of commands on the turtles.
number
- an integerclosure
- a set of commandstype
- a turtle typeMakes a number of randomly oriented turtles.
number
- an integerMakes a number of randomly oriented turtles then executes a set of commands on the turtles.
number
- an integerclosure
- a set of commandsMakes a number of uniformly fanned turtles.
number
- an integerMakes a number of uniformly fanned turtles then executes a set of commands on the turtles.
number
- an integerclosure
- a set of commandsMakes a number of uniformly fanned turtles of a specific type then executes a set of commands on the turtles.
number
- an integerclosure
- a set of commandstype
- a turtle typeMakes a number of uniformly fanned turtles of a specific type then executes a set of commands on the turtles.
number
- an integerclosure
- a set of commandstype
- a turtle typeMakes a number of randomly oriented turtles.
number
- an integerMakes a number of randomly oriented turtles then executes a set of commands on the turtles.
number
- an integerclosure
- a set of commandsMakes a number of randomly oriented turtles of a specific type then executes a set of commands on the turtles.
number
- an integerclosure
- a set of commandstype
- a turtle typeMakes a number of randomly oriented turtles of a specific type then executes a set of commands on the turtles.
number
- an integerclosure
- a set of commandstype
- a turtle typeRemoves all turtles.
Diffuses to the eight neighboring patches a fraction number of the patch variable.
patchVariable
- the name of a diffusible patch variablenumber
- a number in the range [0,1]Diffuses to the four neighboring patches a fraction number of the patch variable.
patchVariable
- the name of a diffusible patch variablenumber
- a number number in the range [0,1]Add a number to a diffusible patch variable of all patches.
patchVariable
- the name of a diffusible patch variablenumber
- a numberApply a function to a diffusible patch variable of all patches.
patchVariable
- the name of a diffusible patch variablefunction
- a DoubleFunction functionDivide a diffusible patch variable of all patches by a number.
patchVariable
- the name of a diffusible patch variablenumber
- a numberMultiply a diffusible patch variable of all patches by a number.
patchVariable
- the name of a diffusible patch variablenumber
- a numberSubtract a number from a diffusible patch variable of all patches.
patchVariable
- the name of a diffusible patch variablenumber
- a numberPrints value with agent identifier to current file with a newline.
value
- any objectReturns the maximum x coordinate for all patches.
Returns the maximum y coordinate for all patches.
Returns the minimum x coordinate for all patches.
Returns the minimum y coordinate for all patches.
Returns the link between two turtles.
oneEnd
- an integerotherEnd
- an integerReturns the link between two turtles.
oneEnd
- a turtleotherEnd
- a turtleReturns an agentset consisting of a specified number of agents which have the greatest value when operated on by a set of commands.
number
- an integera
- a collectionclosure
- a set of commandsReturns the ReLogoAgent with the largest value when operated on by a set of commands.
a
- a collectionclosure
- a set of commandsReturns an agentset consisting of a specified number of agents which have the lowest value when operated on by a set of commands.
number
- an integera
- a collectionclosure
- a set of commandsReturns the ReLogoAgent with the smallest value when operated on by a set of commands.
a
- a collectionclosure
- a set of commandsStops an observer executing within a command closure.
Returns the patch containing a point.
nX
- x coordinatenY
- y coordinateReturns an agentset containing all patches.
Returns a random x coordinate for patches.
Returns a random y coordinate for patches.
Returns a random x coordinate for turtles.
Returns a random y coordinate for turtles.
Interprets a string as commands then runs the commands.
string
- a stringInterprets a string as a command then returns the result.
string
- a stringSets the default shape for new turtleType turtles to shape.
turtleType
- a stringshape
- a stringSets the default shape for new turtleType turtles to shape.
turtleType
- a classshape
- a stringPrints value with agent identifier to the console.
value
- any objectThis method provides a human-readable name for the agent.
Returns the turtle of the given number.
number
- a numberReturns an agentset containing all turtles.
Returns an agentset of turtles on a given patch.
p
- a patchReturns an agentset of turtles on the same patch as a turtle.
t
- a turtleReturns an agentset of turtles on the patches in a collection or on the patches that a collection of turtles are.
a
- a collectionReturns the height of the world.
Returns the width of the world.