Data from pplapi can be loaded into NetLogo in several ways:
If you choose to use live API data, this will result in your simulations using different agent data each time. NetLogo will require two extensions in order to smoothly integrate: web and csv. See below for help installing these extensions.
extensions [web csv] breed [agents agent] agents-own [language country_tld age income sex religion date_of_birth id_str internet country_name id] to get-pplapi [country_code] let filename "sample.csv" file-close-all file-delete filename web:download-file "http://pplapi.com/batch/500/sample.csv" filename file-open filename while [not file-at-end?] [ let row csv:from-row file-read-line create-agents 1 [ set language (item 0 row) set country_tld (item 1 row) set age (item 2 row) set income (item 3 row) set sex (item 4 row) set religion (item 5 row) set date_of_birth (item 6 row) set id_str (item 7 row) set internet (item 8 row) set country_name (item 9 row) set id (item 10 row) pen-down ] ] end
One consequence of the live API is that you may retrieve a maximum of 500 agents per API request. Because you may make up to 6 requests per minute, this means your simulations will typically involve 3000 or fewer agents.
This will result in your simulations always using the same data for every simulation run. Because you may build up a large archive of sample data over the course of hours or days, there is no practical limit to the size of the simulation you can attempt with archived pplapi.com data.
The full list of NetLogo extensions is available here. You can directly download web.zip and csv.zip. After you have unzipped them, copy all of the .jar files into your Netlogo 5.x/extensions folder. In my case, NetLogo is installed to my Applications folder so I copy the .jar files to /Applications/Netlogo 5.x/extensions.
The following works on my OS X computer:
unzip csv-*.zip web-*.zip mv *.jar "/Applications/Netlogo 5.3/extensions"
The NetLogo Web Extension enables your simulation to make requests to web resources for data. Because pplapi.com provides data as a web resource, this extension is perfect for integrating pplapi.com data into your simulations. Download the Web Extension here.