ReLogo Utility class.
Type Params | Return Type | Name and description |
---|---|---|
|
static double |
abs(Number n) Returns the absolute value of a number. |
|
static double |
acos(Number a) Returns the arc cosine of a number. |
|
static AgentSet |
agentSetFromIterable(Iterable i) |
<E extends ReLogoAgent> |
static AgentSet<E> |
agentSetFromIterator(Iterator<E> i) |
|
static AgentSet<Link> |
allLinksU(Observer observer) Returns the agentset of all links. |
|
static boolean |
allQU(Collection<? extends ReLogoAgent> a, Closure closure) Queries if all agents in a collection are true for a boolean closure. |
|
static boolean |
allQU(Object caller, Collection<? extends ReLogoAgent> a, Closure closure) |
|
static double |
angleFromDisplacement(double dX, double dY) Returns the angle in degrees corresponding to the displacement (dX, dY). |
|
static boolean |
anyQ(Collection a) Queries if there exist any agents in an agentset. |
|
static void |
approximateHsb() |
|
static void |
approximateRgb() |
|
static double |
asin(Number a) Returns the arc sine of a number. |
|
static double |
atan(Number x, Number y) Changes x,y offsets to degrees. |
|
static void |
autoPlotOff() Does nothing, included for translation compatibility. |
|
static void |
autoPlotOn() Does nothing, included for translation compatibility. |
|
static boolean |
autoplotQ() Does nothing, included for translation compatibility. |
|
static List |
baseColors() Lists fundamental colors. |
|
static double |
black() Returns the numerical value corresponding to the color black. |
|
static double |
blue() Returns the numerical value corresponding to the color blue. |
|
static double |
brown() Returns the numerical value corresponding to the color brown. |
<E> |
static List<E> |
butFirst(List<E> a) Returns a list minus first item. |
|
static String |
butFirst(String s) Returns a string minus first character. |
<E> |
static List<E> |
butLast(List<E> a) Returns a list minus last item. |
|
static String |
butLast(String s) Returns a string minus last character. |
|
static double |
ceiling(Number num) Returns smallest integer greater than or equal to a number. |
|
static void |
checkToPause() |
|
static void |
clearAllPlots() Does nothing, included for translation compatibility. |
|
static void |
clearPlot() Does nothing, included for translation compatibility. |
|
static AgentSet |
combineAgentSets(AgentSet a1, AgentSet a2) |
|
static double |
cos(Number num) Returns the cosine of an angle. |
|
static int |
count(Collection a) Returns total number of agents in an agentset. |
|
static void |
createTemporaryPlotPen() Does nothing, included for translation compatibility. |
|
static double |
cyan() Returns the numerical value corresponding to the color cyan. |
|
static String |
dateAndTime() Returns the current date and time. |
|
static void |
display() Does nothing, included for translation compatibility. |
|
static double |
e() Returns the exponential. |
|
static boolean |
emptyQ(String string) Queries if a string is empty. |
|
static boolean |
emptyQ(Collection c) Queries if a list is empty. |
|
static void |
extractHsb(Number color) |
|
static void |
extractRgb(Number color) |
<E> |
static E |
first(List<E> a) Returns the first item in a list. |
|
static String |
first(String s) Returns the first character in a string. |
|
static Collection |
flatten(Collection c) |
|
static double |
floor(Number num) Returns largest integer less than or equal to a number. |
|
static void |
flushFileSinks() Flush file data sinks. |
|
static ArrayList |
fput(Object item, List list) Appends item to the front of a list then returns the new list. |
|
static AgentSet |
getAgentSetOfClass(Class E, Observer observer) |
|
static List<Network> |
getDirectedNetworks(Observer observer) |
|
static double[] |
getDisplacementFromHeadingAndDistance(double heading, double distance) Returns the displacement double array corresponding to moving in the "heading" direction for distance "distance". |
|
static GridPoint |
getGridPointAtDisplacement(NdPoint currentLocation, double[] displacement, Observer observer) Returns the GridPoint object of the grid location corresponding to the displacement from the NdPoint currentLocation. |
|
static int |
getMaxPxcorU(Observer observer) Returns the maximum x coordinate for all patches. |
|
static int |
getMaxPycorU(Observer observer) Returns the maximum y coordinate for all patches. |
|
static int |
getMinPxcorU(Observer observer) Returns the minimum x coordinate for all patches. |
|
static int |
getMinPycorU(Observer observer) Returns the minimum y coordinate for all patches. |
|
static double |
getNLAngle(double angleInDegrees) Returns the Logo appropriate angle, i.e., between 0 to <360, given an angle in degrees. |
|
static Observer |
getObserverByID(String observerID) |
|
static Patch |
getPatchAtLocation(GridPoint gridPoint, Observer observer) Returns the Patch object at the gridPoint location. |
|
static AgentSet<Turtle> |
getTurtleAgentSetOfType(String typeName, Observer observer) |
|
static AgentSet<Turtle> |
getTurtlesOnGridPoint(GridPoint patchLocation, Observer observer) Returns the turtles on the patch corresponding to the patchLocation GridPoint. |
|
static AgentSet<Turtle> |
getTurtlesOnGridPoint(GridPoint patchLocation, Observer observer, Class type) Returns the turtles of this type on the patch corresponding to the patchLocation GridPoint. |
|
static AgentSet<Turtle> |
getTurtlesOnGridPoint(GridPoint patchLocation, Observer observer, String typeName) Returns the turtles of this typeName on the patch corresponding to the patchLocation GridPoint. |
|
static List<Network> |
getUndirectedNetworks(Observer observer) |
|
static ArrayList |
getWayPoints(Observer observer) |
|
static double |
gray() Returns the numerical value corresponding to the color gray. |
|
static double |
green() Returns the numerical value corresponding to the color green. |
|
static void |
histogram() Does nothing, included for translation compatibility. |
|
static List |
hsb(Number hh, Number ss, Number bb) Returns a rgb color list. |
|
static int |
intPart(Number num) Returns the integer portion of a number. |
|
static boolean |
isAgentQ(Object o) Queries if object is an agent. |
|
static boolean |
isAgentSetQ(Object o) Queries if object is an agentset. |
|
static boolean |
isBooleanQ(Object o) Queries if object is a boolean. |
|
static boolean |
isDirectedLinkQ(Object o) Queries if object is a directed link. |
|
static boolean |
isLinkQ(Object o) Queries if object is a link. |
|
static boolean |
isLinkSetQ(Object o) Queries if object is an agentset of links. |
|
static boolean |
isListQ(Object o) Queries if object is a list. |
|
static boolean |
isNumberQ(Object o) Queries if object is a number. |
|
static boolean |
isPatchQ(Object o) Queries if object is a patch. |
|
static boolean |
isPatchSetQ(Object o) Queries if object is an agentset of patches. |
|
static boolean |
isStringQ(Object o) Queries if object is a string. |
|
static boolean |
isTurtleQ(Object o) Queries if object is a turtle. |
|
static boolean |
isTurtleSetQ(Object o) Queries if object is an agentset of turtles. |
|
static boolean |
isUndirectedLinkQ(Object o) Queries if object is an undirected link. |
<E> |
static E |
item(int i, List<E> a) Returns item i in a list. |
|
static String |
item(int i, String s) Returns character i in a string. |
<E> |
static E |
last(List<E> a) Returns the last item in a list. |
|
static String |
last(String s) Returns the last character in a string. |
|
static int |
length(Collection c) Returns the number of items in a collection. |
|
static int |
length(String s) Returns the number of characters in a string. |
|
static double |
lime() Returns the numerical value corresponding to the color lime. |
|
static Link |
linkDir(int oneEnd, int otherEnd, Observer observer) |
|
static AgentSet<Link> |
linkSet(Object... args) Collects arguments into an agenset of links. |
|
static Link |
linkU(int oneEnd, int otherEnd, Observer observer) Returns the link between two turtles. |
|
static Link |
linkUndir(int oneEnd, int otherEnd, Observer observer) |
|
static AgentSet<Link> |
linksU(Observer observer) Returns the agentset of all generic links. |
|
static double |
ln(Number num) Returns the natural logarithm of a number |
|
static double |
log(Number num, Number base) Returns the logarithm of a number. |
|
static ArrayList |
lput(Object item, List list) Appends item to the end of a list then returns the new list. |
|
static double |
magenta() Returns the numerical value corresponding to the color magenta. |
|
static Number |
max(Collection c) Returns the largest number in a collection. |
|
static AgentSet |
maxNOfU(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. |
|
static AgentSet |
maxNOfU(Object caller, int number, Collection<? extends ReLogoAgent> c, Closure closure) |
|
static ReLogoAgent |
maxOneOfU(Collection<? extends ReLogoAgent> a, Closure closure) Returns the ReLogoAgent with the largest value when operated on by a set of commands. |
|
static ReLogoAgent |
maxOneOfU(Object caller, Collection<? extends ReLogoAgent> a, Closure closure) |
|
static double |
mean(Collection a) Returns the mean of a collection of numbers. |
|
static double |
median(Collection a) Returns the median of a collection of numbers. |
|
static boolean |
memberQ(Object value, Collection c) Queries if a value is in a collection. |
|
static boolean |
memberQ(String string1, String string2) Queries if a string is within another string. |
|
static Number |
min(Collection c) Returns the smallest number in a collection. |
|
static AgentSet |
minNOfU(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. |
|
static AgentSet |
minNOfU(Object caller, int number, Collection<? extends ReLogoAgent> a, Closure closure) |
|
static ReLogoAgent |
minOneOfU(Collection<? extends ReLogoAgent> a, Closure closure) Returns the ReLogoAgent with the smallest value when operated on by a set of commands. |
|
static ReLogoAgent |
minOneOfU(Object caller, Collection<? extends ReLogoAgent> a, Closure closure) |
|
static double |
mod(Number number1, Number number2) The modulus operator. |
<E extends ReLogoAgent> |
static AgentSet<E> |
nOf(int number, AgentSet<E> a) Returns a random subset of an agentset of size number. |
<E> |
static List<E> |
nOf(int number, Collection<E> c) Returns a random subset of a collection of size number. |
|
static List |
nValues(int number, Closure closure) Returns a list of length number from running the set of commands number times. |
|
static GridPoint |
ndPointToGridPoint(NdPoint loc) Given a continuous space location, return the corresponding grid location as a GridPoint. |
|
static int[] |
ndPointToIntArray(NdPoint loc) Given a continuous space location, return the corresponding grid location as an int array. |
|
static int |
newSeed() Returns a number to seed the random number generator. |
|
static AgentSet<Link> |
noLinks() Returns an empty agentset (of links). |
|
static AgentSet<Patch> |
noPatches() Returns an empty agentset (of patches). |
|
static AgentSet<Turtle> |
noTurtles() Returns an empty agentset (of turtles). |
|
static void |
observerStop() |
<X> |
static X |
oneOf(Collection<X> c) Returns a random item from a list. |
|
static double |
orange() Returns the numerical value corresponding to the color orange. |
|
static AgentSet<Patch> |
patchSet(Object... args) Collects arguments into an agenset of patches. |
|
static Patch |
patchU(double x, double y, Observer observer) Returns the patch containing a point. |
|
static AgentSet<Patch> |
patchesU(Observer observer) |
|
static void |
pause() Pause the simulation. |
|
static void |
pauseReLogo() |
|
static double |
pi() Returns the number for pi. |
|
static double |
pink() Returns the numerical value corresponding to the color pink. |
|
static void |
plot(Number point) Does nothing, included for translation compatibility. |
|
static String |
plotName() Does nothing, included for translation compatibility. |
|
static void |
plotPenDown() Does nothing, included for translation compatibility. |
|
static boolean |
plotPenExistsQ() Does nothing, included for translation compatibility. |
|
static void |
plotPenReset() Does nothing, included for translation compatibility. |
|
static void |
plotPenUp() Does nothing, included for translation compatibility. |
|
static double |
plotXMax() Does nothing, included for translation compatibility. |
|
static double |
plotXMin() Does nothing, included for translation compatibility. |
|
static double |
plotYMax() Does nothing, included for translation compatibility. |
|
static double |
plotYMin() Does nothing, included for translation compatibility. |
|
static void |
plotxy(Number num1, Number num2) Does nothing, included for translation compatibility. |
|
static Object |
position(Object item, List list) Returns the position of the first occurrence of an item in a list. |
|
static Object |
position(String string1, String string2) Returns the position of the first occurrence of a string within another string. |
|
static BigDecimal |
precision(BigDecimal b, int places) Returns a number with precision to a given decimal place. |
|
static int |
random(Number num) Returns a random number (integer). |
|
static double |
randomExponential(Number mean) Returns a random floating point number (exponentially distributed). |
|
static double |
randomFloat(Number num) Returns a random number (floating point). |
|
static double |
randomGamma(Number alpha, Number lambda) Returns a random floating point number (gamma distributed). |
|
static double |
randomNormal(Number mean, Number standardDeviation) Returns a random floating point number (normally distributed). |
|
static int |
randomPoisson(Number mean) Returns a random integer (poisson distributed). |
|
static int |
randomPxcorU(Observer observer) Returns a random x coordinate for patches. |
|
static int |
randomPycorU(Observer observer) Returns a random y coordinate for patches. |
|
static void |
randomSeed(int seed) Sets the random seed. |
|
static double |
randomXcorU(Observer observer) |
|
static double |
randomYcorU(Observer observer) |
|
static double |
red() Returns the numerical value corresponding to the color red. |
|
static double |
remainder(Number number1, Number number2) Returns the remainder of one number divided by another number. |
<E> |
static Collection<E> |
remove(Object item, Collection<E> c) Returns a list minus an item. |
|
static String |
remove(String string1, String string2) Returns a string minus a substring. |
<E> |
static List<E> |
removeDuplicates(List<E> list) Returns a list minus duplicated items. |
<E> |
static List<E> |
removeItem(int index, List<E> list) Returns a list minus the index item. |
|
static String |
removeItem(int index, String string) Returns a string minus the character at the index. |
|
static AgentSet |
removeLinkFromAgentSet(AgentSet a, Link l) |
|
static AgentSet |
removeLinkFromCollection(Collection a, Link l) |
|
static AgentSet |
removePatchFromAgentSet(AgentSet a, Patch p) |
|
static AgentSet |
removePatchFromCollection(Collection a, Patch p) |
|
static AgentSet |
removeTurtleFromAgentSet(AgentSet a, Turtle t) |
|
static AgentSet |
removeTurtleFromCollection(Collection a, Turtle t) |
|
static void |
repeat(Number number, Closure commands) Runs a set of commands a number of times. |
|
static ArrayList |
replaceItem(int index, List list, Object value) Returns a list with the item at location index replaced with a value. |
|
static String |
replaceItem(int index, String string1, String string2) Returns a string with the substring at a specified location replaced with another string. |
|
static void |
resetAllToggleButtons() |
|
static void |
resetPerspective() Does nothing, included for translation compatibility. |
|
static void |
resetTicks() The tick counter is reset to zero. |
|
static void |
resetTimer() The timer is reset to zero seconds. |
|
static void |
resumeReLogo() |
<E> |
static List<E> |
reverse(List<E> list) Returns a list in reversed order. |
|
static String |
reverse(String string) Returns a string in reversed order. |
|
static List |
rgb(Number rr, Number gg, Number bb) Returns a rgb color list. |
|
static int |
round(Number number) Returns the closest integer to the number. |
|
static double |
scaleColor(Number color, Number nVariableValue, Number nR1, Number nR2) Returns a shaded color. |
|
static List |
sentence(Object... args) Creates a list from the objects. |
|
static void |
setCurrentPlot(String string) Does nothing, included for translation compatibility. |
|
static void |
setCurrentPlotPen(String string) Does nothing, included for translation compatibility. |
|
static void |
setHistogramNumBars(Number num) Does nothing, included for translation compatibility. |
|
static void |
setPlotPenColor(Number color) Does nothing, included for translation compatibility. |
|
static void |
setPlotPenInterval(Number color) Does nothing, included for translation compatibility. |
|
static void |
setPlotPenMode(Number color) Does nothing, included for translation compatibility. |
|
static void |
setPlotXRange(Number left, Number right) Does nothing, included for translation compatibility. |
|
static void |
setPlotYRange(Number left, Number right) Does nothing, included for translation compatibility. |
|
static boolean |
shadeOfQ(Number nColor1, Number nColor2) Queries if two shades are of the same color. |
<E> |
static ArrayList<E> |
shuffle(List<E> a) Returns a list randomly reordered. |
|
static double |
sin(Number aDeg) Returns the sine of an angle. |
|
static double |
sky() Returns the numerical value corresponding to the color sky. |
|
static List |
sort(List a) Returns a list that has been sorted by ascending order. |
|
static List |
sort(AgentSet a) Returns an agentset that has been sorted by the natural ordering of the agents. |
|
static double |
sqrt(Number n) Returns the square root of a number. |
|
static double |
standardDeviation(Collection a) Returns the standard deviation for a collection. |
|
static void |
stop() Stop the simulation. |
<E> |
static List<E> |
sublist(List<E> a, int position1, int position2) Returns the portion of a list from one position to before another position. |
|
static String |
substring(String string, int position1, int position2) Returns the portion of a string from one position to before another position. |
|
static double |
subtractHeadings(double to, double from) Returns the difference of two headings. |
|
static double |
sum(Collection a) Returns the sum of a collection. |
|
static double |
tan(Number num) Returns the tangent of an angle. |
|
static void |
tick() The tick counter is incremented by one. |
|
static void |
tickAdvance(Number num) The tick counter is incremented by num ticks. |
|
static double |
ticks() Returns the present value of the tick counter. |
|
static double |
timer() Returns the time since "resetTimer" was last called. |
|
static double |
turquoise() Returns the numerical value corresponding to the color turquoise. |
|
static AgentSet<Turtle> |
turtleSet(Object... args) Collects arguments into an agenset of turtles. |
|
static Turtle |
turtleU(int number, Observer observer) Reports the turtle with the given who number, or null if there is no such turtle. |
|
static AgentSet<Turtle> |
turtlesU(Observer observer) |
|
static double |
variance(Collection a) Returns the variance for a list. |
|
static double |
violet() Returns the numerical value corresponding to the color violet. |
|
static void |
wait(Number timeInSecs) The agent waits timeInSecs number of seconds |
|
static double |
white() Returns the numerical value corresponding to the color white. |
|
static void |
withLocalRandomness(Closure commands) |
|
static String |
word(Object... args) Returns a string created by combining objects. |
|
static int |
worldHeightU(Observer observer) |
|
static int |
worldWidthU(Observer observer) |
|
static double |
wrapColor(Number inputColor) Returns a color in the range [0, 140). |
|
static double |
yellow() Returns the numerical value corresponding to the color yellow. |
Returns the absolute value of a number.
n
- a numberReturns the arc cosine of a number.
a
- a number in the range [-1, 1]Returns the agentset of all links.
observer
- an observerQueries if all agents in a collection are true for a boolean closure.
a
- a collection of ReLogoAgentsclosure
- a boolean closureReturns the angle in degrees corresponding to the displacement (dX, dY).
Queries if there exist any agents in an agentset.
a
- an agentsetReturns the arc sine of a number.
a
- a number in the range [-1, 1]Changes x,y offsets to degrees.
x
- a numbery
- a numberDoes nothing, included for translation compatibility.
Does nothing, included for translation compatibility.
Does nothing, included for translation compatibility.
Lists fundamental colors.
Returns the numerical value corresponding to the color black.
Returns the numerical value corresponding to the color blue.
Returns the numerical value corresponding to the color brown.
Returns a list minus first item.
a
- a listReturns a string minus first character.
s
- a string of charactersReturns a list minus last item.
a
- a listReturns a string minus last character.
s
- a string of charactersReturns smallest integer greater than or equal to a number.
num
- a numberDoes nothing, included for translation compatibility.
Does nothing, included for translation compatibility.
Returns the cosine of an angle.
num
- an angle in degreesReturns total number of agents in an agentset.
a
- an agentsetDoes nothing, included for translation compatibility.
Returns the numerical value corresponding to the color cyan.
Returns the current date and time.
Does nothing, included for translation compatibility.
Returns the exponential.
Queries if a string is empty.
string
- a stringQueries if a list is empty.
list
- a listReturns the first item in a list.
Returns the first character in a string.
Returns largest integer less than or equal to a number.
num
- a numberFlush file data sinks.
Appends item to the front of a list then returns the new list.
item
- an objectlist
- a listReturns the displacement double array corresponding to moving in the "heading" direction for distance "distance".
Returns the GridPoint object of the grid location corresponding to the displacement from the NdPoint currentLocation. Throws SpatialException if displacement is not allowed.
Returns the maximum x coordinate for all patches.
observer
- an observerReturns the maximum y coordinate for all patches.
observer
- an observerReturns the minimum x coordinate for all patches.
observer
- an observerReturns the minimum y coordinate for all patches.
observer
- an observerReturns the Logo appropriate angle, i.e., between 0 to <360, given an angle in degrees.
Returns the Patch object at the gridPoint location. Throws SpatialException if location is not allowed.
Returns the turtles on the patch corresponding to the patchLocation GridPoint. Throws SpatialException if location is not allowed.
Returns the turtles of this type on the patch corresponding to the patchLocation GridPoint. Throws SpatialException if location is not allowed.
Returns the turtles of this typeName on the patch corresponding to the patchLocation GridPoint. Throws SpatialException if location is not allowed.
Returns the numerical value corresponding to the color gray.
Returns the numerical value corresponding to the color green.
Does nothing, included for translation compatibility.
Returns a rgb color list.
hh
- a number in the range [0, 255]ss
- a number in the range [0, 255]bb
- a number in the range [0, 255]Returns the integer portion of a number.
num
- a numberQueries if object is an agent.
o
- an objectQueries if object is an agentset.
o
- an objectQueries if object is a boolean.
o
- an objectQueries if object is a directed link.
o
- an objectQueries if object is a link.
o
- an objectQueries if object is an agentset of links.
o
- an objectQueries if object is a list.
o
- an objectQueries if object is a number.
o
- an objectQueries if object is a patch.
o
- an objectQueries if object is an agentset of patches.
o
- an objectQueries if object is a string.
o
- an objectQueries if object is a turtle.
o
- an objectQueries if object is an agentset of turtles.
o
- an objectQueries if object is an undirected link.
o
- an objectReturns item i in a list.
i
- an integera
- a listReturns character i in a string.
i
- an integers
- a stringReturns the last item in a list.
a
- a listReturns the last character in a string.
s
- a stringReturns the number of items in a collection.
c
- a collectionReturns the number of characters in a string.
s
- a stringReturns the numerical value corresponding to the color lime.
Collects arguments into an agenset of links.
args
- link, set of links, agentset of linksReturns the link between two turtles.
oneEnd
- an integerotherEnd
- an integerobserver
- an observerReturns the agentset of all generic links.
observer
- an observerReturns the natural logarithm of a number
num
- a numberReturns the logarithm of a number.
num
- a numberbase
- a numberAppends item to the end of a list then returns the new list.
item
- an objectlist
- a listReturns the numerical value corresponding to the color magenta.
Returns the largest number in a collection.
c
- a collectionReturns 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 the mean of a collection of numbers.
a
- a collection of numbersReturns the median of a collection of numbers.
a
- a collection of numbersQueries if a value is in a collection.
value
- an objectc
- a collectionQueries if a string is within another string.
string1
- a stringstring2
- a stringReturns the smallest number in a collection.
c
- a collectionReturns 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 commandsThe modulus operator.
number1
- a numbernumber2
- a numberReturns a random subset of an agentset of size number.
number
- an integera
- an agentsetReturns a random subset of a collection of size number.
number
- an integerc
- a collectionReturns a list of length number from running the set of commands number times.
number
- an integerclosure
- a set of commandsGiven a continuous space location, return the corresponding grid location as a GridPoint. The convention here is that, for each coordinate, [ i - 0.5 , i + 0.5 ) returns i. E.g., -2.5 -> -2 , -0.5 -> 0, 0.5 -> 1
Given a continuous space location, return the corresponding grid location as an int array. The convention here is that, for each coordinate, [ i - 0.5 , i + 0.5 ) returns i. E.g., -2.5 -> -2 , -0.5 -> 0, 0.5 -> 1
Returns a number to seed the random number generator.
Returns an empty agentset (of links).
Returns an empty agentset (of patches).
Returns an empty agentset (of turtles).
Returns a random item from a list.
a
- a listReturns the numerical value corresponding to the color orange.
Collects arguments into an agenset of patches.
args
- patches, set of patches, agentset of patchesReturns the patch containing a point.
nX
- x coordinatenY
- y coordinateobserver
- an observerPause the simulation.
Returns the number for pi.
Returns the numerical value corresponding to the color pink.
Does nothing, included for translation compatibility.
Does nothing, included for translation compatibility.
Does nothing, included for translation compatibility.
Does nothing, included for translation compatibility.
Does nothing, included for translation compatibility.
Does nothing, included for translation compatibility.
Does nothing, included for translation compatibility.
Does nothing, included for translation compatibility.
Does nothing, included for translation compatibility.
Does nothing, included for translation compatibility.
Does nothing, included for translation compatibility.
Returns the position of the first occurrence of an item in a list.
item
- an objectlist
- a listReturns the position of the first occurrence of a string within another string.
string1
- a stringstring2
- a stringReturns a number with precision to a given decimal place.
b
- a numberplaces
- an integerReturns a random number (integer).
num
- a numberReturns a random floating point number (exponentially distributed).
mean
- a numberReturns a random number (floating point).
num
- a numberReturns a random floating point number (gamma distributed).
alpha
- a numberlambda
- a numberReturns a random floating point number (normally distributed).
mean
- a numberstandardDeviation
- a numberReturns a random integer (poisson distributed).
mean
- a numberReturns a random x coordinate for patches.
observer
- an observerReturns a random y coordinate for patches.
observer
- an observerSets the random seed.
seed
- an integerReturns the numerical value corresponding to the color red.
Returns the remainder of one number divided by another number.
number1
- a numbernumber2
- a numberReturns a list minus an item.
item
- an objectlist
- a listReturns a string minus a substring.
string1
- a stringstring2
- a stringReturns a list minus duplicated items.
list
- a listReturns a list minus the index item.
index
- an integerlist
- a listReturns a string minus the character at the index.
index
- an integerstring
- a stringRuns a set of commands a number of times.
number
- a numbercommands
- a set of commandsReturns a list with the item at location index replaced with a value.
index
- an integerlist
- a listvalue
- an objectReturns a string with the substring at a specified location replaced with another string.
index
- an integerstring1
- a stringstring2
- a stringDoes nothing, included for translation compatibility.
The tick counter is reset to zero.
The timer is reset to zero seconds.
Returns a list in reversed order.
list
- a listReturns a string in reversed order.
string
- a stringReturns a rgb color list.
rr
- a number in the range [0, 255]gg
- a number in the range [0, 255]Returns the closest integer to the number.
number
- a numberReturns a shaded color.
color
- a number in the range [0,140)nVariableValue
- a valuenR1
- a numbernR2
- a numberCreates a list from the objects.
args
- any number of itemsDoes nothing, included for translation compatibility.
Does nothing, included for translation compatibility.
Does nothing, included for translation compatibility.
Does nothing, included for translation compatibility.
Does nothing, included for translation compatibility.
Does nothing, included for translation compatibility.
Does nothing, included for translation compatibility.
Does nothing, included for translation compatibility.
Queries if two shades are of the same color.
nColor1
- a numbernColor2
- a numberReturns a list randomly reordered.
a
- a listReturns the sine of an angle.
aDeg
- an angle in degreesReturns the numerical value corresponding to the color sky.
Returns a list that has been sorted by ascending order.
a
- listReturns an agentset that has been sorted by the natural ordering of the agents.
a
- agentsetReturns the square root of a number.
n
- a numberReturns the standard deviation for a collection.
a
- a collectionStop the simulation.
Returns the portion of a list from one position to before another position.
a
- a listposition1
- a zero-based indexposition2
- a zero-based indexReturns the portion of a string from one position to before another position.
string
- a stringposition1
- a zero-based indexposition2
- a zero-based indexReturns the difference of two headings.
to
- an angle in degreesfrom
- an angle in degreesReturns the sum of a collection.
a
- a collectionReturns the tangent of an angle.
num
- an angle in degreesThe tick counter is incremented by one.
The tick counter is incremented by num ticks.
num
- a numberReturns the present value of the tick counter.
Returns the time since "resetTimer" was last called.
Returns the numerical value corresponding to the color turquoise.
Collects arguments into an agenset of turtles.
args
- turtles, set of turtles, agentset of turtlesReports the turtle with the given who number, or null if there is no such turtle.
Returns the variance for a list.
a
- a listReturns the numerical value corresponding to the color violet.
The agent waits timeInSecs number of seconds
timeInSecs
- a numberReturns the numerical value corresponding to the color white.
Returns a string created by combining objects.
args
- an objectReturns a color in the range [0, 140).
inputColor
- a numberReturns the numerical value corresponding to the color yellow.