In the image above, turtles represent a single household. Each household has the following attributes: education qualification score (education), poverty status (poverty) and its access to electricity (electricity). The household's access to electricity is calculated based on a specified probability estimate formula. The color of the household is then defined by using the scale-color command.
create households 1 [
......
......
......
set electricity ........
set color scale-color red electricity 0.0 0.9
]
Here's another way to assign meaningful colors to turtles:
create-ordered-turtles [
set type one-of [0 1 2]
set color item type [55 115 125]
]
I used the type variable to indicate if it's a family member (type = 0), guest (type = 1)or sponsor (type = 2).
0 comments:
Post a Comment