![]() ![]() When multiple agents are provided in a NetLogoR function, they all execute the function at the same time. The agents running a NetLogoR function is one of the function arguments that need to be provided.Īsk-concurrent: not implemented. Use deg() from CircStats to convert the result in degrees.Īsk: not implemented. Use deg() from CircStats to convert the result in degrees.Īrithmetic operators: +, *, -, /, ^,, = or = (depends if it is for setting or testing), !=, =.Īsin: asin(), returns value in radians. ![]() The NetLogo primitives not implemented should not prevent the users from building individual-based models involving patches and turtles.įor the inverse dictionary ( i.e., to find the NetLogo equivalents of the NetLogoR functions) please look at the NetLogoR documentation as the links to NetLogo Dictionary entries for the equivalent primitives are provided in the “See Also” section of each NetLogoR function.Īcos: acos(), returns value in radians. When no NetLogoR function was built to translate a NetLogo primitive and that, to our knowledge, no R function (or from other packages) could easily recreate the primitive, we indicated “not implemented”. To find how to use these functions, please refers to their documentation by using help("nameFunction"). Are suggested as replacements, functions from the NetLogoR package, as well as functions from the R software and of other packages (indicated below). It lists all the entries in the NetLogo Dictionary ( i.e., NetLogo primitives) and informs the best replacements to use in R. Code below the jump.This document is based on the NetLogo Dictionary. Not quite as nice as embedding, but it’ll work. To use it just save what’s below as a text file with the extension to “.nlogo”. nlogo file is just a text file so I can put the whole thing in the post, including the GUI elements. Set-current-plot "Totals" set-current-plot-pen "adoptions" plot count turtles with ![]() In lieu of embedding the whole simulation, here’s the “procedure” source code, which will only work if you hook the variables “constant-hazard” and “endogenous-hazard” and the plot-pen “Totals:adoption” to GUI elements. ![]() Even doing it locally on my mac, the embed doesn’t works in Safari (but does work in Chrome, Firefox, and Opera). Note that in theory you can embed a NetLogo simulation in a webpage but I don’t know how to get WordPress to do this. So while this sim doesn’t do anything new it’s nice that I can extend it to do new things. (Actually the model library already has this in the form of the “virus on a network” model but the point is that it’s flexible). The really exciting thing though is that NetLogo makes it much easier to do simulations with network and/or spatial structure so I could refine the model to have structure. After just a few hours of reading the tutorial, I was able to write the script below, which is kind of a replication of an older Stata script. The basic “models library” includes biology models like wolf-sheep as well as some social science models that I already lecture on but didn’t have a dynamic illustration for, most notably Barabasi’s preferential attachment model and the team assembly model Uzzi et al developed on Broadway musicals. As part of my prep work for attending James Kitts’ “ Modeling Emergence” workshop at ASA I’ve been playing with NetLogo and there’s some really cool stuff in there. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |