gpt4 book ai didi

netlogo - 如何在线共享 NetLogo 模型

转载 作者:行者123 更新时间:2023-12-04 21:09:31 27 4
gpt4 key购买 nike

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

我发现可以使用 NetLogo web (http://www.netlogoweb.org/launch#http://www.netlogoweb.org/assets/modelslib/Sample%20Models/Biology/Evolution/Cooperation.nlogo) 在线运行模型,也可以将模型从 NetLogo 上传到 NetLogo web。上传的模型可以导出为 .html 文件。

我遇到的问题是为其他人可以运行的 .html 文件创建一个链接。我曾尝试直接共享 .html 文件名,并将其存放在 Dropbox 和 Google Drive 的开放访问文件夹中。虽然可以在 Dropbox 或 Google Drive 中访问该链接,但该文件不会运行。

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

最佳答案

你不是第一个遇到这个问题的人,所以我在 NetLogo Web FAQ 中添加了一个部分来解释情况和解决方案的样子。你可以找到文字here ,或内联在这篇文章的底部。

但是,我认为你真的不需要我写的整篇小论文。在我看来,您想使用 Dropbox,但并不明显 如何 .事实证明,the Dropbox documentation为如何在 Dropbox 上公开托管文件提供了很好的指南。如果您按照他们的说明进行操作,我认为您最终应该会得到一些易于共享的文件。关于如何在 NetLogo Web 中专门使用您的 Dropbox 文件公共(public) URL,您可以在 FAQ 文本中查看有关 Dropbox 的段落以获取更多详细信息。

来自常见问题的文本:

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.

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.

GitHub is also a good alternative to Dropbox for this. Instructions for how to host files on GitHub can be found here.

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.

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.

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 - 如何在线共享 NetLogo 模型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37817135/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com