![]() The other difficulty is that, because of the substantial distortion due to the map projection, there are not enough agents in countries near the equator (like Brazil), and too many in countries near the poles (like Russia). Examples of such small countries include Singapore (population 2.8 million), Rwanda (7.9 million), and Burundi (6.0 million). This is in spite of the fact that populations of countries occupying zero grid squares don’t get counted at all. Notice that over-estimating the number of agents per grid square has given a population which is too large. The black line on the histogram below shows the average value of 584, while the dotted line shows the actual world population (some years ago) of 5.695 billion (corresponding to 570 agents). This code gives a different result each time, with between 540 and 640 agents created. 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 We 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. Constructing agent populations in this way allows agents to have country-dependent behaviour.
0 Comments
Leave a Reply. |