Hey everyone,I am very inexperienced at NetLogo and I am having some issues. I have a forging task on NetLogo and I need to conduct my experiment online due to covid-19. I know it is possible to upload the model to a host site and create a link so that people can run it through the web app. However, I couldn't figure out how I can create save files for the participants (for their task data) if they run the model online, is it even a possibility? Thank you in advance!
--
You received this message because you are subscribed to the Google Groups "netlogo-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netlogo-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/netlogo-users/47ff71a4-931c-4df2-a9aa-6d49f5ad1902o%40googlegroups.com.
To save and load data in NetLogo Web is a little complicated because of the browser environment it runs in. There is no local file system we have access to in the browser, and any file system we could simulate wouldn't work quite the same. We have built some extensions that provide some options. I'll link to the docs for the desktop versions of the extensions, but they should work the same in NetLogo Web.
If you just want to let the user save some data from a model run to a file, the easiest way is to use the SendTo extension, the sendto:file primitive will prompt the user to save a file locally on their system. To get the data back into the model (if you need to), you'd need to use the Fetch extension's fetch:user-file-async primitive to prompt them to choose the file to upload. It requires user interaction, but is simple and effective.
If you just to save some data between runs of a model or loads of a model when a user refreshes the page, you could try out the Store extension. It provides a rudimentary way to persist string data by key.
If you want to control the data saved by the user at a central server, you also have the option of using the HttpReq extension to send data out of the browser by HTTP get and post requests, but this will require you to have setup an appropriate HTTP endpoint to receive those messages and handle them. This is the most complex solution. There isn't much documentation for the HttpReq extension, but an example is in the wiki docs for the logging extension.
I hope that's helpful.
-Jeremy
--