CSCI 1006 Lecture Notes - Lecture 8: Empty Set, Cyan

34 views3 pages
Mod (like remainder) 21 mod 4 = 1
If statements are not connected. Each if statement is performed individually. It is
possible for nothing to happen. Ifelse is necessary to interconnect the
statements.
Ifelse (random 4 = 0) [set pcolor magenta]
[ifelse (random 3 = 0)
[set pcolor cyan]
[ifelse (random 2 = 0)
[set pcolor violet]
[set pcolor lime]]]
Count agentset
Returns the total number of agents in the given set
Count patches = 1089
Agentset with condition
o Returns an agent set that only contains the agents that satisfy the
condition
o Patches with [pcolor = magenta]
o The empty set is called ‘nobody’ (if no agents satisfy)
Wiggle- Common name for a custom procedure that creates random turtle
movement
find more resources at oneclass.com
find more resources at oneclass.com
Unlock document

This preview shows page 1 of the document.
Unlock all 3 pages and 3 million more documents.

Already have an account? Log in

Document Summary

Mod (like remainder) 21 mod 4 = 1. Ifelse (random 4 = 0) [set pcolor magenta] Returns the total number of agents in the given set. Agentset with condition: returns an agent set that only contains the agents that satisfy the condition, patches with [pcolor = magenta, the empty set is called nobody" (if no agents satisfy) Wiggle- common name for a custom procedure that creates random turtle movement. It will wait . 1 seconds to perform (for forever buttons) because it will go in a blink of an eye otherwise. For insanity (slider)- smaller numbers are more circular and cover larger area. Going right then left will be straighter. All and only the newly created turtles obey. We can add our own properties to turtles and patches. To add your own property, at the top of the procedures tab: turtles-own [property, patches-own [property] You can declare multiple properties in one line.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers