![]() ![]() To agent-setup set up agent parameters, including the country of the agent Show (word "Randomly created " (count persons) " people" ) Let fractional-part (num-people - (floor num-people)) Let num-people (population-density * patch-area-sqkm / 10000000 ) this is an overestimate, since country does not occupy entire patch) The sprout- primitive is used to create the agents: to create-random #Netlogo code examples PatchWe can effectively create 1.3671 agents per patch by always creating one agent, and creating an additional one with probability 0.3671. To take India as an example, the population density is 283.7 people per square kilometre, which works out to 13,671,000 people per patch, which will be represented by 1.3671 agents (this is in fact a slight overestimate, since the sum total of India’s patches have a slightly greater area than the country itself). How should we create the agents? The simplest answer is to use those calculated population densities, combined with the fact that the average patch has an area of 510,000,000 / N square kilometres, where N is the number of patches (ignoring the substantial distortion due to the map projection). The ask which follows calculates the population density of each patch, and colours it appropriately. Here the calls to gis:apply-coverage copy values from the GIS country dataset to the named patch variables. Set pcolor (scale-color red population-density 400 0 ) ] Set population-density (population / area) [ Colour patch according to population density Gis:apply-coverage countries-dataset "CNTRY_NAME" country-name Gis:apply-coverage countries-dataset "SQKM" area Show "Loading patches." gis:apply-coverage countries-dataset "POP_CNTRY" population Loading the GIS data is much like Uri Wilensky’s “GIS General Examples” model (specific details will be given later), while the following procedure sets up the population density data in the patches: to setup-gis The same approach, with different GIS datasets, allows models of individual countries, states, or cities, with populations determined by GIS data on, for example, counties or suburbs. Nodes are turtles, edges are links.Constructing agent populations in this way allows agents to have country-dependent behaviour. This makes the network "bipartite." (You might position the two kinds of nodes in two straight lines.) NETLOGO FEATURES Make two kinds of nodes, differentiated by color, then only allow links to connect two nodes that are different colors.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |