Computer Science- Netlogo Primitives 2 Flashcards
(15 cards)
[attribute] of agent
a reporter that reports current value of agent’s attribute
one-of agentset
returns a random agent of agentset
towards agent
returns heading from calling agent to input agent
let var value
creates a local variable var and assigns it a value
any? agentset
reports whether agentset has more than 0 members
carefully
- error handling
- carefully
[do this cmd block]
[but if the first cmd block crashed, do this cmd block] - BE CAREFUL USING THIS, USES A LOT OF SPACE
min-one-of agentset [reporter]
returns the agent in agentset with min value for var
max-one-of agentset [reporter]
returns the agent in agentset with max value for var
turtles-here
reports agentset of turtles on caller’s patch
agentset in-radius R
reports agentset that includes agents from original whose distance from caller is less than or equal to R
agentset in-cone distance angle
- reporter that gives turtle a cone of vision in front of itself
- viewing angle ranges from 0 to 360
- reports an agentset that includes only those agents from the original agentset that fall in the cone. (can include the agent itself)
import-pcolors “filename.jpg, png, gif, bmp “
- reads an image file, scales it to the same dimensions as the patch grid while keeping the original ratio of the image
- transfers the resulting pixel colors to the patches
- file must be in same location as picture
resize-world min-pxcor max-pxcor min-pycor max-pycor
resets the world with new coordinates
set-patch-size
sets size of patches of the view in pixels
mean
reports mean of the numeric items in the given list