Hello everyone,--I'm working on a model in Netlogo and I'm trying to give different patches different colors. For example, I want to give around 50% of the patches in a certain area the color green, 25% the color gray and 25% the color blue.Here is my code:extensions [ gis ] globals [ wien-grenzen temperature ] patches-own [ random-n centroid ID patch-type ] breed [rays ray] breed [IRs IR] breed [heats heat] breed [CO2s CO2] breed [suns sun] breed [trees tree] breed [peoples people] breed [industries industry] breed [cars car] suns-own [sun-speed] to setup clear-all set-default-shape rays "ray" set-default-shape IRs "ray" set-default-shape heats "dot" set-default-shape CO2s "CO2-molecule" set-default-shape suns "sun" set-default-shape trees "tree" set-default-shape industries "industry" setup-map set-surface set temperature 0 reset-ticks plot temperature end to setup-map clear-all set wien-grenzen gis:load-dataset "Bezirksgrenzen.shp" gis:set-world-envelope (gis:envelope-of wien-grenzen) let i 1 foreach gis:feature-list-of wien-grenzen [ feature -> ask patches gis:intersecting feature [ ; set centroid gis:location-of gis:centroid-of feature ; ask patch item 0 centroid item 1 centroid [ ; set ID i ; ] set ID i ] set i i + 1 ] gis:set-drawing-color white gis:draw wien-grenzen 1.5 ; create-suns 1 ; [ ; set color yellow ; set size 6 ; setxy (min-pxcor + 2) 22.6 ; set heading 90 ; set sun-speed 0.025 ; ] end to set-surface ask patches with [ID > 0] [ set random-n random-float 15 ifelse random-n >= 7 [ gis:set-drawing-color green + 1.5 set pcolor green + 1.5 ] [ gis:set-drawing-color gray + 2.5 set pcolor gray + 2.5 ] gis:set-drawing-color white gis:draw wien-grenzen 1.5 end to go run-sunshine run-CO2 ; run-heat ; run-IR tick plot temperature ask suns [ run-sun ] ask trees [ catch-CO2s ] ask industries [ emmit-CO2s ] endI also added a picture of the world, where I'm trying to set different colored patches. Thank you for any help.
You received this message because you are subscribed to the Google Groups "netlogo-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netlogo-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/netlogo-users/edcc8408-e963-4e64-b7ea-20dc22baa29c%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/netlogo-users/etPan.5e1a7032.75b5864.4482%40aleria.tech.
-- Dale Frakes Adjunct Instructor, PhD Candidate PSU Systems Science dfr...@pdx.edu - http://web.pdx.edu/~dfrakes/