Computer Science- Netlogo Primitives Flashcards

(23 cards)

1
Q

ca

A
  • observer

- clear all, kills all living entities and sets all vars to defeault

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

crt

A
  • observer

- creates n turtles, placed at the origin with random headings

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

fd

A
  • turtle

- move forward n units

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

lt

A
  • turtle

- move left n degrees

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

rt

A
  • turtle

- move right n degrees

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

pd

A
  • turtle

- lower the pen to “paper” (pen down), starts tracing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

pu

A
  • turtle

- stops tracing, pen up

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

random

A
  • observer
  • if n is positive, returns [0, n)
  • if n is negative, returns (n, 0]
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

who

A
  • immutable turtle attribute

- who # will not be reassigned until ca

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

other

A

returns agentset without calling agent

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

die

A
  • turtle

- kills turtles

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

ask

A
  • allows communication across contexts

- its command block is issued from 1 or more entities to 1 or more entities

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

mod

A
  • obs context
  • residue of num1 / num2 , similar to remainder but different results for negative numbers
  • equivalent to: num1 - (floor (num1/num2)) * num2
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

floor

A
  • observer

- reports largest integer less than or equal to number

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

neighbors

A

returns agentset of neighboring patches

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

count

A
  • turtle/patch/link

- reports the number of agents in the given agentset

17
Q

with

A
  • allows for specifying a subset of an agentset

- agentset WITH [reporter]

18
Q

breed [ ]

A

defines a breed

19
Q

-own [var1 …]

A

defines variables/ attributes belonging to each turtle, patch, breed, etc.

20
Q

mouse-down?

A

reports true if mouse button is down, false otherwise

21
Q

mouse-xcor and mouse-ycor

A
  • reports the x or y coordinate of the mouse in 2-D view

- in terms of turtle coordinates (may not be an integer)

22
Q

scale-color

A
  • ask agent [set (p)color scale-color color # range1 range2]
  • if range1 < range2, greater number = lighter shade
  • number < range1, darkest shade of color is chosen
  • number > range2, lightest shade of color is chosen
23
Q

shade-of? color1 color2

A

reports true if both colors are shades of one another