NetLogo 与 Repast Simphony?

发布于 2024-08-09 15:37:13 字数 1539 浏览 5 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

陈甜 2024-08-16 15:37:13

我有一个网页,其中有几个打瞌睡的 netlogo 多代理模拟。我使用 netlogo 进行教学,我发现,一旦你克服了学习曲线,你就可以以惊人的速度开发模拟。在其他所谓的代理环境(Jade、Repast,实际上大多只是编程库)中需要花费 80 个工时的事情可以在 2 小时内完成。

另一方面,netlogo 并不适合需要大量细节的模拟,例如模拟从 TCP/IP 到 HTTP 的整个网络。无论编程语言如何,这都需要大量代码,如果您的程序最终超过 10 页长,那么 netlogo 目前就很糟糕。话虽如此,大多数人都会对 10 页 netlogo 代码所能完成的工作感到惊讶。

I have a webpage with a couple dozed netlogo multiagent simulations. I use netlogo for teaching and I have found that, once you get past the learning curve, you can develop simulations amazingly fast. Stuff that would take you 80 man-hours in other so-called agent environments (Jade, Repast, which are really mostly just programming libraries) can be done in 2 hours.

On the other hand, netlogo is not really good for simulations that require immense amount of details, like say simulating a network all the way from TCP/IP to HTTP. That would just require large amounts of code, regardless of programming language, and netlogo currently sucks if your program ends up being more that 10 pages long. Having said that, most people would be amazed at what you can get done in 10 pages of netlogo code.

陪你到最终 2024-08-16 15:37:13

简短回答:这取决于您想要使用的编程范例或语言,以及您想要的代理设计:

  • 如果您想要一种允许快速原型设计的低入门高天花板语言但复杂的模拟,并且愿意学习新的范式(避免循环)使用 NetLogo。良好的文档。

  • 如果您想制作一个在高度并行化集群上使用的真实应用程序,或者只是想使用 Java Groovy 或需要特定的 Java 库来实现您的目的,请使用 Repast 或更好的 高性能计算的 Repast(但要避免 ReLogo,它非常慢)。温和的文档。

  • 如果您想通过 FIPA 通信对认知代理(而不是反应性代理)进行建模,最好使用 Jason 或更好的 JaCaMo 支持 AgentSpeak + Java(因此您也可以使用您最喜欢的 Java 库),并且不需要 Groovy。糟糕的文档(大量不详细的功能和命令以及糟糕的过于复杂且未注释的示例)。

长答案:
免责声明:我对 NetLogo 更有经验,但我也使用过 Repast 和 Jason 等其他一些产品。

基本上,NetLogo 和 Repast 之间的区别在于,使用 NetLogo,您将拥有一个更简单的框架,但您需要学习如何以面向乌龟和补丁的范例进行编程,而在 Repast 中,您将必须学习 + Java Groovy 背后的机制,但您最终将获得更大的灵活性。速度并不是真正的标准(见下文)。

更清楚地说,如果您最大限度地使用海龟和补丁本机功能,您可以在 NetLogo 中高效地进行编程。例如,如果您想实现 A*,而不是实现节点列表,您应该直接使用补丁并使用如下内容过滤它们:

ask patchs with [criteria1 = value and criteria2 = value2] [do-some-stuff]
ask patchs with-min [criteria][do]
let var [somevalue] of min-one-of patches [criteria]

此外,如果您找不到有效执行您想要的操作的方法,请请务必检查是否存在扩展(另请检查此处位于库和工具下)以满足您的目的,例如现在的本机矩阵扩展,它允许我制作 NetLogo 中的高效神经网络

另一方面,Repast 可能比 NetLogo 更灵活(因为您可以访问整个 Java 库),但也更复杂一些,因为您必须知道如何处理 Groovy。

如果您只对速度感兴趣,请不要使用 ReLogo(类似于 NetLogo 的 Repast 语法),它已被证明比 NetLogo 慢很多(请参阅下面的 2012 年论文)。在任何情况下,您最好的选择是尝试使用上述技巧通过 NetLogo 实现,或者如果您想稍后真正使用您的应用程序,还有一个名为 Repast for High Performance Computing 的发行版它消除了海龟和补丁对象带来的大部分重载,因此它可以用于实际应用程序。 NetLogo 存在类似的扩展,可以在集群中进行并行计算,但它不是官方发行版。

如果您想了解有关不同平台的更多信息,这里是 2006 年的精彩回顾:

Railsback、SF、Lytinen、SL、 &杰克逊,SK(2006)。基于代理的模拟平台:审查和开发建议。模拟,82(9), 609-623。

以及本文在 2012 年处理 NetLogo 与 ReLogo 的更新版本:

Lytinen,SL,&旧金山雷尔斯巴克(2012 年 4 月)。基于代理的模拟平台的演变:netlogo 5.0 和 relogo 回顾。在第四届基于代理的建模与仿真国际研讨会的会议记录中。

/编辑:我引用了 Jason,但没有提供更多细节。如果您想对认知代理(而不是反应代理)进行建模,您可以在 NetLogo 中使用非官方的 BDI 扩展< /a> 效果很好,但有一点限制(但它很容易扩展,因为它是纯 NetLogo),但最好的选择是使用专门为认知代理建模而设计的框架,并完全支持 AgentSpeak。

Jason 非常好,因为您可以访问完整的 AgentSpeak 语言 + JAVA 来实现技术方面。事实上,你可以只使用 AgentSpeak 来完成整个项目(我就是这么做的),但你也可以制作更多面向 Java 的版本,这取决于你想如何设计你的程序,结果或多或少是相同的。这为您的设计工作流程提供了很大的灵活性。

提示:在文档中搜索 "Jason 内部操作" 以获得详细的描述可用的 AgentSpeak 命令。

另外,如果您对 Jason 感兴趣,您可能会对 JaCaMo (= Jason + Cartago + Moise) 感兴趣,这是合作的结果三个项目的作者创建了一个成熟的认知代理框架,该框架还可以对复杂环境(使用工件理论)和多代理组织(角色、群体、任务等)进行建模。

我知道但没有机会尝试的最后一个框架是支持 2D 和 3D 的 Mason环境。从来没有机会尝试这个,所以我不知道它与其他的相比如何,但你可以尝试一下。

Short answer: it depends on the programming paradigm or language you want to use, and the design you want for your agents:

  • If you want a low-entry-high-ceiling language allowing quick prototyping but sophisticated simulations, and are willing to learn a new paradigm (avoiding loops) use NetLogo. Good documentation.

  • If you want to make a real application to use on highly-parallelized clusters or just want to use Java Groovy or need a specific Java library for your purpose, use Repast or better Repast for High Performance Computing (but avoid ReLogo which is very slow). Mild documentation.

  • If you want to model cognitive agents (instead of reactive) with FIPA communications, better use Jason or better JaCaMo which supports AgentSpeak + Java (so you can also use your favourite Java libraries), and there's no Groovy required. Bad documentation (a lot of non detailed features and commands and bad too-complex-not-commented examples).

Long answer:
Disclaimer: I am more experienced with NetLogo but I also used Repast and a few others like Jason.

Basically, the difference between NetLogo and Repast is that with NetLogo you will have a simpler framework but you'll need to learn how to program in a turtle-and-patch-oriented paradigm, while in Repast you will have to learn that + the mechanisms behind Java Groovy but you will eventually get more flexibility. Speed isn't really a criteria here (see below).

To be more clear, you can program efficiently in NetLogo if you use to a maximum the turtles and the patchs native functions. For example, if you want to implement A*, instead of implementing a list of nodes, you should directly use the patchs and filter them using stuffs like this:

ask patchs with [criteria1 = value and criteria2 = value2] [do-some-stuff]
ask patchs with-min [criteria][do]
let var [somevalue] of min-one-of patches [criteria]

Also if you can't find a way to efficiently do what you want, be sure to check if maybe an extension exists (check also here under Libraries and Tools) for your purpose, like the now native matrix extension which allowed me to make an efficient neural network in NetLogo.

On the other hand, Repast is potentially more flexible than NetLogo (since you have access to the whole range of Java libraries), but a bit more complex since you have to know how to handle Groovy.

If you are solely interested in speed, do NOT use ReLogo (NetLogo-like syntax for Repast) which has been shown to be a whole lot slower than NetLogo (see the 2012 paper below). In any cases, your best bet would either to try an implementation with NetLogo using the tricks above, or if you want to use your application for real later, there is also a distribution called Repast for High Performance Computing which removes most of the overload that come with turtles and patchs objects, and thus it can be used for real applications. A similar extension exists for NetLogo to compute in clusters with parallelization but it's not an official distribution.

If you want more infos about the diverse platforms, here is a nice review of 2006:

Railsback, S. F., Lytinen, S. L., & Jackson, S. K. (2006). Agent-based Simulation Platforms: Review and Development Recommendations. SIMULATION, 82(9), 609-623.

And an updated version of this paper in 2012 dealing with NetLogo vs ReLogo:

Lytinen, S. L., & Railsback, S. F. (2012, April). The evolution of agent-based simulation platforms: A review of netlogo 5.0 and relogo. In Proceedings of the Fourth International Symposium on Agent-Based Modeling and Simulation.

/EDIT: I cited Jason but didn't give any more details. If you want to model cognitive agents (instead of reactive agents), you can do that in NetLogo using the unofficial BDI extension which works well but is a bit limited (but it's easily extensible since it's pure NetLogo), but your best bet is to use a framework specifically designed to model cognitive agent with full support of AgentSpeak.

Jason is very nice since you have access to a full AgentSpeak language + JAVA to implement the technical side. In fact, you can do whole projects using only AgentSpeak (which I did), but you can also make more Java-oriented versions, it's up to you how you want to design your program, the result will be more or less the same. This offers you a lot of flexibility in your design workflow.

Tip: search for "Jason internal actions" in the documentation to get a good description of the available AgentSpeak commands.

Also if you are interested in Jason, you might be interested in JaCaMo (= Jason + Cartago + Moise) which is the result of a cooperation of three projects authors to make a full-fledged cognitive agents framework which also can model complex environments (with artifacts theory) and multi-agents organisations (roles, groups, missions, etc.).

A last framework I know of but didn't have a chance to try is Mason which supports 2D and 3D environments. Never had a chance to try this one so I don't know how this compares with the others but you can try it out.

很酷又爱笑 2024-08-16 15:37:13

几个月前,当我必须为我的模拟选择一个框架时,我或多或少遇到了同样的问题。我看了 Repast、NetLogo、Swarm 和 Jade。
NetLogo 很好,我尝试编写一些简单的测试应用程序,但由于我想使用 Java 作为我的编程语言,NetLogo 不是最佳选择。 Repast 几乎拥有编写大型模拟所需的一切,并且有许多项目(特别是在社会科学领域)都使用了 Repast。我对 Repasts 的问题是:糟糕的 API 文档、传递给从未使用过且完全没有任何意义的方法或构造函数的参数(查看源代码)以及大量样板代码。
我现在使用 Jade (http://jade.tilab.com/),我真的对此感到满意。社区很好,他们的邮件列表非常活跃。好吧,Jade 只是一个基于代理建模的库和框架。您没有像 Repast 中的可视化编辑器那样的东西,您必须编写自己的工具来可视化结果。

干杯

I had more or less the same problem a few months ago when I had to choose a framework for my simulation. I look at Repast, NetLogo, Swarm and Jade.
NetLogo was nice and I tried to write some simple test applications but since I wanted to use Java as my programming language, NetLogo wasn't the best candidate. Repast has pretty much everything you need to write larger simulations and there are many projects (especially in social sciences) where Repast is used. My problems with Repasts were: bad API documentation, parameters that are passed to methods or constructers that are never used and don't make any sense at all (have a look at the source code) and a lot of boilerplate code.
I'm using Jade (http://jade.tilab.com/) now and I'm really happy with it. The community is good and their mailing list is VERY active. Okay, Jade is just a library and a framework for agent-based modelling. You don't get anything like those visual editor in Repast and you'll have to write your own tool for visualising the results.

Cheers

行雁书 2024-08-16 15:37:13

您可以使用名为“数据包”的代理类型来模拟流量,该代理类型将生成并从名为“机器人”的代理发送到另一个名为“机器人”或“服务器”的代理。您无需将数据包发送到 IP 地址,而是将它们发送到一对 X 和 Y 坐标。

Netlogo 有一个病毒如何在网络中传播的示例,这可能是一个很好的起点。

You could simulate the traffic using a agent type called "packet" that will be spawned and send from a agent called "bot" to another agent called "bot" or "server". Instead of sending the packets to a IP address, you would be sending them to a pair of X and Y coordinates.

Netlogo has an example of how a virus spreads in a network, this might be a good starting point.

还在原地等你 2024-08-16 15:37:13

我从未尝试过 NetLogo,但我尝试过 Repast-J 和 Simphony。 Simphony 似乎不错,但目前我坚持将边缘类型从直线更改为曲线。没有足够的文档和示例。
有一次我尝试了Mason,它也是基于java的。它与 Repast-J 类似,但速度更快。不过最近梅森并没有太大的发展。
我想稍后尝试一下 Jade。

I have never tried NetLogo, but have I tried Repast-J and Simphony. It seems Simphony is good, but at the moment I am stuck at changing the Edge type from straight line to curved one. There is not enough documentation and examples available.
Once I tried Mason which is based on java, too. It is similar to Repast-J, yet it was faster. But recently there is not much development in Mason.
I would like to try out Jade later.

三寸金莲 2024-08-16 15:37:13

如果您已经会用 Java 编写代码,您还可以查看以下论文,对 RePastSwarmQuicksilver>VSEit,不同的免费编程库,用于支持基于社会科学代理的计算机模拟

托比亚斯、罗伯特和卡罗尔·霍夫曼。 “评估用于基于社会科学代理的模拟的免费 Java 库。” Journal of Artificial Societies and Social Simulation 7.1 (2004)。

Repast 肯定比 NetLogo 更灵活,但 RePast Symphony 的文档不是很详细

If you can already code in Java, you can also look at the following paper for a comparison between RePast, Swarm, Quicksilver, and VSEit, different freely available programming libraries for support of social scientific agent based computer simulation

Tobias, Robert, and Carole Hofmann. "Evaluation of free Java-libraries for social-scientific agent based simulation." Journal of Artificial Societies and Social Simulation 7.1 (2004).

Repast is definitely more flexible than NetLogo but the documentation is not very detailed for RePast Symphony

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文