Travel Heat Color 2
Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)
WHAT IS IT?
(a general understanding of what the model is trying to show or explain)
HOW IT WORKS
(what rules the agents use to create the overall behavior of the model)
HOW TO USE IT
(how to use the model, including a description of each of the items in the Interface tab)
THINGS TO NOTICE
(suggested things for the user to notice while running the model)
THINGS TO TRY
(suggested things for the user to try to do (move sliders, switches, etc.) with the model)
EXTENDING THE MODEL
(suggested things to add or change in the Code tab to make the model more complicated, detailed, accurate, etc.)
NETLOGO FEATURES
(interesting or unusual features of NetLogo that the model uses, particularly in the Code tab; or where workarounds were needed for missing features)
RELATED MODELS
(models in the NetLogo Models Library and elsewhere which are of related interest)
CREDITS AND REFERENCES
(a reference to the model's URL on the web if it has one, as well as any other necessary credits, citations, and links)
Comments and Questions
extensions [rnd] globals [ sizew total-shades ; the total number of shades ( <= 100) midpoint-nl-color ; the named NetLogo color at the midpoint (last digit is 5) num-turtles ticks-per-round ] patches-own [ heat ; number in darkness range, ; with 0 = white, total-shades/2 = midpoint-nl-color, total-shade = black ] to setup clear-all random-seed 10100 set num-turtles 2 set ticks-per-round 5000 set midpoint-nl-color orange set total-shades 100 set sizew 60 resize-world 0 sizew 0 sizew set-patch-size 10 set-default-shape turtles "default" init-turtles num-turtles ask patches [ set heat 0 set pcolor white] reset-ticks end to init-turtles [ n ] create-turtles n [ setxy 0 0 ;hide-turtle set color yellow set size 3 ] end to go ask turtles [ set heat heat + 1 ask patch-here [recolor-patch ] move-random ] tick end to move-random right random 360 forward 1 end ; use heat + .5 because there should be some chance of moving to a patch that was never visited to move-weighted move-to rnd:weighted-one-of neighbors [ heat + .5 ] end ; It's faster to only recolor the patch being visited to recolor-patch set pcolor make-nl-color-shade midpoint-nl-color heat total-shades end ; Reports a color ranging from white to 'nl-color' to black as ; 'shade-value' ranges from 0 to 'num-shades ; ; nl-color a NetLogo color with last digit 5: can be referenced by name ; shade-value darkness number with 0 = white, shade-value/2 = nl-color, num-shades = black ; numbers < 0 will be set to 0, numbers > num-shades will be set to num-shades ; num-shades the total number of shades ( <= 100) to-report make-nl-color-shade [ nl-color shade-value num-shades] ; shade-value is forced to be between 0 and num-shades set shade-value min list num-shades max list 0 shade-value report scale-color nl-color shade-value num-shades 0 end
There is only one version of this model, created 11 months ago by Aaron Brandes.
Attached files
File | Type | Description | Last updated | |
---|---|---|---|---|
Travel Heat Color 2.png | preview | Preview for 'Travel Heat Color 2' | 11 months ago, by Aaron Brandes | Download |
This model does not have any ancestors.
This model does not have any descendants.