1 / 14

Exploring Netlogo

Exploring Netlogo. Beth Fulton. April 2012. Essential Components. Patches (environment) Turtles (agents) breeds (different kinds) Links Observers Built-in tools, features to help (keep manual handy ) variables: color , location observer’s = globals routines (primitives)

didina
Download Presentation

Exploring Netlogo

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Exploring Netlogo Beth Fulton April 2012

  2. Essential Components • Patches (environment) • Turtles (agents) • breeds (different kinds) • Links • Observers • Built-in tools, features to help (keep manual handy) • variables: color, location • observer’s = globals • routines (primitives) • commands (act); reporters (calculate statistic & report)

  3. Description of model Coding window Netlogo GUI GUI (controls) Specific queries (Advanced)

  4. Netlogo GUI Speed Turn off map updates for super speedy run ALWAYS press first (initialisation) Start (Stop) Set parameters

  5. Netlogo GUI Aggregate time series plot Aggregate indicator (statistic)

  6. turtle = agent Coding Key Points Check code syntax Globals & attributes Setup Go Routines called by Go

  7. turtle = agent Coding Key Points primitive ;; Comment

  8. Coding hints • Use Netlogo dictionary: (icon for relevancy) • turtle • link • observer • patch • Each block of code has a context (kind of agent that can execute it) • e.g. can’t use patch primitives in turtle context • button related routine = observer context • change context ask XXX [XXX context]

  9. Coding hints let local variable set (first time) by the entity creating it (only works within the procedure or [ ] where the local variable is defined set to set value of existing variable of get the value of a variable belonging to another entity one-of for single case of if want list from agentset ask get another entity to change the value of its variable

  10. Globals Needed For • For global variables (define world) • Fixed parameters used by all (so only enter once) • Interface sliders, switches etc refer to globals • Any parameter to be changed in batch runs • Use carefully as run the risk of in appropriate sets • For agent level variables use patches-own turtles-own links-own

  11. When all else fails export-world writes ALL variable values to one file import-world reads in ALL variable values (“hot start” model) • Can also export plot contents etc • file is more refined way of getting specific output

  12. Psuedo code trips Netlogo C to end [ ] varvar + abc ; ifelsething_to_test [ do xyz ] ;; true case [do ijk ] ;; false case void () { return } { } var = var + abc; OR var += abc; // OR /* */ if (thing_to_test) { do xyz; // true case } else { do ijk; // false case } Spaces important !!

  13. Lets Play

  14. Thank you • CMAR Beth FultonSenior Research Scientist t +61 3 6232 5018 ebeth.fulton@csiro.au wwww.cmar.csiro.au

More Related