Scale-color Example
Model was written in NetLogo 5.0.4
•
Viewed 655 times
•
Downloaded 98 times
•
Run 0 times
Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)
WHAT IS IT?
This code example demonstrates the scale-color
reporter. As a turtle's x-coordinate becomes larger, the turtle acquires a brighter color. Similarly, as a turtle's x coordinate becomes smaller, the turtle acquires a darker shade. The center of the world is (0, 0).
THINGS TO NOTICE
The tails of the turtles on the right edge of the world are visible on the left edge of the view.
Comments and Questions
Please start the discussion about this model!
(You'll first need to log in.)
Click to Run Model
to setup clear-all ; clear all patch and turtle variables create-turtles 500 [ ; create 500 turtles in the center of the world setxy random-xcor random-ycor ; place turtles randomly set heading 270 ; face west recolor ] reset-ticks end to go ask turtles [ fd 1 recolor ] tick end to recolor ;; turtle procedure ; The turtle sets its color according to its x-coordinate. ; As its x-coordinate approaches the left side of the world, ; the turtle becomes darker. ; As its x-coordinate moves to the right side of the world, ; the turtle becomes lighter set color scale-color shading xcor min-pxcor max-pxcor end ; Public Domain: ; To the extent possible under law, Uri Wilensky has waived all ; copyright and related or neighboring rights to this model.
There are 10 versions of this model.
Attached files
File | Type | Description | Last updated | |
---|---|---|---|---|
Scale-color Example.png | preview | Preview for 'Scale-color Example' | over 12 years ago, by Uri Wilensky | Download |
This model does not have any ancestors.
This model does not have any descendants.