![]() Ifelse ( file-exists? "File IO Patch Data.txt" ) [ If you push “load-patch-data”, a window opens that looks like this:ĭoesn’t seem like anything else happened, but when you push that button, some code runs in the background: to load-patch-data If you open this model, there are three buttons: “load-patch-data”, “show-patch-data”, and “load-own-patch-data”. An example of this can be found in the Code Examples section of the NetLogo model library (“File Input ogo”). ![]() One way to bring data into NetLogo would be to use the file input-output commands, which allow Netlogo to read in text files according to user-defined rules. Importing GIS data using file input/output commands You’ll want to consider these when you add in your data, as these will influence how your data is translated to the NetLogo world. Here you can set your origin point, maximum and minimum coordinates, patch size, and whether or not the world “wraps” as a toroid or cylinder. NetLogo has an in-built, gridded topology which can be manipulated by right clicking on the world window in the NetLogo interface and selecting “edit”. these patches are “grass”, other patches are “not grass”). However, for most applications, the spatial data generated by NetLogo models are gross abstractions (e.g. ![]() The NetLogo platform possesses several of the basic characteristics of a GIS, in the sense that it keeps track of spatial data in a systematic way, and can be used to create visualizations of spatial data. ![]() In this tutorial, I’ll talk about how to do this using NetLogo. If we want to build models that operate in realistic geographic settings (and many archaeological applications of agent-based models are aimed at this goal see here or here for examples), we need to find a way of integrating geographic data with models. For archaeology and other disciplines where the systems under study are cannot be confined to a laboratory, this often means being able to consider our data in spatial terms. This is certainly useful when dealing with a general problem like segregation, but what if we have a specific case study to which we want to apply our model? The integration of models with case-specific datasets becomes particularly important when our models are to be used for policy and decision-making. In these instances, it is often necessary to have models that are capable of producing results that can be interpreted in real-world terms. Of course, that may not be so easy to implement in your real model.Classic agent-based models like Schelling’s model of segregation use very simple ideas about how the world works to explore how complex structures might emerge from simple behavioral rules. However, a better way to do this is with the map procedure instead of foreach because all the values are changed at once rather than looping through the list and dealing with each. The procedure change-interpretation2 is the way to implement your approach, replacing each item and creating the new list (addressing the problems identified). The procedure change-intention1 is the way you are currently thinking about it (my interpretation anyway). The code is self contained - open a new model and try it out, changing the call in the testme procedure to different implementations. The second is that you can't use set to do that, you have to use replace-item. The first is that lists are not mutable - if you want to change the value in a list, you have to create a new list with that value.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |