C++ 的离散事件模拟器

发布于 2024-09-29 00:06:42 字数 161 浏览 8 评论 0原文

我目前正在寻找为 C++ 编写的离散事件模拟器。我在网上没有找到太多专门用 OO 风格编写的内容;有一些,但已经过时了。其他一些,例如 Opnet、Omnet 和 ns3 对于我需要做的事情来说太复杂了。此外,我需要模拟基于代理的算法,能够模拟数千个节点的系统。

有人知道什么适合我的需求吗?

I am currently looking for a discrete event simulator written for C++. I did not find much on the web written specifically in OO-style; there are some, but outdated. Some others, such as Opnet, Omnet and ns3 are way too complicated for what I need to do. And besides, I need to simulate agent-based algorithms capable of simulating systems of thousands of nodes.

Does anybody know anything suitable for my needs?

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

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

发布评论

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

评论(6

七七 2024-10-06 00:06:42

其他人有很好的直接答案,但我会建议一个替代方案。如果我理解正确的话,您需要一个 C++ 或类似系统,您可以在其中发布将来触发的事件,并且在这些事件触发时运行代码。

我有一个这样的项目,我开始尝试用 C++ 编写这样的事件系统,然后很快意识到我有一个更好的解决方案。

您是否考虑过用行为 Verilog 编写程序?用硬件描述语言编写软件可能看起来很奇怪,但 Verilog 模拟器底层是基于事件的系统,行为 Verilog 是表达事件、时序、触发器等的一种非常方便的方式。有一个免费的 Verilog 模拟器(这就是我使用的)称为 Icarus Verilog。如果您不使用 Ubuntu 或某些已包含在软件包中的 Icarus Linux 发行版,则从源代码构建非常简单。

Others have good direct answers, but I'm going to suggest an alternative. If I understand you right, you want a system in C++ or such where you can post events that fire in the future, and code is run when those events fire.

I had a project to do like this, and I started out trying to write such an event system in C++ and then quickly realized I had a better solution.

Have you considered writing your program in behavioral Verilog? That may seem strange to write software in a hardware description language, but a Verilog simulator is an event-based system underneath, and behavioral Verilog is a very convenient way to express events, timing, triggers, etc. There is a free Verilog simulator (which is what I used) called Icarus Verilog. If you're not using Ubuntu or some Linux distro with Icarus already in a package, building from source is straightforward.

有木有妳兜一样 2024-10-06 00:06:42

我建议再看一下 OmNet++。乍一看,它可能看起来相当复杂,但如果您更详细地研究它,您会发现大部分复杂性都在网络附加组件(INET 框架)中。除非您要进行详细的网络模拟,否则不需要 INET。

使用 OmNet++ 核心并不是特别困难,而且可能比其他类似工具更简单。

您可能想查看简介

OmNet++ 对我有吸引力的原因之一是它的可扩展性。可以在桌面上运行大型模拟。此外,可以将相同的模拟扩展到集群,而无需重写代码。

I would recommend having a second look to OmNet++. At first sight it may look quite complex, but if you look it into more detail you will find that most of the complexity is in the network add-on (the INET Framework). Unless you are going to do a detailed network simulation you do not need the INET.

Using OmNet++ core is not specially difficult and it may be simpler than other similar tools.

You may want to have a look to an intro.

One of the things that makes OmNet++ attractive to me is its scalability. Is possible to run large simulations in a desktop. Besides, it is possible to scale the same simulation to a cluster without rewriting the code.

迷乱花海 2024-10-06 00:06:42

您应该考虑 SystemC,尽管我还建议您再看一下 OmNet++。

You should consider SystemC, although I'd also recommend taking a second look at OmNet++.

情感失落者 2024-10-06 00:06:42

我们在我的学校使用 SIMLIB。它非常快速、易于理解、面向对象、离散和连续模拟器。它可能看起来已经过时,但仍然得到维护。

We use SIMLIB at my school. It is very fast, easy to understand, object oriented, discrete and continuous simulator. It might look outdated but it is still maintained.

℡Ms空城旧梦 2024-10-06 00:06:42

Mesquite Software 提供的 CSIM 支持用 C、C++ 和 Java 开发模型。然而,据我所知,它是付费商业。

There is CSIM from Mesquite Software which supports developing models in C, C++ and Java. However, it is paid-commercial, AFAIK.

静谧幽蓝 2024-10-06 00:06:42

查看GBL 库。它是用现代 C++ 编写的,甚至支持 C++0x 功能,例如移动语义和 lambda 函数。它提供了多种建模机制:同步和异步事件处理程序、抢占式线程和纤程。您可以创建纯粹的行为模型、周期精确模型和实时模型,或这些模型的任意组合。

Take a look at GBL library. It's written in modern C++ and even supports C++0x features like move semantics and lambda functions. It offers several modeling mechanisms: synchronous and asynchronous event handlers, preemptive threads, and fibers. You can create purely behavioral, cycle accurate, and real-time models, or any mixture of those.

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