如何在线共享NetLogo模型 [英] How to share a NetLogo model online

查看:129
本文介绍了如何在线共享NetLogo模型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在线共享我的NetLogo模型,以便其他人可以在未安装NetLogo桌面的情况下在他们的笔记本电脑或智能手机上运行它.

I'm trying to share my NetLogo model online so that it can be run by others on their laptops or smartphones without NetLogo desktop installed.

我发现可以使用NetLogo Web在线运行模型(

I have found that it is possible to run models online with NetLogo web (http://www.netlogoweb.org/launch#http://www.netlogoweb.org/assets/modelslib/Sample%20Models/Biology/Evolution/Cooperation.nlogo) and also possible to upload a model from NetLogo to NetLogo web. The uploaded model can be exported as a .html file.

我遇到的麻烦是为.html文件创建一个链接,其他人可以运行该文件.我尝试过直接共享.html文件名,也将其存储在Dropbox和Google云端硬盘的打开访问文件夹中.在Dropbox或Google驱动器中可以访问该链接时,该文件将不会运行.

What I am having trouble with is creating a link for the .html file which others can run. I have tried sharing the .html file name directly and also depositing it in an open access folder in Dropbox and Google Drive. While the link is accessible in Dropbox or Google drive, the file will not run.

任何有关下一步尝试的建议将不胜感激!

Any suggestions for what to try next would be greatly appreciated!

推荐答案

您距离第一个遇到此问题的人还很远,因此我在NetLogo Web FAQ中添加了一个部分来说明这种情况以及解决方案.解决方案看起来像.您可以在此处找到文本,或在本文的底部直接内嵌

You're far from the first person to run into this problem, so I've added a section to the NetLogo Web FAQ to explain the situation and what the solutions look like. You can find the text here, or inline at the bottom of this post.

但是,我认为您真的不需要我写的整个迷你文章.在我看来,您想使用Dropbox,但操作方式尚不清楚.事实证明, Dropbox文档为如何在Dropbox上公开托管文件提供了很好的指导. .如果您遵循他们的指示,我认为您最终应该拥有一些易于共享的文件.关于如何在NetLogo Web上专门使用Dropbox文件的公共URL,有关更多详细信息,请参见FAQ文本中有关Dropbox的段落.

However, I don't think you really need the whole mini-essay that I wrote. It sounds to me like you wanted to use Dropbox, but it just wasn't apparent how. As it turns out, the Dropbox documentation provides a good guide for how you can host files publicly on Dropbox. If you follow their instructions, I think you should end up with some files that are easily shareable. Regarding how to specifically use your Dropbox file public URLs with NetLogo Web, you can see the paragraph about Dropbox in the FAQ text for more details.

简而言之,唯一需要的是托管服务,该服务允许直接链接到托管文件.但是,如今免费和易于使用的托管服务数量却很少.我们意识到这使许多用户感到困难,并且我们绝对计划提供自己的服务,以使将来的人们更容易使用.不过,暂时而言,我们仍然可以建议几个选择.

To put it concisely, the only thing required is a hosting service that allows directly linking to hosted files. However, free and simple to use hosting services are surprisingly few in number these days. We realize that this makes things difficult for many of our users, and we definitely plan to provide our own service that makes this easier for people in the future. For the time being, though, there are still a couple of options that we can suggest.

对于绝大多数NetLogo Web用户而言,一个不错的选择是使用 Dropbox ,这是一种成本-free选项用于文件托管.要将NetLogo Web文件托管在Dropbox上,您必须公开托管它们(如此处).完成此操作后,如果您的文件是.nlogo文件,请按照此处给出的说明进行操作,并共享//netlogoweb.org/web?modelURL链接,使用Dropbox中的公共链接URL作为modelURL值.如果相反,您的文件是HTML独立模型(按照有关导出:HTML"的部分此处中的说明生成),则只需共享公共链接是从Dropbox获得的,因为它将直接指向模型.

For the vast majority of NetLogo Web users, a great option is to use Dropbox, which is a cost-free option for file-hosting. To host NetLogo Web files on Dropbox, you must host them publicly (as explained here). Once you've done that, if your file is a .nlogo file, follow the instructions given here, and share the //netlogoweb.org/web?modelURL link, using the public link URL from Dropbox for the modelURL value. If instead, your file is a HTML standalone model (as generated by following the instructions in the section about "Export: HTML" here), then simply share the public link that you got from Dropbox, since it will point directly to the model.

另一种选择是使用建模通用模型,它是用于上载,共享和讨论NetLogo模型的公共空间.通过模型页面上的在NetLogo Web中运行"选项卡,所有上载到Modeling Commons的模型都已与NetLogo Web集成.对于任何模型,如果打开运行"选项卡,然后复制浏览器的当前URL,则该URL可用于直接访问模型的NetLogo Web版本.

Another option is to use the Modeling Commons, which is a public space for uploading, sharing, and discussing NetLogo models. All models uploaded to the Modeling Commons have integration with NetLogo Web through the "Run in NetLogo Web" tab on the model's page. For any model, if you open that "Run" tab and then copy your browser's current URL, that URL can be used for direct access to the NetLogo Web version of the model.

另一个选项(对于更高级的用户)是将文件自己托管在您有权访问的面向公众的Web服务器上.如果您想托管HTML独立模型(通过遵循有关导出:HTML"部分中的说明生成,请此处),然后直接托管它并将链接分发到您托管HTML文件的位置.

One other option (for more advanced users) is to host the files yourself on a public-facing web server that you have access to. If you want to host an HTML standalone model (as generated by following the instructions in the section about "Export: HTML" here), then simply host it and distribute the link to where you're hosting the HTML file.

在Web服务器上托管.nlogo文件更为复杂.为此,请托管文件,并确保您的Web服务器允许跨源访问该文件.为此,您可能需要服务器将.nlogo文件的HTTP响应中的Access-Control-Allow-Origin标头设置为*或您正在使用的任何NetLogo Web域(即http://netlogoweb.orghttps://netlogoweb.orghttp://netlogo-web.orghttps://netlogo-web.org).然后,按照此处给出的说明进行操作,并通过//netlogoweb.org/web?modelURL链接共享您的模型,使用Web服务器上模型的URL作为modelURL值.

Hosting a .nlogo file on a web server is more complicated, though. To do that, host the file, and make sure that your web server allows it to be accessed cross-origin. To do this, you might need to have the server set the Access-Control-Allow-Origin header in the .nlogo file's HTTP response to either * or whichever NetLogo Web domain you're using (i.e. http://netlogoweb.org or https://netlogoweb.org or http://netlogo-web.org or https://netlogo-web.org). Then, follow the instructions given here, and share your model through the //netlogoweb.org/web?modelURL link, using the URL of the model on the web server for the modelURL value.

这篇关于如何在线共享NetLogo模型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆