Anylogic:使用变量/滑块动态更改源速率

发布于 2025-02-05 05:56:11 字数 332 浏览 2 评论 0原文

我正在尝试使用链接到滑块的变量“到达”(请参阅​​图像)动态更改源到达率。

但是,在模拟过程中,即使我更改到达的情况下,初始速率也保持不变。我知道到达变量正在成功变化(这是一个INT) - 但这对模拟过程中的源率没有影响。

任何人都知道问题是什么 - 或如何解决?

source

I am trying to dynamically change the source Arrival rate using a variable "arrivalRate" linked to a slider (see image).

However, during the simulation the initial rate remains the same, even when I change the arrivalRate. I know that the arrivalRate variable is changing successfully (it is an int) - but this has no effect on the source rate during the simulation.

Anyone have an idea what the issue is - or how to fix it?

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

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

发布评论

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

评论(1

不弃不离 2025-02-12 05:56:11

每当您在字段之前看到=符号时,它意味着它不是动态的,它仅在模型的开头或元素创建时进行评估,除非您强制强制它,否则在整个模拟过程中不会更改。换句话说,仅检查一次变量到达以分配源的到达率,仅此而已。

现在,如果您想动态地更改它,在Slider的Action字段中,写下以下内容:

source.set_rate( arrivalRate );

Whenever you see the = sign before a field, it means it's not dynamic, it is only evaluated at the start of the model or at the element creation and will not change throughout the simulation run unless you force it. In other words, the variable arrivalRate is checked only once to assign the source's arrival rate and that's it.

Now if you want to change it dynamically, in the slider's Action field, write the following:

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