在 Omnet++ 中指定随机数的种子

发布于 2024-10-07 10:02:19 字数 235 浏览 3 评论 0原文

只是想知道是否有人知道如何在 Omnet++ 中手动指定分发的种子。例如,使用 omnetpp.ini 文件如下:

[Config PacketProject]
network = PacketProject
**.stopTime = 5000s
PacketProject.webServer.interArrivalTime = exponential(0.025s)"

提前致谢!

Just wondering if anyone knows how to manually specify the seed for a distribution in Omnet++. For example, with the omnetpp.ini file as follows:

[Config PacketProject]
network = PacketProject
**.stopTime = 5000s
PacketProject.webServer.interArrivalTime = exponential(0.025s)"

Thanks in advance!

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

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

发布评论

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

评论(3

撕心裂肺的伤痛 2024-10-14 10:02:19

单击 INI 文件。不要使用源模式视图,仅停留在表单模式视图上。

单击左侧的“随机数”。您可以在那里指定种子。之后,您可以切换到源模式视图并查看其中添加的内容。

Click on the INI file. Dont use the source mode view, just stay on the form mode view.

Click on the left on "Random Numbers". There you can specify the seed. After that you can switch to source mode view and see what was added there.

り繁华旳梦境 2024-10-14 10:02:19

分布使用带有种子的 RNG 根据所选分布生成随机值。
显然,更改种子,您将生成不同的值。

默认情况下,Omnet++ 仅定义一个 RNG 以及与其关联的一颗种子。

您可以通过以下方式在文件 omnet.ini 中定义与 RNG 关联的种子(注意“集”一词):

repeat = number_of_repetition
seed-set = ${repetition}

现在,omnet 会自动将这组种子关联到您的 RNG(如结果您的模拟将重复 number_of_repetition 次)。

您还可以通过以下方式在文件 omnet.ini 中定义多个 RNG:

num-rngs = number_of_RNGs

现在,omnet 会自动将一组种子与您定义的每个 RNG 相关联。

假设你定义了2个RNG;您可以通过以下方式将 RNG 与文件 omnet.ini 中的发行版关联起来:

PacketProject.webServer.interArrivalTime = exponential(0.025s, 0)

注意第二个参数,它指定所选 RNG 的编号。

A distribution uses a RNG with a seed to generate random values in according to the distribution chosen.
Obviously, changing the seed, you will have different values generated.

By default Omnet++ defines only one RNG with one seed associated to it.

You can define a seed-set associated to a RNG (note the word set) in the file omnet.ini in this way:

repeat = number_of_repetition
seed-set = ${repetition}

Now, automatically, omnet will associate this set of seed to your RNG (as a result your simulation will be repeated number_of_repetition times).

You can also define multiple RNGs in the file omnet.ini in this way:

num-rngs = number_of_RNGs

Now, automatically, omnet will associate a set of seed to each RNG that you have defined.

Suppose that you have defined 2 RNGs; you can associate a RNG to a distribution in the file omnet.ini in this way:

PacketProject.webServer.interArrivalTime = exponential(0.025s, 0)

Note the second argument, that specifies the number of the RNG chosen.

柳若烟 2024-10-14 10:02:19

在 OMNeT++ 网站上有这篇文章,解释了如何设置随机数生成器算法以及如何播种 RNG。

On the OMNeT++ website there is this article that explains how to set the random number generator algorithms and how to seeding the RNGs.

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