Computer Science- Netlogo Test Flashcards
(28 cards)
emergence
- way in which complex systems/patterns arise from a multiplicity of simple interactions
- seen in snowflakes, religion, termites, neural networks, economics, philosophy
parallel programming
many calculations are carried out simultaneously
Interface Tab- Command Center
- similar to interactions (bottom pane) in DrRacket
- enter command, hit enter, see immediate outcome
- pay attention to context
Interface Tab- World
block square where your living entities (turtles) live
define function with no arguments/inputs/parameters
to
body
end
define function with arguments
to
arg1 arg2 …
body
end
store value in memory
set var value
repeat tasks
repeat n [
task
end
[ ]
changes context and function
slider
creates a global variable of the same name
global variable
can be accessed by any procedure or agent (eg turtle) in the world
heading
- direction the turtle is pointing at
- right click on turtle, inspect, change heading
- set heading #
- left 30 is actually set heading heading - 30
size
- inspect turtle, change size
- set size #
conditional
- if BE [do this if true]
2. ifelse BE [do this if true] [do this if false]
Context Results from count patches with [pcolor = black]
- observer: 1089
- patches: lists all pxcor and pycor of patches with pcolor black
count
of agents in an agentset
with
allows for specifying a subset of an agentset
reporter
- any function that returns a value
- to-report fxnName
report value
end
change species/ shape of turtle
set shape “…”
generate a random on interval [a , b]
(random (b - a + 1) + a
turtles and patches
a turtle can access the attribute variables of the patch it is standing on as if they were its own
ask
ask agentset [do these tasks]
Conway’s Game of Life
- world is 2-D grid of cells
- a cell may either be dead or alive
- any cell with less than 2 or more than 3 living neighbors dies
- any cell with 2 or 3 living neighbors stays alive
- any dead cell with exactly 3 living neighbors comes alive
cellular
of, relating to cells