An agentset can only contain agents and it implies that there is no order among the agents within it. Remember that a list is different from an agentset in NetLogo. In general, the syntax works like this: foreach list-of-items. We will soon turn each point in the point dataset of airports into its own NetLogo agent, but first let's just import the dataset and draw it using the gis:draw command to ensure it is being loaded correctly.Īs before, to load a dataset you need to create a global variable to store the dataset and then set the value of that global variable to be the result of gis:load-dataset.įoreach numbers for each *number* in the list *numbers*, print out (show) *that number* times 2. Our next step is to set up our airport agents, which will hatch airplanes and keep track of how many infected individuals are present in their vicinity. Gis:draw states-dataset 1 draw the states dataset using a line with a width of 1 Gis:set-world-envelope gis:envelope-of states-dataset set up the mapping between map/gis space to NetLogo world space reset any other global variables you might be using here Set states-dataset gis:load-dataset "states_continental.shp " nlogo file, but you might have to change the file paths if you've set up your project differently for some reason. I've set up my project so that all the shapefiles I am going to be using are in the same directory as the. Note that like all other file import methods in NetLogo, the filenames we use will be relative to the. To get our feet wet, let's start by importing our states shapefile to use as a background/basemap. This tells NetLogo that we want to be using the GIS extension and will allow us to use all the primitives defined by the GIS extension if we preface them with gis. Go ahead an open up a new NetLogo file and write extensions at the top of the code tab. Now that we're finally done with data preprocessing, we can get to work on actually using the GIS extension. If you had any issues getting any of these GIS steps to work, I have provided final versions of all the files you'll need to import into NetLogo so you can continue on with the tutorial if you wish.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |