NetLogo Web Save files?

132 views
Skip to first unread message

gunes

unread,
Jun 5, 2020, 6:46:55 PM6/5/20
to netlogo-users

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!

Aruho Tinka

unread,
Jun 12, 2020, 3:57:21 PM6/12/20
to gunes, netlogo-users
Dear Gunes,
I am also a learner like you, but I can share what I have found out!!
Here is the link that will take you to the Netlogo web: https://netlogoweb.org/

Choose the netlogoweb (first site) and NOT desktop.
You will be redirected to the netlogo web where you can either import your already developed model (though "choose a file" or "import any model from the library" that you want to explore or start from scratch by clicking "New".
If you want to save, since you are interested in running it on the web, you will save as an HTML file - the button is on the top right corner of the screen!
I hope this helps.
Good luck.

Aruho Tinka.

On Sat, Jun 6, 2020 at 12:47 AM gunes <gunes...@gmail.com> wrote:

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.

Jeremy Baker

unread,
Jun 15, 2020, 3:45:11 PM6/15/20
to gunes, netlogo-users

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

--

Reply all
Reply to author
Forward
0 new messages